Make lock.sh image dynamic
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 7.6 KiB |
+14
-4
@@ -1,6 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ICON="$HOME/.scripts/wm/lock.png"
|
ICON="$XDG_CACHE_HOME/tmp.lock.png"
|
||||||
|
|
||||||
|
if [ ! -f "$ICON" ]; then
|
||||||
|
touch "$ICON"
|
||||||
|
|
||||||
|
# Get the resolution of the first active monitor
|
||||||
|
RES="$(i3-msg -t get_outputs | \
|
||||||
|
jq '.[] | select(.active==true) | .rect | .width, .height' | \
|
||||||
|
head -n 2 | head -c -1 | tr '\n' 'x')"
|
||||||
|
|
||||||
|
convert "$(dirname "$0")/lock.png" -background none -gravity center -extent "$RES" "$ICON"
|
||||||
|
fi
|
||||||
|
|
||||||
revert() {
|
revert() {
|
||||||
xset dpms 0 0 0
|
xset dpms 0 0 0
|
||||||
@@ -9,7 +20,7 @@ revert() {
|
|||||||
trap revert HUP INT TERM
|
trap revert HUP INT TERM
|
||||||
xset +dpms dpms 30 30 30
|
xset +dpms dpms 30 30 30
|
||||||
|
|
||||||
i3lock -n -i "$ICON" -B 10 -e \
|
i3lock -n -i "$ICON" -B 6 -S 1 -e \
|
||||||
--radius=47 \
|
--radius=47 \
|
||||||
--ring-width=5.0 \
|
--ring-width=5.0 \
|
||||||
--verifcolor=00000000 \
|
--verifcolor=00000000 \
|
||||||
@@ -27,7 +38,6 @@ i3lock -n -i "$ICON" -B 10 -e \
|
|||||||
--timesize=64 --datesize=24 \
|
--timesize=64 --datesize=24 \
|
||||||
--timestr="%I:%M %p" --datestr="%A, %B %e" \
|
--timestr="%I:%M %p" --datestr="%A, %B %e" \
|
||||||
--timepos="ix:iy-250" --datepos="ix:iy-200" \
|
--timepos="ix:iy-250" --datepos="ix:iy-200" \
|
||||||
--timecolor=FFFFFFC0 --datecolor=FFFFFFC0 \
|
--timecolor=FFFFFFC0 --datecolor=FFFFFFC0
|
||||||
--screen 1 \
|
|
||||||
|
|
||||||
revert
|
revert
|
||||||
|
|||||||
Reference in New Issue
Block a user