Lots of stuff

This commit is contained in:
2021-06-13 11:43:14 +01:00
parent dad3e90dcf
commit 61b9707ae7
10 changed files with 90 additions and 19 deletions

View File

@@ -1,20 +1,16 @@
#!/bin/sh
#!/bin/sh
files="$(find -L "$HOME/Tower/Library")"
files="$(find -L "$HOME/Tower/Library" -name '*.pdf' -or -name '*.epub')"
options=$(echo $files | xargs --delimiter="\n" basename -a)
options=$(echo "$files" | xargs --delimiter="\n" basename -a)
# Get user selection via dmenu from emoji file.
chosen=$(cut -d ';' -f1 ~/.local/share/emojis | dmenu -i -l 30 | sed "s/ .*//")
chosen=$(echo "$options" | dmenu -i -ix -c -l 30)
# Exit if none chosen.
[ -z "$chosen" ] && exit
# If you run this command with an argument, it will automatically insert the
# character. Otherwise, show a message that the emoji has been copied.
if [ -n "$1" ]; then
xdotool type "$chosen"
else
printf "$chosen" | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard." &
fi
line="$(($chosen + 1))"
file="$(echo "$files" | sed "${line}q;d")"
zathura "$file"