add missing mbxfiles
parent
06497a5c71
commit
206effb078
1
bin/mbx
1
bin/mbx
|
@ -145,7 +145,6 @@ mmenu() {
|
|||
CONFIG_FILE=$(mktemp)
|
||||
trap "rm -f ${CONFIG_FILE}" EXIT
|
||||
font_size=${font_size:-12}
|
||||
echo "${font} ${font_size}px"
|
||||
position_mode=${1:-pointer}
|
||||
hide_back_items=1
|
||||
## poniższe defaultowo do configu
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
#!/usr/bin/env bash
|
||||
# Daniel Napora 2021 <napcok@gmail.com>
|
||||
. "$HOME"/.config/mbxutils/mbx.conf
|
||||
ME=$(basename "$0")
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
DIRECTORIES="Katalogi"
|
||||
FILES="Pliki"
|
||||
OPENDIR="Otwórz w menadżerze plików"
|
||||
OPENTERM="Otwórz w terminalu"
|
||||
;;
|
||||
es*)
|
||||
DIRECTORIES="Directorios"
|
||||
FILES="Archivos"
|
||||
OPENDIR="Abrir Gestor de archivos aquí"
|
||||
OPENTERM="Abrir terminal aquí"
|
||||
;;
|
||||
*)
|
||||
DIRECTORIES="Directories"
|
||||
FILES="Files"
|
||||
OPENDIR="Open filemanager here"
|
||||
OPENTERM="Open terminal here"
|
||||
;;
|
||||
esac
|
||||
case "$terminal" in
|
||||
lxterminal|gnome-terminal)
|
||||
wdir="--working-directory=";;
|
||||
qterminal|konsole)
|
||||
wdir="--workdir ";;
|
||||
*)
|
||||
wdir="--working-directory ";;
|
||||
esac
|
||||
|
||||
DIRECTORY=${1:-$HOME}
|
||||
|
||||
# If '$DIRECTORY' is '/', unset it to avoid '//'.
|
||||
[[ $DIRECTORY == / ]] && DIRECTORY=
|
||||
|
||||
if [ "$show_hidden" == false ];then
|
||||
for item in "$DIRECTORY"/*; do
|
||||
if [[ -d $item ]]; then
|
||||
dirs+=("${item##*/},^pipe($ME \"$DIRECTORY/${item##*/}\")")
|
||||
else
|
||||
if [[ -f $item ]]; then
|
||||
files+=("${item##*/},xdg-open \"$DIRECTORY/${item##*/}\"")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
for item in "$DIRECTORY"/* "$DIRECTORY"/.[^.]*; do
|
||||
if [[ -d $item ]]; then
|
||||
dirs+=("${item##*/},^pipe($ME \"$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,xdg-open \"${DIRECTORY:-/}\""
|
||||
printf "%b\n" "<big></big> $OPENTERM,${terminal} ${wdir}\"${DIRECTORY:-/}\""
|
||||
|
||||
if [ ${#dirs[@]} -ne 0 ]; then
|
||||
printf "%b\n" "^sep($DIRECTORIES <small>(${#dirs[@]})</small>)"
|
||||
printf "%s\n" "${dirs[@]/&/&}"
|
||||
fi
|
||||
if [ ${#files[@]} -ne 0 ]; then
|
||||
printf "%b\n" "^sep($FILES <small>(${#files[@]})</small>)"
|
||||
#printf "%s\n" "${files[@]}"
|
||||
#okfiles=("${files[@]/</ <}")
|
||||
printf "%s\n" "${files[@]/&/&}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue