dotfiles-old/.local/scripts/volchange.sh

45 lines
826 B
Bash
Executable File

#!/bin/sh
PERC="5"
refbar() {
pkill sleep -P "$(cat ~/.cache/statusbar_pid )"
}
inc() {
[ "$1" ] && PERC="$1"
#pulsemixer --change-volume +"$1" && refbar
#amixer sset Master 1%+ && refbar
pamixer -i "$PERC" && refbar
}
dec() {
[ "$1" ] && PERC="$1"
#pulsemixer --change-volume -"$1" && refbar
#amixer sset Master 1%- && refbar
pamixer -d "$PERC" && refbar
}
mute() {
#pulsemixer --toggle-mute && refbar
#amixer sset Master toggle && refbar
pamixer -t && refbar
}
help() {
echo "-i N -> increment volume by N amount"
echo "-d N -> decrement volume by N amount"
echo "--toggle-mute -> toggle mute sound"
}
if [ "$1" = "-i" ]; then
inc "$2"
elif [ "$1" = "-d" ]; then
dec "$2"
elif [ "$1" = "--toggle-mute" ]; then
mute
else
help
fi