mb-jgtools simplify

master
Daniel Napora 2021-09-12 18:36:25 +02:00
parent 2575a7eaaf
commit 84a9a29480
1 changed files with 82 additions and 16 deletions

View File

@ -139,45 +139,111 @@ main() {
mb-setvar jgtools_last="\"main ipc\"" mb-setvar jgtools_last="\"main ipc\""
CONFIG_FILE=$(mktemp) CONFIG_FILE=$(mktemp)
HEADER_FILE=$(mktemp) trap "rm -f ${CONFIG_FILE}" EXIT
trap "rm -f ${CONFIG_FILE} ${HEADER_FILE}" EXIT
POSITION_MODE=${1:-pointer} POSITION_MODE=${1:-pointer}
HIDE_BACK_ITEMS=1 HIDE_BACK_ITEMS=1
#MENU_PADDING_TOP=24 #MENU_PADDING_TOP=24
MENU_PADDING_TOP=$((jgtools_padding + 24)) MENU_PADDING_TOP=$((jgtools_padding + 24))
panels_topmargin=0 panels_topmargin=0
### write header file to prepend.csv
case $LANG in case $LANG in
pl*) TYPE_TO_SEARCH="Pisz aby Wyszukać" pl*) TYPE_TO_SEARCH="Pisz aby Wyszukać"
APPS="Programy";; APPS="Programy"
KEYS="Skroty klawiszowe"
SCREENSHOT="Zrzut ekranu"
LOCKSCR="Zablokuj ekran"
EXIT="Wyjscie..."
HELP="Pomoc"
UGUIDE="Przewodnik Mabox (online)"
SETTINGS="ustawienia"
;;
es*) TYPE_TO_SEARCH="Buscar" es*) TYPE_TO_SEARCH="Buscar"
APPS="Aplicationes";; APPS="Aplicationes"
KEYS="Atajos del teclado"
SCREENSHOT="Capturar Pantalla"
LOCKSCR="Bloquear pantalla"
EXIT="Salir..."
HELP="Ayuda"
UGUIDE="Mabox User Guide (online)"
SETTINGS="settings";;
*) TYPE_TO_SEARCH="Type to Search" *) TYPE_TO_SEARCH="Type to Search"
APPS="Applications";; APPS="Applications"
KEYS="Keybindings"
SCREENSHOT="Screenshot"
LOCKSCR="Lock screen"
EXIT="Exit..."
HELP="Help"
UGUIDE="Mabox Users Guide (online)"
SETTINGS="settings";;
esac esac
#apps_in_submenu=true #apps_in_submenu=true
rm -f ~/.config/jgmenu/append.csv
if [[ $apps_in_submenu == true ]] if [[ $apps_in_submenu == true ]]
then then
sub_lines="$APPS,^checkout(lx-apps),applications-other
. ~/.config/jgmenu/sub-append.csv
^tag(lx-apps)"
[ ! -f ~/.config/jgmenu/sub-append.csv ] && cp ~/.config/jgmenu/append.csv ~/.config/jgmenu/sub-append.csv
rm -f ~/.config/jgmenu/append.csv
else
sub_lines=""
cp ~/.config/jgmenu/sub-append.csv ~/.config/jgmenu/append.csv
fi
cat <<EOF > $HOME/.config/jgmenu/prepend.csv cat <<EOF > $HOME/.config/jgmenu/prepend.csv
@text,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),150,20,0,left,top,auto,#000000,<span size="large"></span> @text,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),150,20,0,left,top,auto,#000000,<span size="large"></span>
@search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i> @search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i>
^sep() ^sep()
. ~/.config/mabox/favorites.csv . ~/.config/mabox/favorites.csv
$sub_lines $APPS,^checkout(lx-apps),applications-other
. ~/.config/mabox/mainmenu_below_apps.csv
^sep()
$KEYS, mbhelper -s,key_bindings
^sep()
$SCREENSHOT,mb-jgtools screenshot,emblem-photos
^sep()
$LOCKSCR,mbscreenlocker,system-lock-screen
^sep()
$EXIT,mb-jgtools mblogout,system-shutdown
^tag($SETTINGS)
. ~/.config/mabox/settings.csv
^sep($HELP)
$UGUIDE,^checkout(userguide),distributor-logo-mabox
Mabox Forum,exo-open --launch WebBrowser https://forum.maboxlinux.org/,distributor-logo-mabox
^tag(userguide)
. /usr/share/mb-jgtools/userguide.csv
. ~/.config/mabox/settings_tags.csv
^tag(lx-apps)"
EOF
else
cat <<EOF > $HOME/.config/jgmenu/prepend.csv
@text,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),150,20,0,left,top,auto,#000000,<span size="large"></span>
@search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i>
^sep()
. ~/.config/mabox/favorites.csv
EOF EOF
cat <<EOF > $HOME/.config/jgmenu/append.csv
. ~/.config/mabox/mainmenu_below_apps.csv
^sep()
$KEYS, mbhelper -s,key_bindings
^sep()
$SCREENSHOT,mb-jgtools screenshot,emblem-photos
^sep()
$LOCKSCR,mbscreenlocker,system-lock-screen
^sep()
$EXIT,mb-jgtools mblogout,system-shutdown
^tag($SETTINGS)
. ~/.config/mabox/settings.csv
^sep($HELP)
$UGUIDE,^checkout(userguide),distributor-logo-mabox
MaboxForum,exo-open --launch WebBrowser https://forum.maboxlinux.org/,distributor-logo-mabox
^tag(userguide)
. /usr/share/mb-jgtools/userguide.csv
. ~/.config/mabox/settings_tags.csv
EOF
fi
[ $jgmenu_use_icons == false ] && jgmenu_icon_size=0 [ $jgmenu_use_icons == false ] && jgmenu_icon_size=0