fix(hyprland): use hypridle systemd service instead

This commit is contained in:
Barrett Ruth 2026-02-21 01:42:52 -05:00
parent 9c0b2186ce
commit a5c4aecba2
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 23 additions and 26 deletions

View file

@ -82,7 +82,6 @@ exec-once = wl-paste --watch cliphist store
exec-once = [ -f "${XDG_PICTURES_DIR:-$HOME/Pictures}/Screensavers/wallpaper.jpg" ] || ctl wallpaper wall
exec-once = [ -f "${XDG_PICTURES_DIR:-$HOME/Pictures}/Screensavers/lock.jpg" ] || ctl wallpaper lock
exec-once = hyprpaper
exec-once = hypridle
exec-once = hypr windowrules
exec-once = hypr spawnfocus --ws 1 $TERMINAL -e mux
exec-once = hypr spawnfocus --ws 2 $BROWSER

View file

@ -54,7 +54,6 @@ in
]
++ [
pkgs.hyprlock
pkgs.hypridle
];
xdg.configFile."hypr/themes/midnight.conf".text = mkHyprTheme config.palettes.midnight;
@ -111,26 +110,24 @@ in
}
'';
xdg.configFile."hypr/hypridle.conf".text = ''
general {
lock_cmd = ctl wallpaper lock && hyprlock
after_sleep_cmd = hyprctl dispatch dpms on
}
# listener {
# timeout = 300
# on-timeout = ctl wallpaper lock && hyprlock
# }
listener {
timeout = 600
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
}
listener {
timeout = 1800
on-timeout = systemctl suspend
}
'';
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "ctl wallpaper lock && hyprlock";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 600;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
}

View file

@ -400,11 +400,12 @@ power)
;;
idle)
require notify-send
if pkill hypridle; then
if systemctl --user is-active --quiet hypridle.service; then
systemctl --user stop hypridle.service
tmux set -g lock-after-time 0 2>/dev/null
notify-send -a ctl -t 2500 'idle off'
else
hypridle &
systemctl --user start hypridle.service
tmux set -g lock-after-time 300 2>/dev/null
notify-send -a ctl -t 2500 'idle on'
fi