jgbrowser show hidden files by default

master
Daniel Napora 2020-10-09 13:04:56 +02:00
parent fca9b979f8
commit f0bdd9edc8
1 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Daniel Napora 2020 <napcok@gmail.com>
. $HOME/.config/mabox/mabox.conf
# Read a directory to an array and sort it directories first.
case $LANG in
pl*)
@ -30,6 +30,7 @@ esac
# If '$DIRECTORY' is '/', unset it to avoid '//'.
[[ $DIRECTORY == / ]] && DIRECTORY=
if [ $jgbrowser_show_hidden == false ];then
for item in "$DIRECTORY"/*; do
if [[ -d $item ]]; then
dirs+=("${item##*/},^pipe(jgbrowser \"$DIRECTORY/${item##*/}\")")
@ -39,7 +40,18 @@ esac
fi
fi
done
else
for item in "$DIRECTORY"/* "$DIRECTORY"/.[^.]*; do
if [[ -d $item ]]; then
dirs+=("${item##*/},^pipe(jgbrowser \"$DIRECTORY/${item##*/}\")")
else
if [[ -f $item ]]; then
files+=("${item##*/},xdg-open \"$DIRECTORY/${item##*/}\"")
fi
fi
done
fi
printf "%b\n" "^sep(<small><i>${DIRECTORY:-/}</i></small>)"
printf "%b\n" " $OPENDIR,${JGMENU_RESOURCE_OPENER} \"${DIRECTORY:-/}\""
printf "%b\n" " $OPENTERM,exo-open --launch TerminalEmulator --working-directory=\"${DIRECTORY:-/}\""