home/fuji: switch screen locker
This commit is contained in:
+10
-13
@@ -274,35 +274,32 @@ in
|
|||||||
|
|
||||||
swayidle =
|
swayidle =
|
||||||
let
|
let
|
||||||
locker = pkgs.writeShellScriptBin "swaylock_fancy" ''
|
att_lock = pkgs.writeShellScriptBin "att_lock" ''
|
||||||
ALL_IMGS=""
|
ALL_IMGS=""
|
||||||
LOCK_ARGS=""
|
LOCK_ARGS=""
|
||||||
for OUTPUT in $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${lib.getExe pkgs.jq} -r '.[].name')
|
for OUTPUT in $( ${inputs.att_wm.packages.${system}.default}/bin/att_wmctl state | ${lib.getExe pkgs.jq} -r '.outputs[].name')
|
||||||
do
|
do
|
||||||
TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.jpg)
|
TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.png)
|
||||||
${lib.getExe pkgs.grim} -t ppm -o $OUTPUT - | \
|
${lib.getExe pkgs.grim} -t ppm -o $OUTPUT - | \
|
||||||
${lib.getExe pkgs.ffmpeg} -y -loglevel 0 -i - -vframes 1 -vf "boxblur=10" "$TMP_FILE"
|
${lib.getExe pkgs.ffmpeg} -y -loglevel 0 -i - -vframes 1 -vf "boxblur=10" "$TMP_FILE"
|
||||||
LOCK_ARGS="$LOCK_ARGS --image $OUTPUT:$TMP_FILE"
|
LOCK_ARGS="$LOCK_ARGS --image $OUTPUT:$TMP_FILE"
|
||||||
ALL_IMGS="$ALL_IMGS $TMP_FILE"
|
ALL_IMGS="$ALL_IMGS $TMP_FILE"
|
||||||
done
|
done
|
||||||
${lib.getExe pkgs.swaylock} -f $LOCK_ARGS
|
${lib.getExe inputs.att_lock.packages.${system}.default} -i $ALL_IMGS
|
||||||
${pkgs.coreutils}/bin/shred $ALL_IMGS
|
${pkgs.coreutils}/bin/shred $ALL_IMGS
|
||||||
${pkgs.coreutils}/bin/rm $ALL_IMGS
|
${pkgs.coreutils}/bin/rm $ALL_IMGS
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
events = {
|
events = {
|
||||||
before-sleep = "${locker}/bin/swaylock_fancy";
|
before-sleep = "${att_lock}/bin/att_lock";
|
||||||
lock = "${locker}/bin/swaylock_fancy";
|
lock = "${att_lock}/bin/att_lock";
|
||||||
/*
|
|
||||||
after-resume = "${refresh_i3status}/bin/refresh_i3status";
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
timeouts = [
|
timeouts = [
|
||||||
{
|
{
|
||||||
timeout = 15 * 60;
|
timeout = 15 * 60;
|
||||||
command = "${locker}/bin/swaylock_fancy";
|
command = "${att_lock}/bin/att_lock";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user