commit 4c2b6c196fc6f4fe275e20247e64d4259bfc9a19 parent c88112fa5e22a7974a5968c4f1c7d8992ede938c Author: Jacob R. Edwards <jacob@jacobedwards.org> Date: Mon, 27 Feb 2023 10:29:51 -0800 Add notifyvol script As the name implies, it sends a notification of the current volume. Diffstat:
| A | local/bin/bin/notifyvol | | | 14 | ++++++++++++++ |
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/local/bin/bin/notifyvol b/local/bin/bin/notifyvol @@ -0,0 +1,14 @@ +#!/bin/sh +# Copyright 2023 Jacob R. Edwards <jacob@jacobedwards.org> +# Send a notification of the current volume level + +set -C + +# This is to prevent multiple instances from running at the same +# time, which can make the volume value jump all over the place. +# One caveat of this method is that it's likely that an incorrect +# value will be displayed at the end. +echo $$ > /tmp/notifyvolpid || + exit 0 +trap 'rm -f /tmp/notifyvolpid' 0 INT TERM +notify -u normal -v $(vol | awk '{ print $2 }') Volume