[scripts] fix: error codes

dmenuopen: don't return 0 in case of actual errors
switch-colors: no need to exit 0 if everything went well
This commit is contained in:
David JULIEN 2021-10-28 11:44:46 +02:00
parent 01cac0167f
commit ce6a7026d7
2 changed files with 3 additions and 8 deletions

View File

@ -13,15 +13,12 @@
filetypes="pdf png jpg txt mom tex mkv" # could be augmented
filetype=$(printf "$filetypes" | sed "s| |\n|g" | dmenu -i -p "type of the file?")
if [ -z "$filetype" ]; then
exit 0
fi
[ -z "$filetype" ] && exit 1
file=$(find $HOME/{documents,downloads} -type f -path "*.$filetype" | dmenu -i -l 20 -p "open")
if [ -z "$file" ]; then
exit 0
fi
[ -z "$file" ] && exit 2
case "$filetype" in
pdf) zathura "$file" ;;

View File

@ -46,5 +46,3 @@ else
switch_scheme
fi
fi
exit 0