blob: caddf1c3f998fe7da99b0e28ea9512c7b24b8e45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/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 "$@"
|