[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 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?") filetype=$(printf "$filetypes" | sed "s| |\n|g" | dmenu -i -p "type of the file?")
if [ -z "$filetype" ]; then [ -z "$filetype" ] && exit 1
exit 0
fi
file=$(find $HOME/{documents,downloads} -type f -path "*.$filetype" | dmenu -i -l 20 -p "open") file=$(find $HOME/{documents,downloads} -type f -path "*.$filetype" | dmenu -i -l 20 -p "open")
if [ -z "$file" ]; then [ -z "$file" ] && exit 2
exit 0
fi
case "$filetype" in case "$filetype" in
pdf) zathura "$file" ;; pdf) zathura "$file" ;;

View File

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