Swayidle: Difference between revisions
Fix events with duplicated entries not working |
m Added install through config/sway |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
Swayidle is an idle management daemon for Wayland. | [https://github.com/swaywm/swayidle Swayidle] is an idle management daemon for Wayland. | ||
== Installation == | == Installation == | ||
=== Standalone === | |||
{{File|3=environment.systemPackages = with pkgs; [ | |||
swayidle | |||
];|name=/etc/nixos/configuration.nix|lang=nix}} | |||
{{ | === Home Manager - Standalone === | ||
{{File|3=services.swayidle.enable = true;|name=/etc/nixos/home.nix|lang=nix}} | |||
}} | |||
=== Home Manager - Through Sway === | |||
{{File|3=programs.sway.extraPackages = with pkgs; [swayidle];|name=/etc/nixos/home.nix|lang=nix}} | |||
== Configuration == | == Configuration == | ||
| Line 18: | Line 23: | ||
# Suspend the system | # Suspend the system | ||
which could be set using {{ic|services.swayidle.timeouts}}. {{ic|services.swayidle.events}} is useful to make the behavior consistent with the above in case {{ic|systemctl suspend}}, {{ic|loginctl lock-session}} are manually run. | which could be set using {{ic|services.swayidle.timeouts}}. {{ic|services.swayidle.events}} is useful to make the behavior consistent with the above in case {{ic|systemctl suspend}}, {{ic|loginctl lock-session}} are manually run. | ||
Additional options may be found within the Home Manager Appendix under [https://nix-community.github.io/home-manager/options.xhtml#opt-services.swayidle.enable services.swayidle]. | |||
{{file|~/.config/home-manager/home.nix|nix|3= | {{file|~/.config/home-manager/home.nix|nix|3= | ||
| Line 27: | Line 34: | ||
# 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 74: | Line 81: | ||
]; | ]; | ||
}; | }; | ||
}} | |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. | ||
[[Category:Wayland]] | |||