mirror of
https://github.com/theKapcioszek/dotfiles-i3.git
synced 2025-04-09 15:54:07 +02:00
22 lines
758 B
Bash
22 lines
758 B
Bash
#!/usr/bin/env bash
|
|
|
|
function main() {
|
|
DEFAULT_SOURCE=$(pw-record --list-targets | sed -n 's/^*[[:space:]]*[[:digit:]]\+: description="\(.*\)" prio=[[:digit:]]\+$/\1/p')
|
|
DEFAULT_SINK_ID=$(pw-play --list-targets | sed -n 's/^*[[:space:]]*\([[:digit:]]\+\):.*$/\1/p')
|
|
DEFAULT_SINK=$(pw-play --list-targets | sed -n 's/^*[[:space:]]*[[:digit:]]\+: description="\(.*\)" prio=[[:digit:]]\+$/\1/p')
|
|
VOLUME=$(pamixer --get-volume-human)
|
|
|
|
action=$1
|
|
if [ "${action}" == "up" ]; then
|
|
pamixer --increase 10
|
|
elif [ "${action}" == "down" ]; then
|
|
pamixer --decrease 10
|
|
elif [ "${action}" == "mute" ]; then
|
|
pamixer --toggle-mute
|
|
else
|
|
echo "${DEFAULT_SOURCE} ${VOLUME} ${DEFAULT_SINK}"
|
|
fi
|
|
}
|
|
|
|
main "$@"
|