Swayidle: Difference between revisions
mNo edit summary |
Fix swaymsg package (prior to this change: `swaymsg: command not found`) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 27: | Line 27: | ||
# TODO: modify "display" function based on your window manager | # TODO: modify "display" function based on your window manager | ||
# Sway | # Sway | ||
display = status: "swaymsg 'output * power ${status}'"; | display = status: "${pkgs.sway}/bin/swaymsg 'output * power ${status}'"; | ||
# Hyprland | # Hyprland | ||
# display = status: "hyprctl dispatch dpms ${status}"; | # display = status: "hyprctl dispatch dpms ${status}"; | ||
| Line 57: | Line 57: | ||
{ | { | ||
event = "before-sleep"; | event = "before-sleep"; | ||
command = display "off"; | # adding duplicated entries for the same event may not work | ||
command = (display "off") + "; " + lock; | |||
} | } | ||
{ | { | ||
| Line 69: | Line 66: | ||
{ | { | ||
event = "lock"; | event = "lock"; | ||
command = | command = (display "off") + "; " + lock; | ||
} | } | ||
{ | { | ||
| Line 81: | Line 74: | ||
]; | ]; | ||
}; | }; | ||
}} | |name=~/.config/home-manager/home.nix|lang=nix}} | ||
See [https://man.archlinux.org/man/extra/swayidle/swayidle.1.en the man page] for further information. | See [https://man.archlinux.org/man/extra/swayidle/swayidle.1.en the man page] for further information. | ||