home/swayidle: switch swaylock for swaylock_fancy script

This commit is contained in:
Asmir A 2023-11-13 16:50:38 +01:00
parent ee50755eea
commit 08b97f204f
Signed by: asmir
GPG Key ID: 020C42B7A9ABA3E2

View File

@ -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";
}
];
};