dotfiles/.local/bin/lockscreen

34 lines
949 B
Plaintext
Raw Permalink Normal View History

2020-05-25 11:29:57 +02:00
#!/bin/sh
##:clean temp dir
#rm -Rf $HOME/.tmp/lscreen
##:make temp dir
#mkdir -p $HOME/.tmp/lscreen
2020-05-25 11:29:57 +02:00
##:define paths as variables
#screen=$HOME/.tmp/lscreen/screen.png
#lbg=$HOME/.tmp/lscreen/lbg.png
2020-05-25 11:29:57 +02:00
##:take screenshot
#grim $screen
2020-05-25 11:29:57 +02:00
##:stretch the screenshot to pixelate - fast
#convert $screen -scale 10% -scale 1000% $lbg
##:simple bidirectional blur - slow
##convert $screen -blur 0x8 $lbg
##:remove original screenshot
#rm $screen
2020-05-25 11:29:57 +02:00
##:execute lock with created background
#swaylock -f -e -i "$lbg"
2020-05-25 11:29:57 +02:00
revert() {
killall swayidle
}
trap revert HUP INT TERM
swayidle -w \
timeout 5 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' &
swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 10 --effect-blur 7x5 --effect-vignette 0.4:0.4 --ring-color bb00cc --key-hl-color 880033 --line-color 00000000 --inside-color 00000088 --separator-color 00000000 --grace 2 --fade-in 0.2
revert