i3lock-custom: Start Conky and slap my face on it

This commit is contained in:
Salt 2018-11-04 03:36:55 -06:00
parent 9b4c60069e
commit d973044ee8

View File

@ -11,6 +11,7 @@ tmpdir="$(mktemp -d "/tmp/i3lock-custom-$(whoami)-XXXXXXXX")"
cleanup() {
rm -rf "$tmpdir"
[ -z "$i3lockpid" ] || kill "$i3lockpid"
[ -z "$conkypid" ] || kill "$conkypid"
}
trap "cleanup" EXIT
# Papirus Dark's object-locked.svg, rendererd, gzipped and base64'd
@ -68,7 +69,8 @@ step_produce_image() {
-blur 10x5 \
-fill \#282828 \
-draw "$rectangle" \
lock.png -gravity center -compose Exclusion -composite \
lock.png -gravity center -compose src-over -composite \
"$HOME/.face" -gravity center -geometry 128x128+200+0 -compose src-over -composite \
end.png
)
return $?
@ -77,6 +79,20 @@ step_start_i3lock() {
i3lock -i "$tmpdir/end.png" &
i3lockpid="$!"
}
step_start_conky() {
i=0
while ! xprop -name "i3lock" > /dev/null 2>&1; do
i=$(( $i + 1 ))
if [ "$i" -eq "100" ]; then
return 1
fi
sleep 0.01
done
conkyconfig="$HOME/.config/conky/i3lock.conf"
[ -r "$conkyconfig" ] || return 2
conky -c "$conkyconfig" &
conkypid="$!"
}
step_wait() {
wait
exit 0
@ -85,6 +101,7 @@ step_wait() {
main() {
step_produce_image || exit 1
step_start_i3lock
step_start_conky
step_wait
}