diff --git a/homeManagerModules/desktop/hypr/hypridle/default.nix b/homeManagerModules/desktop/hypr/hypridle/default.nix index 743e270c..a2d1df15 100644 --- a/homeManagerModules/desktop/hypr/hypridle/default.nix +++ b/homeManagerModules/desktop/hypr/hypridle/default.nix @@ -2,6 +2,7 @@ pkgs, lib, config, + osConfig, ... }: { options = { @@ -46,7 +47,7 @@ listener { timeout = 900 # 15min - on-timeout = [ $(${pkgs.nettools}/bin/hostname) != "mauville" ] && ${pkgs.systemd}/bin/systemctl suspend # suspend pc unless on mauville + on-timeout = ${if osConfig.networking.hostName == "mauville" then "" else "${pkgs.systemd}/bin/systemctl suspend"} # suspend pc unless on mauville } ''; }; diff --git a/homeManagerModules/desktop/river/default.nix b/homeManagerModules/desktop/river/default.nix index 4fe132cd..f69bba21 100644 --- a/homeManagerModules/desktop/river/default.nix +++ b/homeManagerModules/desktop/river/default.nix @@ -2,6 +2,7 @@ pkgs, lib, config, + osConfig, ... }: { imports = [./randomWallpaper.nix]; @@ -130,9 +131,29 @@ launcher = pkgs.fuzzel + "/bin/fuzzel"; notifyd = pkgs.mako + "/bin/mako"; wallpaperd = pkgs.swaybg + "/bin/swaybg -i ~/.local/share/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg"; - idle = pkgs.swayidle + "/bin/swayidle"; logout = pkgs.wlogout + "/bin/wlogout"; lock = pkgs.swaylock + "/bin/swaylock -f -c 000000"; + idled = + if osConfig.networking.hostName == "mauville" + then '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ + resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ + timeout 300 '${lock} \ + timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ + resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ + before-sleep '${lock}' + '' + else '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ + resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ + timeout 300 '${lock}' \ + timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ + resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ + timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \ + before-sleep '${lock}' + ''; riverctl = pkgs.river + "/bin/riverctl"; brightness = "${pkgs.swayosd}/bin/swayosd-client"; @@ -332,7 +353,7 @@ ${pkgs.swayosd}/bin/swayosd-server & ${fileManager} --daemon & ${bar} & - ${idle} -w timeout 300 '${lock}' before-sleep '${lock}' & + ${idled} & ''; }; } diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index 92049a21..b7c91f2d 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -2,6 +2,7 @@ pkgs, lib, config, + osConfig, ... }: { imports = [./randomWallpaper.nix]; @@ -70,9 +71,29 @@ launcher = pkgs.fuzzel + "/bin/fuzzel"; notifyd = pkgs.mako + "/bin/mako"; wallpaperd = pkgs.swaybg + "/bin/swaybg -i ~/.local/share/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg"; - idle = pkgs.swayidle + "/bin/swayidle"; logout = pkgs.wlogout + "/bin/wlogout"; lock = pkgs.swaylock + "/bin/swaylock -f -c 000000"; + idled = + if osConfig.networking.hostName == "mauville" + then '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ + resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ + timeout 300 '${lock} \ + timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ + resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ + before-sleep '${lock}' + '' + else '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ + resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ + timeout 300 '${lock}' \ + timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ + resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ + timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \ + before-sleep '${lock}' + ''; brightness = "${pkgs.swayosd}/bin/swayosd-client"; brightness_up = "${brightness} --brightness=raise"; @@ -281,18 +302,7 @@ {command = "${pkgs.swayosd}/bin/swayosd-server";} {command = "${pkgs.networkmanagerapplet}/bin/nm-applet";} {command = "${pkgs.trayscale}/bin/trayscale --hide-window";} - { - command = '' - ${pkgs.swayidle}/bin/swayidle -w \ - timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ - resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ - timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' \ - timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ - resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ - timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \ - before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000' - ''; - } + {command = "${idled}";} ]; output = { "BOE 0x095F Unknown" = {