slock_mod (789B)
1 #!/bin/sh 2 socket1="$1" 3 socket2="$2" 4 socket3="$3" 5 6 cmus-remote --pause-playback 7 xset dpms force off 8 echo "dmpv/rmpv: $(hmpv state $socket1)" > ~/.cache/socket 9 echo "dmpvurl: $(hmpv state $socket2)" >> ~/.cache/socket 10 ( 11 hmpv pause $socket1 12 sleep 0.2 13 hmpv pause $socket2 14 hvol toggle 15 ) & 16 export LC_ALL=c 17 18 # slock -m "$(figlet -f $(find /usr/share/figlet/ -name "*.flf" | sed 's/\.flf$//;s~.*/~~' | shuf | head -n 1) locked)" 19 20 slock -m "$(doas 2>&1)" 21 22 # slock -m "$(infowall | sed "s/$(printf "\033")[^m]*m//g;/^Colours/d")" 23 24 state=$(cat ~/.cache/socket | awk '/:/') 25 state1=$(echo "$state" | head -n -1 | awk '{print $2}') 26 state2=$(echo "$state" | tail +2 | awk '{print $2}') 27 [ "$state1" = "playing" ] && hmpv unpause $socket1 28 [ "$state2" = "playing" ] && hmpv unpause $socket2 29 hvol toggle