From e23ce6647f106165623b3b0240a9c3c9257bc27e Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 22 Oct 2026 08:17:13 +0100 Subject: [PATCH] Fix: Use Lua dispatch syntax for log out and DPMS, repair swaync power/lock buttons Co-Authored-By: Claude Opus 5.5 --- dotfiles/.config/hypr/hypridle.conf | 10 +++++----- .../.config/quickshell/modules/bar/PowerButton.qml | 2 +- dotfiles/.config/swaync/config.json | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dotfiles/.config/hypr/hypridle.conf b/dotfiles/.config/hypr/hypridle.conf index 5852afa..cb64908 100644 --- a/dotfiles/.config/hypr/hypridle.conf +++ b/dotfiles/.config/hypr/hypridle.conf @@ -8,7 +8,7 @@ general { lock_cmd = pidof hyprlock || hyprlock # runs hyprlock if it is not already running (this is always run when "loginctl lock-session" is called) # unlock_cmd = killall hyprlock # kills hyprlock when unlocking (this is always run when "loginctl unlock-session" is called) before_sleep_cmd = loginctl lock-session # ensures that the session is locked before going to sleep - after_sleep_cmd = hyprctl dispatch dpms on # turn of screen after sleep (not strictly necessary, but just in case) + after_sleep_cmd = hyprctl dispatch 'hl.dsp.dpms({action = "on"})' # turn of screen after sleep (not strictly necessary, but just in case) ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam) } @@ -16,8 +16,8 @@ general { # (disabled by default) # listener { # timeout = 30 # 30 seconds -# on-timeout = pidof hyprlock && hyprctl dispatch dpms off # turns off the screen if hyprlock is active -# on-resume = pidof hyprlock && hyprctl dispatch dpms on # command to run when activity is detected after timeout has fired. +# on-timeout = pidof hyprlock && hyprctl dispatch 'hl.dsp.dpms({action = "off"})' # turns off the screen if hyprlock is active +# on-resume = pidof hyprlock && hyprctl dispatch 'hl.dsp.dpms({action = "on"})' # command to run when activity is detected after timeout has fired. # } # Warn @@ -38,8 +38,8 @@ listener { # (disabled by default) # listener { # timeout = 630 # 10.5 min -# on-timeout = hyprctl dispatch dpms off # command to run when timeout has passed -# on-resume = hyprctl dispatch dpms on # command to run when activity is detected after timeout has fired. +# on-timeout = hyprctl dispatch 'hl.dsp.dpms({action = "off"})' # command to run when timeout has passed +# on-resume = hyprctl dispatch 'hl.dsp.dpms({action = "on"})' # command to run when activity is detected after timeout has fired. # } # Suspend # disabled by default diff --git a/dotfiles/.config/quickshell/modules/bar/PowerButton.qml b/dotfiles/.config/quickshell/modules/bar/PowerButton.qml index 45cefa2..8a7e9d9 100644 --- a/dotfiles/.config/quickshell/modules/bar/PowerButton.qml +++ b/dotfiles/.config/quickshell/modules/bar/PowerButton.qml @@ -119,7 +119,7 @@ Item { { label: "Lock", icon: "lock", cmd: ["hyprlock"] }, { label: "Suspend", icon: "bedtime", cmd: ["systemctl", "suspend"] }, { label: "Hibernate", icon: "ac_unit", cmd: ["systemctl", "hibernate"] }, - { label: "Log out", icon: "logout", cmd: ["hyprctl", "dispatch", "exit"] }, + { label: "Log out", icon: "logout", cmd: ["hyprctl", "dispatch", "hl.dsp.exit()"] }, { label: "Reboot", icon: "restart_alt", cmd: ["systemctl", "reboot"] }, { label: "Shut down", icon: "power_settings_new", cmd: ["systemctl", "poweroff"] } ] diff --git a/dotfiles/.config/swaync/config.json b/dotfiles/.config/swaync/config.json index a0f359f..144fccd 100755 --- a/dotfiles/.config/swaync/config.json +++ b/dotfiles/.config/swaync/config.json @@ -56,15 +56,15 @@ "actions": [ { "label": "󰐥", - "command": "bash -c $HOME/.config/hypr/scripts/Wlogout.sh" + "command": "bash -c $HOME/.config/rofi/powermenu/type-2/powermenu.sh" }, { "label": "󰌾", - "command": "bash -c $HOME/.config/hypr/scripts/LockScreen.sh" + "command": "loginctl lock-session" }, { "label": "󰍃", - "command": "hyprctl dispatch exit" + "command": "hyprctl dispatch 'hl.dsp.exit()'" }, { "label": "󰀝",