slock

[fork] screen locker
git clone https://hhvn.uk/slock
git clone git://hhvn.uk/slock
Log | Files | Refs | README | LICENSE

slock_mod (638B)


      1 #!/bin/bash
      2 socket1="$1"
      3 socket2="$2"
      4 
      5 echo "dmpv/rmpv: $(hmpv state $socket1)" > ~/.cache/socket; echo "dmpvurl: $(hmpv state $socket2)" >> ~/.cache/socket
      6 hmpv pause $socket1; sleep 0.1; hmpv pause $socket2; sleep 0.1; hmpv pause $socket2; sleep 0.1; hmpv pause $socket2
      7 slock -m "Locked at $(date) by $USER - what? You thought I would let you in...$(printf "\n")$(figlet L0ck3d)"
      8 
      9 state=$(cat ~/.cache/socket | awk '/:/')
     10 state1=$(echo "$state" | head -n -1 | awk '{print $2}')
     11 state2=$(echo "$state" | tail +2 | awk '{print $2}')
     12 [ "$state1" == "playing" ] && hmpv unpause $socket1
     13 [ "$state2" == "playing" ] && hmpv unpause $socket2