-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlock
31 lines (22 loc) · 965 Bytes
/
lock
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
#!/bin/bash
# Overlays neofetch stats on a blurred lock screen
# Turns composite off
killall compton
# makes the neofetch, and scrots it (delay there for proccesing, change it to your pc's speed)
urxvt +sb -name lock -e neofetch --song_shorthand on --source ~/Images/fetch/1197b22-1.jpg --scrot_cmd 'scrot -z -u -m -d 0 /tmp/lock.png' -s & sleep 1.7; kill $!
# turns compton back on, and waits a sec (again, just giving it a sec to load)
compton -b & sleep .3
# crops image, this is hardcoded since I didn't want to deal with %'s, so change based on your screen size
convert /tmp/lock.png -crop 490x245+0+0 /tmp/lock.png
# Define image locations
FOLDER=`dirname "$BASH_SOURCE"`
ICON=/tmp/lock.png
TMPBG=/tmp/screen.png
# takes a screenshot
scrot /tmp/screen.png
# blurs it and overlays
convert $TMPBG -blur 0x10 $TMPBG
convert $TMPBG $ICON -gravity center -composite -matte $TMPBG
# actually locks it
# i3lock -u -e -i $TMPBG
bash $FOLDER/lock2 -i $TMPBG