You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
7 years ago
|
#!/bin/sh
|
||
7 years ago
|
|
||
5 years ago
|
LOCK="$XDG_CACHE_HOME/lock.png"
|
||
6 years ago
|
|
||
5 years ago
|
# Cache the lock image
|
||
|
if [ ! -f "$LOCK" ]; then
|
||
|
touch "$LOCK"
|
||
6 years ago
|
|
||
5 years ago
|
# Get the resolution of the primary monitor
|
||
|
RES="$(xrandr -q | grep ' connected primary' \
|
||
|
| grep -Eo '[0-9]{3,4}x[0-9]{3,4}' | head -c -1)"
|
||
6 years ago
|
|
||
5 years ago
|
# Generate lock image
|
||
|
convert "$(dirname "$0")/lock.png" -background none -gravity center -extent "$RES" "$LOCK"
|
||
6 years ago
|
fi
|
||
7 years ago
|
|
||
5 years ago
|
# Disable screensaver
|
||
7 years ago
|
revert() {
|
||
5 years ago
|
xset s off
|
||
|
xset -dpms
|
||
7 years ago
|
}
|
||
|
|
||
5 years ago
|
# Set screensaver to 30 seconds
|
||
7 years ago
|
trap revert HUP INT TERM
|
||
|
xset +dpms dpms 30 30 30
|
||
|
|
||
5 years ago
|
i3lock -n -i "$LOCK" -B 6 -S 1 -e \
|
||
6 years ago
|
--radius=47 \
|
||
|
--ring-width=5.0 \
|
||
7 years ago
|
--verifcolor=00000000 \
|
||
|
--wrongcolor=00000000 \
|
||
|
--timecolor=00000000 \
|
||
|
--datecolor=00000000 \
|
||
|
--layoutcolor=00000000 \
|
||
7 years ago
|
--insidecolor=00000000 \
|
||
|
--insidevercolor=00000000 --insidewrongcolor=00000000 \
|
||
|
--ringcolor=00000000 \
|
||
|
--ringvercolor=FFFFFFC0 --ringwrongcolor=DA2825C0 \
|
||
|
--keyhlcolor=FFFFFFC0 --bshlcolor=DA2825C0 \
|
||
|
--linecolor=00000000 --separatorcolor=00000000 \
|
||
|
-k \
|
||
|
--timesize=64 --datesize=24 \
|
||
|
--timestr="%I:%M %p" --datestr="%A, %B %e" \
|
||
7 years ago
|
--timepos="ix:iy-250" --datepos="ix:iy-200" \
|
||
6 years ago
|
--timecolor=FFFFFFC0 --datecolor=FFFFFFC0
|
||
7 years ago
|
|
||
|
revert
|