Update dmenu scripts

master
Hektor Misplon 2021-12-31 16:07:38 +01:00
parent 749fd7b3ac
commit 766c63824c
3 changed files with 26 additions and 0 deletions

13
.bin/dmenu-read Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Open pdf by title
# Note: does not handle incorrect metadata
dir=/home/h/doc/books
ag -g ".pdf$" $dir \
| xargs -n1 -d '\n' pdfinfo 2> /dev/null \
| grep "Title: " \
| awk '{for (i=2; i<NF; i++) printf $i " "; printf $NF; printf "\n"}' \
| grep -v "Title:"\
| dmenu -i -p "Read:"

12
.bin/dmenu-spot Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
options="Play\nPause\nNext\nPrevious"
selected=$(echo -e "$options" | dmenu -i)
case "$selected" in
"Play") playerctl --player=ncspot play;;
"Pause") playerctl --player=ncspot pause;;
"Next") playerctl --player=ncspot next;;
"Previous") playerctl --player=ncspot previous;;
esac

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl" options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl"
selected=$(echo -e "$options" | dmenu -p "s?:t?" -i -l 0) selected=$(echo -e "$options" | dmenu -p "s?:t?" -i -l 0)