]> git.armaanb.net Git - bin.git/commitdiff
*-set: Switch to using dunstify and progress bars
authorArmaan Bhojwani <me@armaanb.net>
Mon, 8 Feb 2021 15:31:13 +0000 (10:31 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Mon, 8 Feb 2021 15:31:13 +0000 (10:31 -0500)
audio-set
brightness-set

index e916889f07a2b3401a545826e87be82568415a0c..ba02f980a00a8142f42940227a7f03d0912b853a 100755 (executable)
--- a/audio-set
+++ b/audio-set
@@ -5,8 +5,14 @@ if [[ ${1} ]]; then
   [[ $(amixer sget Master | tail -n 1 | grep "off") ]] &&
     pactl set-sink-mute 0 toggle
   pactl set-sink-volume 0 ${1}%
+  mutes="Unmuted"
 else
   pactl set-sink-mute 0 toggle
+  mutes="Muted"
 fi
 
-notify-send "Volume" "$(amixer sget Master | tail -n 1 | cut -d ' ' -f 7-)" -t 1000
+dunstify -h string:x-canonical-private-synchronous:audio \
+  "Volume" "${mutes}" \
+  -h int:value:"$(amixer sget Master | tail -n 1 | cut -d '[' -f 2 | \
+  head -c +2)" \
+  -t 1000
index da07a7a2d1ad6bce14328d195226182d016b7287..61244e95e4c2c2c9680731c5df3f7651610d5c5e 100755 (executable)
@@ -2,4 +2,7 @@
 # Show a notification and change screen brightness
 
 brightnessctl set ${1}
-notify-send "Brightness" "$(brightnessctl | grep % | tail -c +22)" -t 1000
+dunstify -h string:x-canonical-private-synchronous:brightness \
+  "Brightness" "$(brightnessctl | grep % | tail -c +22)" \
+  -h int:value:"$(brightnessctl | grep % | cut -d '(' -f 2 | head -c +3)" \
+  -t 1000