soundboard: use hierarchy for directories
This commit is contained in:
parent
e78cd1abd9
commit
a17b721bbb
@ -1,14 +1,31 @@
|
|||||||
# Soundboard setup
|
# Soundboard
|
||||||
# "Boxes" labelled 0-9 in $SB_DIR/
|
|
||||||
# Each one has files/symlinks 0-9
|
# Directory tree under $SB_DIR
|
||||||
|
# Play sounds in current dir using numpad 0-9 keys
|
||||||
|
# Navigate to a dir under current one with super + 0-9
|
||||||
|
# Navigate back to root with super + minus
|
||||||
|
|
||||||
|
|
||||||
# change dir
|
# change dir
|
||||||
super + {0-9}
|
super + {0-9}
|
||||||
|
if [ ! -h $SB_DIR/cur ]; then \
|
||||||
|
ln -sr $SB_DIR $SB_DIR/cur;\
|
||||||
|
fi;\
|
||||||
|
ln -sr $SB_DIR/$(readlink $SB_DIR/cur)/{0-9}* $SB_DIR/cur_n;\
|
||||||
unlink $SB_DIR/cur;\
|
unlink $SB_DIR/cur;\
|
||||||
ln -sr $SB_DIR/{0-9} $SB_DIR/cur
|
mv $SB_DIR/cur_n $SB_DIR/cur
|
||||||
|
|
||||||
|
# set current directory to $SB_DIR
|
||||||
|
super + minus
|
||||||
|
unlink $SB_DIR/cur;\
|
||||||
|
ln -sr $SB_DIR $SB_DIR/cur
|
||||||
|
|
||||||
# start sound
|
# start sound
|
||||||
KP_{Insert,End,Down,Next,Left,Begin,Right,Home,Up,Prior}
|
KP_{Insert,End,Down,Next,Left,Begin,Right,Home,Up,Prior}
|
||||||
|
if [ -z "$SB_DIR" ]; then \
|
||||||
|
notify-send -u critical -a "soundboard" '$SB_DIR is unset!';\
|
||||||
|
exit;\
|
||||||
|
fi;\
|
||||||
snd_id="{0-9}";\
|
snd_id="{0-9}";\
|
||||||
id=$(cat /dev/random | base32 | head -c 5);\
|
id=$(cat /dev/random | base32 | head -c 5);\
|
||||||
socket="$SB_DIR/cur/sb-socket$snd_id-$id";\
|
socket="$SB_DIR/cur/sb-socket$snd_id-$id";\
|
||||||
@ -20,10 +37,7 @@ 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"
|
||||||
|
|
||||||
# stop all sounds in current dir
|
|
||||||
KP_Delete
|
|
||||||
ls $SB_DIR/cur/sb-socket* | stop.sh
|
|
||||||
|
|
||||||
# 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";\
|
||||||
|
find $SB_DIR/ -name "sb-socket*" | xargs rm
|
||||||
|
@ -20,6 +20,7 @@ then
|
|||||||
--exclude=med/mus \
|
--exclude=med/mus \
|
||||||
--exclude=med/gv \
|
--exclude=med/gv \
|
||||||
--exclude=sb-socket \
|
--exclude=sb-socket \
|
||||||
|
--exclude=med/sb/cur \
|
||||||
--exclude=dox/dow \
|
--exclude=dox/dow \
|
||||||
--exclude=dox/rss \
|
--exclude=dox/rss \
|
||||||
--exclude=dox/rem \
|
--exclude=dox/rem \
|
||||||
|
Loading…
Reference in New Issue
Block a user