summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-02-22 23:00:31 +0100
committerAhmed Abdelhalim <[email protected]>2026-02-22 23:33:26 +0100
commit6c7ecc514acbab6b4ef2ef55239068a24077f21b (patch)
tree82e073c2bf56c7eb8c29f2f1c2ee05ef44ff47d6 /roles
parent23d67bbb70291bf3046c57c6768dc1727b1077b2 (diff)
Add hyprshutdown and configure hyprlock to use it
Diffstat (limited to 'roles')
-rw-r--r--roles/hyprland/meta/main.yml1
-rw-r--r--roles/hyprland/templates/hyprlock.conf.j26
-rw-r--r--roles/hyprshutdown/meta/argument_specs.yml6
-rw-r--r--roles/hyprshutdown/meta/main.yml12
-rw-r--r--roles/hyprshutdown/tasks/main.yml8
5 files changed, 30 insertions, 3 deletions
diff --git a/roles/hyprland/meta/main.yml b/roles/hyprland/meta/main.yml
index a657398b..bc3c0c79 100644
--- a/roles/hyprland/meta/main.yml
+++ b/roles/hyprland/meta/main.yml
@@ -18,6 +18,7 @@ dependencies:
- role: "tofi"
- role: "hyprcursor"
- role: "hyprtheme"
+ - role: "hyprshutdown"
galaxy_info:
author: "a14m"
description: "Install hyprland"
diff --git a/roles/hyprland/templates/hyprlock.conf.j2 b/roles/hyprland/templates/hyprlock.conf.j2
index f2da8ec3..22fb5f20 100644
--- a/roles/hyprland/templates/hyprlock.conf.j2
+++ b/roles/hyprland/templates/hyprlock.conf.j2
@@ -112,7 +112,7 @@ label {
font_family = $font
color = $font_color
- onclick = reboot
+ onclick = hyprctl dispatch exec hyprshutdown --no-fork -t "Restarting..." --post-cmd "systemctl reboot"
halign = center
valign = center
@@ -127,7 +127,7 @@ label {
font_family = $font
color = $font_color
- onclick = shutdown now
+ onclick = hyprctl dispatch exec hyprshutdown --no-fork -t "Shutting down..." --post-cmd "systemctl poweroff"
halign = center
valign = center
@@ -142,7 +142,7 @@ label {
font_family = $font
color = $font_color
- onclick = systemctl suspend
+ onclick = loginctl lock-session && systemctl suspend
halign = center
valign = center
diff --git a/roles/hyprshutdown/meta/argument_specs.yml b/roles/hyprshutdown/meta/argument_specs.yml
new file mode 100644
index 00000000..e6a24b29
--- /dev/null
+++ b/roles/hyprshutdown/meta/argument_specs.yml
@@ -0,0 +1,6 @@
+---
+argument_specs:
+ main:
+ short_description: "Install hyprshutdown"
+ description: "Install hyprshutdown"
+ options: {}
diff --git a/roles/hyprshutdown/meta/main.yml b/roles/hyprshutdown/meta/main.yml
new file mode 100644
index 00000000..cc09be8d
--- /dev/null
+++ b/roles/hyprshutdown/meta/main.yml
@@ -0,0 +1,12 @@
+---
+dependencies:
+ - role: "yay"
+galaxy_info:
+ author: "a14m"
+ description: "Install hyprshutdown"
+ license: "MIT"
+ min_ansible_version: "2.18"
+ platforms:
+ - name: "ArchLinux"
+ versions:
+ - "all"
diff --git a/roles/hyprshutdown/tasks/main.yml b/roles/hyprshutdown/tasks/main.yml
new file mode 100644
index 00000000..3986905c
--- /dev/null
+++ b/roles/hyprshutdown/tasks/main.yml
@@ -0,0 +1,8 @@
+---
+- name: "Ensure hyprshutdown is installed"
+ become: true
+ become_user: "aur_builder"
+ kewlfft.aur.aur:
+ name: "hyprshutdown"
+ state: "present"
+ use: "yay"