blob: 556ab5a76a5840c982270bc9bc10486c90ec241c (
plain)
1 #!/usr/bin/env bash
2 #
3 # Performs a standard screen lock, with an extra bit of style. Before locking
4 # the screen, takes a screenshot of the current display and programatically
5 # blurs and desaturates the image, using that for the lock screen background. A
6 # mighty neat effect.
7 #
8 # Requirements: i3-lock imagemagick [scrot] [xbacklight]
9 #
10
11 base=/tmp/i3-lock-wrapper-$(date "+%s")
12 file1=base.jpg
13 file2=base2.png
14
15 if [[ $(which import) ]]; then
16 import -window root "$file1"
17 elif [[ $(which scrot) ]]; then
18 scrot -d0 "$file1"
19 else
20 echo "Screenshot command not found (scrot or import). Exiting."
21 fi
22
23 convert "$file1" -blur 0x4 -modulate 110,50 "$file2"
24
25
26 xbacklight -set 2% -time 3000 -steps 100&
27
28 i3lock -i "$file2" -n
29
30 xbacklight -set 10% -time 2000 -steps 100
31
32 rm "$file1" "$file2"
|