sway: prefix scripts with sway_
This commit is contained in:
parent
9a4b96932a
commit
f895cb3ee9
6 changed files with 16 additions and 9 deletions
40
bin/volume
40
bin/volume
|
@ -1,40 +0,0 @@
|
|||
#!/bin/bash
|
||||
source $HOME/.config/sway/bin/helpers
|
||||
SINK=$(pacmd list-sinks | grep "* index" | grep -oE '[0-9]*')
|
||||
APP="pavucontrol"
|
||||
|
||||
## helpers
|
||||
function _toggle() {
|
||||
a=$1
|
||||
if [ $(pgrep $a) ]; then
|
||||
killall $a
|
||||
else
|
||||
$a &> /dev/null &
|
||||
fi
|
||||
}
|
||||
|
||||
## main
|
||||
if [ -z "$SINK" ]; then
|
||||
_log VOLUME ERROR args: $*
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
d*)
|
||||
pactl set-sink-volume $SINK -5%
|
||||
;;
|
||||
i*)
|
||||
pactl set-sink-volume $SINK +5%
|
||||
;;
|
||||
m*)
|
||||
pactl set-sink-mute $SINK toggle
|
||||
;;
|
||||
gui)
|
||||
_check_app $APP
|
||||
_toggle $APP
|
||||
;;
|
||||
*)
|
||||
echo "invalid command: \"$1\""
|
||||
echo "arguments: [decrease|increase|mute|gui]"
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue