From f0bdd9edc84b544f4529ee3728f04f40e42c2cd4 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Fri, 9 Oct 2020 13:04:56 +0200 Subject: [PATCH] jgbrowser show hidden files by default --- bin/jgbrowser | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/jgbrowser b/bin/jgbrowser index ac025e5..924349a 100755 --- a/bin/jgbrowser +++ b/bin/jgbrowser @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Daniel Napora 2020 - +. $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(${DIRECTORY:-/})" printf "%b\n" " $OPENDIR,${JGMENU_RESOURCE_OPENER} \"${DIRECTORY:-/}\"" printf "%b\n" " $OPENTERM,exo-open --launch TerminalEmulator --working-directory=\"${DIRECTORY:-/}\""