FollieHiyuki-dotfiles/home/.local/bin/mangamenu

41 lines
728 B
Plaintext
Raw Normal View History

2021-02-13 11:28:59 -05:00
#!/bin/sh
case $1 in
--bemenu)
menu1="bemenu -i -p manga -l 10"
menu2="bemenu -i -p chapter -l 10"
;;
--dmenu)
menu1="dmenu -i -p manga -l 10"
menu2="dmenu -i -p chapter -l 10"
;;
--rofi)
menu1="rofi -dmenu -p Manga"
menu2="rofi -dmenu -p Chapter"
;;
--fzf)
menu1="fzf -e --no-multi"
menu2="${menu1}"
;;
--wofi)
menu1="wofi -d -p Manga"
menu2="wofi -d -p Chapter"
;;
*)
exit
;;
esac
manga=$(/usr/bin/ls ~/gallery-dl/Manga | ${menu1})
if [ -n "$manga" ]
then
chapter=$(/usr/bin/ls ~/gallery-dl/Manga/"${manga}" | ${menu2})
if [ -n "$chapter" ]
then
zathura ~/gallery-dl/Manga/"${manga}"/"${chapter}" &
else
mangamenu "$1"
fi
fi