[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
dev
David JULIEN 11 months ago
parent 01cac0167f
commit ce6a7026d7
  1. 9
      .local/bin/dmenuopen
  2. 2
      .local/bin/switch-colors

@ -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" ;;

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

Loading…
Cancel
Save