diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/launcher | 8 | ||||
-rwxr-xr-x | scripts/mpc_picker | 35 |
2 files changed, 37 insertions, 6 deletions
diff --git a/scripts/launcher b/scripts/launcher new file mode 100755 index 0000000..85b679d --- /dev/null +++ b/scripts/launcher @@ -0,0 +1,8 @@ +#!/bin/sh + +rasi="$HOME/.config/rofi/launcher.rasi" + +## Run +rofi \ + -show drun \ + -theme $rasi diff --git a/scripts/mpc_picker b/scripts/mpc_picker index 3758b0a..0477d46 100755 --- a/scripts/mpc_picker +++ b/scripts/mpc_picker @@ -1,6 +1,29 @@ -#!/bin/sh -selected=$(mpc -f "%title%[\t\t%artist%][\t\t%album%]\t\t%file%" listall | dmenu -i -p mpd) -[ "$selected" == "" ] && exit -file=$(printf "%s\n" "$selected" | rev | cut -f1 -d' ' | rev) -echo "$file" -mpc insert "$file" +#!/usr/bin/dash +format="<b>%title%</b>\t%artist%\t%album%\t%file%" + +columns="$(mpc -f "$format" listall \ + | column -t -s' ' \ + -C title,width=10,trunc \ + -C artist,width=10,trunc \ + -C album,width=10,trunc \ + -C file \ + | sed 's/&/&/g' +)" + +np=$(printf "%s" "$columns" | grep "$(mpc -f '%title%' current)" | head -1) +echo "$np" +selected=$( + printf "%s" "$columns" | rofi -dmenu -i \ + -multi-select \ + -markup-rows \ + -p " " \ + -ballot-selected-str " " \ + -ballot-unselected-str " " \ + -select "$np" + ) +[ -z "$selected" ] && exit +echo "$selected" | while read -r option; do + file=$(printf "%s\n" "$option" | awk -F' ' '{print $NF}' | sed 's/^\s*//g') + echo ${file} + mpc insert "$file" +done |