Fancy notification when volume changes
This commit is contained in:
parent
0ecb2dc78d
commit
846ca7311b
|
@ -0,0 +1 @@
|
|||
#!/usr/bin/env sh
|
|
@ -8,10 +8,10 @@ alt + ctrl + r
|
|||
dash $SCRIPTS/reboot.sh
|
||||
|
||||
XF86AudioLowerVolume
|
||||
amixer -q sset Master 5%- && dash $SCRIPTS/reset-dwmbar.sh
|
||||
amixer -q sset Master 5%- && dash $SCRIPTS/reset-dwmbar.sh && dash $SCRIPTS/volume-notification.sh
|
||||
|
||||
XF86AudioRaiseVolume
|
||||
amixer -q sset Master 5%+ && dash $SCRIPTS/reset-dwmbar.sh
|
||||
amixer -q sset Master 5%+ && dash $SCRIPTS/reset-dwmbar.sh && dash $SCRIPTS/volume-notification.sh
|
||||
|
||||
XF86AudioStop
|
||||
player-command stop
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
mod=$(echo "$1 % 8" | bc)
|
||||
blocks=$(echo "$1 / 8" | bc)
|
||||
|
||||
for _ in $(seq 1 "$blocks"); do
|
||||
printf "█"
|
||||
done
|
||||
|
||||
case "$mod" in
|
||||
1)
|
||||
printf "▏"
|
||||
;;
|
||||
2)
|
||||
printf "▎"
|
||||
;;
|
||||
3)
|
||||
printf "▍"
|
||||
;;
|
||||
4)
|
||||
printf "▌"
|
||||
;;
|
||||
5)
|
||||
[ "$1" -lt 96 ] && printf "▋"
|
||||
;;
|
||||
6)
|
||||
[ "$1" -lt 96 ] && printf "▊"
|
||||
;;
|
||||
7)
|
||||
[ "$1" -lt 96 ] && printf "▉"
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
|
||||
level=$(amixer get Master | grep -o "[0-9]*%\|\[on\]\|\[off\]" |
|
||||
sed "s/\[on\]//;s/\[off\]//" | head -n 2)
|
||||
|
||||
bar=$(echo "$level" | head -n 1 | tr '%' ' ' |
|
||||
xargs dash "$SCRIPTS/progress-bar.sh")
|
||||
|
||||
echo "$level" | xargs echo |
|
||||
xargs -I{} notify-send -u low -t 3000 "Volume: {}" "$bar"
|
Loading…
Reference in New Issue