feat: bash
This commit is contained in:
parent
937ab54f8c
commit
7ae0b331cf
30 changed files with 517 additions and 65 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
SINK='@DEFAULT_AUDIO_SINK@'
|
||||
NOTIFY=(notify-send -t 1000 -a "$(basename "$0")" -u low)
|
||||
NOTIFY=(notify-send -t 1000 -u low)
|
||||
|
||||
function update_vol() {
|
||||
if [[ "$1" =~ ^(-|\+)* ]]; then
|
||||
|
@ -22,14 +22,13 @@ if [ -z "$1" ]; then
|
|||
exit
|
||||
elif [ "$1" == 'm' ] && [ -z "$MUTE" ]; then
|
||||
wpctl set-mute "$SINK" 1
|
||||
"${NOTIFY[@]}" -i audio-volume-muted -h string:synchronous:vol "Mute"
|
||||
"${NOTIFY[@]}" -i audio-volume-muted-symbolic -h string:synchronous:vol "Mute"
|
||||
else
|
||||
if [[ "$1" =~ [0-9] ]]; then
|
||||
update_vol "$1"
|
||||
fi
|
||||
[ -n "$MUTE" ] && wpctl set-mute "$SINK" 0
|
||||
"${NOTIFY[@]}" -h string:synchronous:vol -h int:value:"$CUR" "$CUR%"
|
||||
"${NOTIFY[@]}" -i audio-volume-high-symbolic -h string:synchronous:vol -h int:value:"$CUR" "$CUR%"
|
||||
fi
|
||||
|
||||
# update sbar
|
||||
kill -34 "$(cat "$HOME/.cache/pidofbar")"
|
||||
kill -35 "$(cat "$HOME/.cache/pidofbar")"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue