diff --git a/src/.config/sxhkd/sxhkdrc b/src/.config/sxhkd/sxhkdrc index 6c99eed..2ea94c7 100644 --- a/src/.config/sxhkd/sxhkdrc +++ b/src/.config/sxhkd/sxhkdrc @@ -3,7 +3,7 @@ # 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 +# Navigate back to root with super + ` # change dir @@ -13,18 +13,27 @@ super + {0-9} fi;\ ln -sr $SB_DIR/$(readlink $SB_DIR/cur)/{0-9}* $SB_DIR/cur_n;\ unlink $SB_DIR/cur;\ - mv $SB_DIR/cur_n $SB_DIR/cur + mv $SB_DIR/cur_n $SB_DIR/cur;\ + sb-ls.sh # set current directory to $SB_DIR -super + minus +super + grave unlink $SB_DIR/cur;\ - ln -sr $SB_DIR $SB_DIR/cur + ln -sr $SB_DIR $SB_DIR/cur;\ + sb-ls.sh + +# list current directory contents +KP_Enter + sb-ls.sh +# super + shift + ` +super + asciitilde + sb-ls.sh # start sound 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;\ + exit 1;\ fi;\ snd_id="{0-9}";\ id=$(cat /dev/random | base32 | head -c 5);\ diff --git a/src/.local/bin/deskutils/notification-sound.sh b/src/.local/bin/deskutils/notification-sound.sh index adf2f39..051796d 100755 --- a/src/.local/bin/deskutils/notification-sound.sh +++ b/src/.local/bin/deskutils/notification-sound.sh @@ -2,7 +2,7 @@ # Dunst notification sound script. -if [ $DUNST_URGENCY = "LOW" ]; then +if [ "$DUNST_APP_NAME" = "soundboard" ]; then exit fi diff --git a/src/.local/bin/deskutils/soundboard/sb-ls.sh b/src/.local/bin/deskutils/soundboard/sb-ls.sh new file mode 100755 index 0000000..6f4b77b --- /dev/null +++ b/src/.local/bin/deskutils/soundboard/sb-ls.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# List current soundboard directory as a notification. + +if [ -z "$SB_DIR" ]; then + notify-send -u critical -a "soundboard" '$SB_DIR is unset!' + exit 1 +fi + +CUR_DIR="$SB_DIR"/"$(readlink $SB_DIR/cur)" + +list () { + find "$CUR_DIR" -mindepth 1 -maxdepth 1 \( -type l -o -type d -o -type f \) -print0 |\ + xargs -0 -i{} basename {} | sort +} + +notify-send \ + -a "soundboard" \ + -r 13371337 \ + "$(printf "$(basename "$CUR_DIR")\n$(list)")"