summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2025-03-19 01:47:45 +0000
committerdavidovski <david@davidovski.xyz>2025-03-19 01:47:45 +0000
commite0a89621bde0751d1b340580f886976a79bf4db3 (patch)
tree5c30b1e025b82198e8ab1427d852f687e828c9d6 /scripts
parentc64043053d4c032769211a04c51b43eeb102c771 (diff)
edit rofi setttingsHEADmaster
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/launcher8
-rwxr-xr-xscripts/mpc_picker35
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/&/&amp;/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