notifyvol (507B)
1 #!/bin/sh 2 # Copyright 2023 Jacob R. Edwards <jacob@jacobedwards.org> 3 # Send a notification of the current volume level 4 5 set -C 6 7 # This is to prevent multiple instances from running at the same 8 # time, which can make the volume value jump all over the place. 9 # One caveat of this method is that it's likely that an incorrect 10 # value will be displayed at the end. 11 echo $$ > /tmp/notifyvolpid || 12 exit 0 13 trap 'rm -f /tmp/notifyvolpid' 0 INT TERM 14 notify -u low -v $(vol | awk '{ print $2 }') Volume & 15 sleep 0.1