aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/lock-color
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-01-17 19:14:34 +0300
committerYaroslav <contact@yaroslavps.com>2020-01-17 19:14:34 +0300
commit5eee5b44924bf9079a67d5bc7612bfad56ddeed3 (patch)
tree0408697aba64aa3f012f134bdc35316841a4b404 /dotfiles/.local/bin/lock-color
parent8f672e8a119e9efd23272f7cb0ff4550872f9d47 (diff)
downloadswayrice-5eee5b44924bf9079a67d5bc7612bfad56ddeed3.tar.gz
swayrice-5eee5b44924bf9079a67d5bc7612bfad56ddeed3.zip
config restructuring and cleanup
Diffstat (limited to 'dotfiles/.local/bin/lock-color')
-rwxr-xr-xdotfiles/.local/bin/lock-color86
1 files changed, 86 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/lock-color b/dotfiles/.local/bin/lock-color
new file mode 100755
index 0000000..445d779
--- /dev/null
+++ b/dotfiles/.local/bin/lock-color
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+#B='#00000000' # blank
+#C='#ffffff22' # clear ish
+#D='#b58900ff' # default
+#T='#fcbd00dd' # text
+#W='#880000bb' # wrong
+#V='#fcbd00dd' # verifying
+
+B='#00000000' # blank
+C='#ffffff22' # clear ish
+D='#ffffffff' # default
+T='#dac99dff' # text
+W='#880000bb' # wrong
+V='#023982dd' # verifying
+# Approximate timeout rate in milliseconds (checked every 5 seconds).
+timeout="30000"
+
+
+if [ "$(ps cax | grep sway)" ]; then
+ swaylock &
+
+ swayidle timeout 15 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
+
+ while [ "$(pgrep -x swaylock)" ]
+ do
+ sleep 1
+ done
+
+ pkill -n swayidle
+ exit
+fi
+# Take a screenshot:
+#scrot /tmp/screen.png
+
+#cp ~/.config/wall.png /tmp/screen.png
+# Create a blur on the shot:
+#convert /tmp/screen.png -paint 1 -swirl 360 /tmp/screen.png
+#convert /tmp/screen.png -brightness-contrast -20,-20 -paint 1 -noise 0x8 -blur 9,9 /tmp/screen.png
+
+i3lock \
+ --layoutcolor=$T \
+ --timecolor=$T \
+ --datecolor=$T \
+ --verifcolor=$T \
+ --wrongcolor=$W \
+ --keyhlcolor=$V \
+ --insidecolor=$B \
+ --ringcolor=$T \
+ --linecolor=$B \
+ --separatorcolor=$D \
+ --insidecolor=$B \
+ --insidewrongcolor=$B \
+ --insidevercolor=$B \
+ --color=#000000 \
+ --clock \
+ --radius=150 \
+ --ring-width=5 \
+ --timestr="%H:%M:%S" \
+ --datestr="%A %e, %b %Y" \
+ --veriftext="Verifying..." \
+ --wrongtext="Nope!" \
+ --noinputtext="BLANK" \
+ --time-font=furacodenerdfontmono \
+ --date-font=ibmplexsans \
+ --timesize=45 \
+ --datesize=24 \
+
+# If still locked after $timeout milliseconds, turn off screen.
+while [ "$(pgrep -x i3lock)" ]
+do
+ if [ $timeout -lt $(xssstate -i) ]
+ then
+ xset dpms force off
+ fi
+ sleep 1
+done
+
+# --blur 7 \
+# --keylayout 2 \
+# --textsize=20
+# --modsize=10
+# --timefont=comic-sans
+# --datefont=monofur
+# etc
+