os/arch/bin: volume => vol (volume conflicts with system binary on Arch)

This commit is contained in:
Henrik Lissner 2016-11-10 21:31:35 +01:00
parent b7ae7a2ab5
commit 65afe7a464

View file

@ -1,7 +1,6 @@
#!/usr/bin/env bash
if [[ $# = 0 ]]
then
if (($# == 0)); then
data=$(amixer get Master)
vol=$(echo "$data" | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)
state=$(echo "$data" | grep '\[on\]')
@ -9,16 +8,18 @@ then
exit
fi
COMMAND=$1
case "$COMMAND" in
[0-9]*) amixer set Master $COMMAND ;;
[+-]) amixer set Master 10%$COMMAND ;;
*mute) amixer set Master $COMMAND ;;
case $1 in
[0-9]*) amixer set Master $1 ;;
[+-]) amixer set Master 10%$1 ;;
*mute) amixer set Master $1 ;;
toggle) amixer set Master toggle ;;
*) >&2 echo "Invalid command"
exit 1
;;
esac
killall -9 -q osd_cat &>/dev/null
osd_cat --font="10x20" --delay=2 --color=white --align=center --pos=bottom --barmode=percentage --percentage $($0) &
# Report to lemonbar, if active
~/.config/panel/panel_update.sh volume
$HOME/.config/panel/panel-notify :volume