mirror of
https://github.com/eliasrenman/dotfiles.git
synced 2026-03-16 20:46:08 +01:00
feat: polybar and rofi
This commit is contained in:
23
polybar/sound.sh
Normal file
23
polybar/sound.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
function main() {
|
||||
# Pipewire
|
||||
active_device=$(pamixer --get-default-sink | awk -F'"' '/Default sink/{next} {print $(NF-1)}')
|
||||
|
||||
VOLUME=$(pamixer --get-volume-human)
|
||||
|
||||
action=$1
|
||||
if [ "${action}" == "up" ]; then
|
||||
pamixer -i 5
|
||||
elif [ "${action}" == "down" ]; then
|
||||
pamixer -d 5
|
||||
elif [ "${action}" == "mute" ]; then
|
||||
pamixer -t
|
||||
else
|
||||
if [ "$VOLUME" == "muted" ]; then
|
||||
echo "$active_device "
|
||||
else
|
||||
echo "$active_device $VOLUME"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
||||
Reference in New Issue
Block a user