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