Last active
May 18, 2016 21:06
-
-
Save Nervengift/fe10896bef9b7a9884e857871f5d5ccd to your computer and use it in GitHub Desktop.
dmenu/rofi menu for Entropia's sound board
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# use sound effects at Entropia via a rofi menu | |
# run "snd update" to load and update the local cache of available sounds | |
# then simply use "snd" to open the menu | |
# | |
# by Nervengift | |
[[ "x$XDG_CACHE_HOME" == "x" ]] && CACHEDIR="$HOME/.cache" || CACHEDIR="$XDG_CACHE_HOME" | |
[[ "x$1" == "xupdate" ]] && ssh [email protected] bash -c \'find /home/entropia/clubautomation/snd -type f -printf \"%P\\n\" \' | tee $CACHEDIR/snd_dmenu | |
[[ -e "$CACHEDIR/snd_dmenu" ]] || (echo "No cache found, run $0 update first!" && exit 1) | |
selection=$(cat "$CACHEDIR/snd_dmenu" | while read foo; do echo ${foo%.*}; done | rofi -dmenu -p 'Sound effect: ' -location 6 -width 100) | |
echo $selection > /dev/udp/voellerei.club.entropia.de/23421 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
btw: rofi is the better dmenu :)