This commit is contained in:
Jesús
2022-06-27 00:41:41 +08:00
parent 6993d61090
commit 4070f6f227
5 changed files with 2 additions and 40 deletions

View File

@@ -1,34 +0,0 @@
#!/bin/bash
revert() {
rm /tmp/*screen*.png
xset dpms 0 0 0
}
trap revert HUP INT TERM
if [[ $(command -v xset) ]]; then
xset +dpms dpms 0 0 5
else
echo 'xset command not found' >> "$HOME/.config/i3/logs/xset-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug
fi
if [[ $(command -v scrot) ]]; then
scrot -d 1 /tmp/locking_screen.png
else
echo 'scrot is not installed' >> "$HOME/.config/i3/logs/scrot-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug
fi
if [[ $(command -v convert) ]]; then
convert -blur 0x8 /tmp/locking_screen.png /tmp/screen_blur.png
convert -composite /tmp/screen_blur.png "$HOME/.config/i3/images/imagelock.png" -gravity South -geometry -20x1200 /tmp/screen.png
else
echo 'convert command not found' >> "$HOME/.config/i3/logs/convert-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug
fi
if [[ $(command -v i3lock) ]]; then
i3lock -i /tmp/screen.png
else
echo 'i3lock is not installed' >> "$HOME/.config/i3/logs/i3lock-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug
fi
revert "$@"