diff --git a/home-manager/modules/sway/default.nix b/home-manager/modules/sway/default.nix index 0078394..21bfe22 100644 --- a/home-manager/modules/sway/default.nix +++ b/home-manager/modules/sway/default.nix @@ -7,7 +7,8 @@ with lib; let cfg = config.eboskma.programs.sway; mod = "Mod4"; swaylockcmd = "${pkgs.swaylock}/bin/swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image ${cfg.lock-wallpaper} --scaling fill"; - rofiPower = pkgs.writeShellScriptBin "rofi-power" (builtins.readFile ./powermenu.sh); + rofiPower = pkgs.writeShellScriptBin "rofi-power" + (builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString cfg.lock-wallpaper) ] (builtins.readFile ./powermenu.sh)); in { options.eboskma.programs.sway = { @@ -304,14 +305,13 @@ in services = { swayidle = { enable = true; - events = { - lock = [ - { - name = "lock"; - command = "lock"; - } - ]; - }; + events = [ + { + event = "lock"; + command = swaylockcmd; + } + ]; + timeouts = [ { timeout = 900; diff --git a/home-manager/modules/sway/powermenu.sh b/home-manager/modules/sway/powermenu.sh index af270a8..feca699 100755 --- a/home-manager/modules/sway/powermenu.sh +++ b/home-manager/modules/sway/powermenu.sh @@ -23,7 +23,7 @@ exit_wm="󰗼" # Icon: exit_to_app # Variable passed to rofi options="${shutdown}\n${reboot}\n${lock}\n${hibernate}\n${exit_wm}" uptime=$(uptime | awk '{print $1}' || true) -lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image /home/erwin/.wallpapers/river-2560.png --scaling fill" +lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image {WALLPAPER} --scaling fill" chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"