diff --git a/home/home.nix b/home/home.nix index a7e6c3c..8105ebf 100644 --- a/home/home.nix +++ b/home/home.nix @@ -208,26 +208,33 @@ with lib; { pinentryFlavor = "curses"; }; - swayidle = { + swayidle = let + locker = pkgs.writeShellScriptBin "swaylock_fancy" '' + TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.jpg) + ${pkgs.grim}/bin/grim -t ppm - | ${pkgs.imagemagick}/bin/convert - -blur 0x12 "$TMP_FILE" + ${pkgs.swaylock}/bin/swaylock -f -i "$TMP_FILE" + ${pkgs.coreutils}/bin/rm "$TMP_FILE" + ''; + in { enable = true; events = [ { event = "before-sleep"; - command = "${pkgs.swaylock}/bin/swaylock"; + command = "${locker}/bin/swaylock_fancy"; } { event = "lock"; - command = "${pkgs.swaylock}/bin/swaylock"; + command = "${locker}/bin/swaylock_fancy"; } { event = "after-resume"; - command = "${procps.pkill}/bin/pkill -USR1 i3status-rs"; + command = "${pkgs.procps}/bin/pkill -USR1 i3status-rs"; } ]; timeouts = [ { timeout = 15 * 60; - command = "${pkgs.swaylock}/bin/swaylock"; + command = "${locker}/bin/swaylock_fancy"; } ]; };