#!/usr/bin/env bash dunst() { pkill -0 --exact dunst || return 0 case ${1:-} in stop) pkill -USR1 --euid "$(id -u)" --exact dunst ;; resume) pkill -USR2 --euid "$(id -u)" --exact dunst ;; *) echo "dunst argument required: stop or resume" return 1 ;; esac } dunst stop # lock colors c0='#00000000' # clear c1='#000000ff' # black c2='#FABD2F88' c3='#FB493488' c4='#EBDBB2FF' c5='#B8BB2688' c6='#28282888' c7='#282828FF' c8='#eeeeecff' c9='#12121200' cA='#c4a000ff' lock="$HOME/Pictures/trilock.png" image=$(mktemp --suffix=.png) trap 'rm -f "$image"' SIGINT SIGTERM EXIT maim -u \ | convert png:- -scale 10% -scale 1000% \ "$lock" -gravity center -composite -matte "$image" i3lock \ --image="$image" \ --insidevercolor=$c5 \ --insidewrongcolor=$c3 \ --insidecolor=$c0 \ --ringvercolor=$c2 \ --ringwrongcolor=$cA \ --ringcolor=$c7 \ --verifcolor=$c8 \ --wrongcolor=$c4 \ --linecolor=$c4 \ --separatorcolor=$c6 \ --keyhlcolor=$c4 \ --bshlcolor=$c3 \ --layoutcolor=$c9 \ --modsize=18 \ --refresh-rate=30 \ --radius=120 \ --ring-width=4 \ --veriftext='' \ --wrongtext='' \ --noinputtext='' \ --ignore-empty-password \ -B \ --nofork & pid="$!" while 2>/dev/null kill -0 "$pid"; do sleep 1 done dunst resume