Remove audio hooks, use extra script
This commit is contained in:
9
i3/scripts/bar-update
Executable file
9
i3/scripts/bar-update
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ "$1" ]] ; then
|
||||||
|
modules="$1"
|
||||||
|
else
|
||||||
|
modules=all
|
||||||
|
fi
|
||||||
|
|
||||||
|
py3-cmd refresh "$modules"
|
||||||
@@ -77,6 +77,10 @@ usage() {
|
|||||||
echo "$0 set-vol VOL_PERC"
|
echo "$0 set-vol VOL_PERC"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_status_bar() {
|
||||||
|
~/.i3/scripts/bar-update volume_status
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"sink")
|
"sink")
|
||||||
echo $SINKNAME
|
echo $SINKNAME
|
||||||
@@ -91,19 +95,19 @@ case "$1" in
|
|||||||
else
|
else
|
||||||
setvol "$2"
|
setvol "$2"
|
||||||
fi
|
fi
|
||||||
hook="$3"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"mute")
|
"mute")
|
||||||
mute
|
mute
|
||||||
hook="$2"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"unmute")
|
"unmute")
|
||||||
unmute
|
unmute
|
||||||
hook="$2"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"mute-toggle")
|
"mute-toggle")
|
||||||
mute-toggle
|
mute-toggle
|
||||||
hook="$2"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"is-muted")
|
"is-muted")
|
||||||
echo $(ismuted)
|
echo $(ismuted)
|
||||||
@@ -113,10 +117,4 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ -n "$hook" ]] ; then
|
|
||||||
echo "volume changed, executing hook: $hook"
|
|
||||||
$hook
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user