soundboard: add volume control
This commit is contained in:
parent
c34c81bde7
commit
a80882c27e
@ -46,6 +46,23 @@ shift + KP_{Insert,End,Down,Next,Left,Begin,Right,Home,Up,Prior}
|
|||||||
snd_id="{0-9}";\
|
snd_id="{0-9}";\
|
||||||
ls $SB_DIR/cur/sb-socket$snd_id-* | sb-msg "stop"
|
ls $SB_DIR/cur/sb-socket$snd_id-* | sb-msg "stop"
|
||||||
|
|
||||||
|
# loop specific sound
|
||||||
|
ctrl + shift + KP_{Insert,End,Down,Next,Left,Begin,Right,Home,Up,Prior}
|
||||||
|
snd_id="{0-9}";\
|
||||||
|
ls $SB_DIR/cur/sb-socket$snd_id-* | sb-msg "set loop inf"
|
||||||
|
|
||||||
|
# reduce volume of current dir
|
||||||
|
ctrl + KP_Subtract
|
||||||
|
snd_id="{0-9}";\
|
||||||
|
ls $SB_DIR/cur/sb-socket* | sb-msg "add volume -5";\
|
||||||
|
sb-vol
|
||||||
|
|
||||||
|
# increase volume of current dir
|
||||||
|
ctrl + KP_Add
|
||||||
|
snd_id="{0-9}";\
|
||||||
|
ls $SB_DIR/cur/sb-socket* | sb-msg "add volume +5";\
|
||||||
|
sb-vol
|
||||||
|
|
||||||
# stop all sounds
|
# stop all sounds
|
||||||
shift + KP_Delete
|
shift + KP_Delete
|
||||||
find $SB_DIR/ -name "sb-socket*" | sb-msg "stop";\
|
find $SB_DIR/ -name "sb-socket*" | sb-msg "stop";\
|
||||||
|
@ -3,5 +3,4 @@
|
|||||||
|
|
||||||
while read -r socket; do
|
while read -r socket; do
|
||||||
printf "$1\n" | socat - $socket
|
printf "$1\n" | socat - $socket
|
||||||
rm "$socket"
|
|
||||||
done
|
done
|
||||||
|
10
src/.local/bin/deskutils/soundboard/sb-vol
Executable file
10
src/.local/bin/deskutils/soundboard/sb-vol
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Get the highest volume in the current directory, and present it as a notification.
|
||||||
|
|
||||||
|
RES=$(ls $SB_DIR/cur/sb-socket* | \
|
||||||
|
sb-msg '{ "command": ["get_property", "volume"], "request_id": 100 }' |\
|
||||||
|
jq .data | sort | head -n 1 | awk '{ printf("%.0f\n", $0) }')
|
||||||
|
|
||||||
|
CUR_DIR="$(basename $(readlink $SB_DIR/cur))"
|
||||||
|
|
||||||
|
notify-send -a "soundboard" -r 13371337 "$(printf "%s\nVolume set to %s\n" "$CUR_DIR" "$RES")"
|
Loading…
Reference in New Issue
Block a user