summaryrefslogtreecommitdiffstats
path: root/roles/hyprland/templates
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-02-23 18:43:08 +0100
committerAhmed Abdelhalim <[email protected]>2026-02-23 18:43:08 +0100
commitd0ec647b2cdc8263e24ea3af588aa1c0add56e29 (patch)
tree3df9673c78f0541e2b889a8129b5ed2b63fb7081 /roles/hyprland/templates
parent5c0639bfe6e06ae3ad58a1aa29d9070eb9df502e (diff)
Refactor power.sh to be the entry point for power control
Diffstat (limited to 'roles/hyprland/templates')
-rw-r--r--roles/hyprland/templates/hypridle.conf.j26
-rw-r--r--roles/hyprland/templates/hyprlock.conf.j26
2 files changed, 6 insertions, 6 deletions
diff --git a/roles/hyprland/templates/hypridle.conf.j2 b/roles/hyprland/templates/hypridle.conf.j2
index 2c060988..e99b93be 100644
--- a/roles/hyprland/templates/hypridle.conf.j2
+++ b/roles/hyprland/templates/hypridle.conf.j2
@@ -2,14 +2,14 @@
general {
lock_cmd = pidof hyprlock || hyprlock
- before_sleep_cmd = loginctl lock-session # lock before suspend
+ before_sleep_cmd = /etc/hypr/scripts/power.sh --lock
after_sleep_cmd = hyprctl dispatch dpms on
}
# Lock the screen (after 5 minutes)
listener {
timeout = 300
- on-timeout = loginctl lock-session
+ on-timeout = /etc/hypr/scripts/power.sh --lock
}
# Turn off screen (after 10 minutes)
@@ -22,5 +22,5 @@ listener {
# Suspend the system (after 15 minutes)
listener {
timeout = 900
- on-timeout = systemctl suspend
+ on-timeout = /etc/hypr/scripts/power.sh --hibernate
}
diff --git a/roles/hyprland/templates/hyprlock.conf.j2 b/roles/hyprland/templates/hyprlock.conf.j2
index 22fb5f20..0a2e2d0f 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 = hyprctl dispatch exec hyprshutdown --no-fork -t "Restarting..." --post-cmd "systemctl reboot"
+ onclick = /etc/hypr/scripts/power.sh --reboot
halign = center
valign = center
@@ -127,7 +127,7 @@ label {
font_family = $font
color = $font_color
- onclick = hyprctl dispatch exec hyprshutdown --no-fork -t "Shutting down..." --post-cmd "systemctl poweroff"
+ onclick = /etc/hypr/scripts/power.sh --shutdown
halign = center
valign = center
@@ -142,7 +142,7 @@ label {
font_family = $font
color = $font_color
- onclick = loginctl lock-session && systemctl suspend
+ onclick = /etc/hypr/scripts/power.sh --hibernate
halign = center
valign = center