diff --git a/.local/scripts/actionmenu.fish b/.local/scripts/actionmenu.fish index 3b002b6..7de0065 100755 --- a/.local/scripts/actionmenu.fish +++ b/.local/scripts/actionmenu.fish @@ -2,13 +2,15 @@ # Select folders in current semester function open_semester - set options (ls $argv[1]) - set input (menu $options) + set options (ls -a $argv[1]) + set input (menu $options || exit) - if test -z "$input" + if test "$input" = "." alacritty msg create-window --working-directory $argv[1] else if test -d $argv[1]/$input open_semester $argv[1]/$input + else if test (xdg-mime query filetype $argv[1]/$input) = "application/pdf" && test (menu "PDF" "Ipe") = "Ipe" + ipe $argv[1]/$input else xdg-open $argv[1]/$input end