sway: Manage swayidle with systemd
This commit is contained in:
parent
d8f75f167a
commit
e17aa4bc6b
|
@ -213,13 +213,6 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# Auto lock
|
|
||||||
exec ${pkgs.swayidle}/bin/swayidle -w \
|
|
||||||
timeout 300 "${pkgs.swaylock}/bin/swaylock -f -i ${wallpaper}" \
|
|
||||||
timeout 300 'swaymsg "output * dpms off"' \
|
|
||||||
resume 'swaymsg "output * dpms on"' \
|
|
||||||
before-sleep "${pkgs.swaylock}/bin/swaylock -f -i ${wallpaper}"
|
|
||||||
|
|
||||||
# Cursor
|
# Cursor
|
||||||
seat seat0 xcursor_theme Adwaita
|
seat seat0 xcursor_theme Adwaita
|
||||||
|
|
||||||
|
@ -239,6 +232,22 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.services.swayidle = {
|
||||||
|
Unit.PartOf = [ "sway-session.target" ];
|
||||||
|
Install.WantedBy = [ "sway-session.target" ];
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.swayidle}/bin/swayidle -w \
|
||||||
|
timeout 300 "${pkgs.swaylock}/bin/swaylock -f -i ${wallpaper}" \
|
||||||
|
timeout 300 'swaymsg "output * dpms off"' \
|
||||||
|
resume 'swaymsg "output * dpms on"' \
|
||||||
|
before-sleep "${pkgs.swaylock}/bin/swaylock -f -i ${wallpaper}"
|
||||||
|
'';
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Start on tty1
|
# Start on tty1
|
||||||
programs.zsh.initExtra = ''
|
programs.zsh.initExtra = ''
|
||||||
if [[ -z $WAYLAND_DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
|
if [[ -z $WAYLAND_DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
|
||||||
|
|
Loading…
Reference in a new issue