From: Siraaj Khandkar Date: Fri, 22 Nov 2019 00:14:24 +0000 (-0500) Subject: Script searching mpd lib and playing selection X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=f19243832b4a06cac88b1f7ec79486b627c0be2f;p=khome.git Script searching mpd lib and playing selection --- diff --git a/home/.xbindkeysrc b/home/.xbindkeysrc index b7bece5..5eca4dc 100644 --- a/home/.xbindkeysrc +++ b/home/.xbindkeysrc @@ -105,3 +105,7 @@ # Screenshot "screengrab -r" Print + +# Search mpd lib and play selection +"mpplay" + Mod4+p diff --git a/home/bin/mpplay b/home/bin/mpplay new file mode 100755 index 0000000..c8bb07b --- /dev/null +++ b/home/bin/mpplay @@ -0,0 +1,29 @@ +#! /bin/sh + +set -e + +# TODO: Get theme-appropriate font and colors from some central config file. + +FONT_NAME='terminus' +FONT_SIZE=32 +FONT="$FONT_NAME:pixelsize=$FONT_SIZE:antialias=false:autohint=true" +BG_NORM='#3a3a3a' +FG_NORM='#dcdccc' +BG_SELECTED="$BG_NORM" +FG_SELECTED='#72d5a3' +LINES=60 + +path=$( + mpc listall | dmenu \ + -i \ + -l "$LINES" \ + -fn "$FONT" \ + -nb "$BG_NORM" \ + -nf "$FG_NORM" \ + -sb "$BG_SELECTED" \ + -sf "$FG_SELECTED" +) + +mpc insert "$path" +mpc play +mpc next