From c69d3f570602780aa4f0010b255eb916f509edf2 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Wed, 27 Jan 2021 12:53:11 +0100 Subject: [PATCH] apps in submenu option, ssh-pipe --- bin/mb-jgtools | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/bin/mb-jgtools b/bin/mb-jgtools index 12f9319..c9d7dba 100755 --- a/bin/mb-jgtools +++ b/bin/mb-jgtools @@ -73,7 +73,7 @@ esac while read -r line do uri=$(echo $line | cut -b 8- | cut -d' ' -f1 | sed 's/%20/ /g') - dirs+=("${line#* },^pipe(jgbrowser \"${uri}\")") + dirs+=(" ${line#* },^pipe(jgbrowser \"${uri}\")") done <"$BOOKMARKS" printf "%b\n" "^sep($GTK_BOOKMARKS)" printf '%s\n' "${dirs[@]}" @@ -164,19 +164,36 @@ POSITION_MODE=${1:-pointer} HIDE_BACK_ITEMS=1 #MENU_PADDING_TOP=24 MENU_PADDING_TOP=$(expr $jgtools_padding + 24) - +panels_topmargin=0 ### write header file to prepend.csv case $LANG in - pl*) TYPE_TO_SEARCH="Pisz aby wyszukać";; - es*) TYPE_TO_SEARCH="Buscar";; - *) TYPE_TO_SEARCH="type to search";; + pl*) TYPE_TO_SEARCH="Pisz aby Wyszukać" + APPS="Programy";; + es*) TYPE_TO_SEARCH="Buscar" + APPS="Aplicationes";; + *) TYPE_TO_SEARCH="Type to Search" + APPS="Applications";; esac +#apps_in_submenu=true +if [[ $apps_in_submenu == true ]] +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 < $HOME/.config/jgmenu/prepend.csv @text,,$(expr $jgtools_padding + 24),$(expr $jgtools_padding + 4),150,20,0,left,top,auto,#000000, @search,,$(expr $jgtools_padding + 38),$(expr $jgtools_padding + 4),150,20,2,left,top,auto,#000000 0,$TYPE_TO_SEARCH ^sep() . ~/.config/mabox/favorites.csv +$sub_lines EOF @@ -196,7 +213,7 @@ CONFIG_FILE=$(mktemp) MENU_ITEMS=$(mktemp) trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT [ $jgmenu_use_icons == false ] && jgmenu_icon_size=0 -BOTTOM_IMG=${right_bottom_img:-/usr/share/mb-jgtools/mabox_3D_gold.png} +#BOTTOM_IMG=${right_bottom_img:-/usr/share/mb-jgtools/mabox_3D_gold.png} MENU_HALIGN="right" ITEM_HALIGN="left" ARROW_STRING=" ⮜ " @@ -488,6 +505,7 @@ case $LANG in SYSINFO="Informacje o systemie" SHORTCUTS="Skróty klawiszowe" MENUPANELS="Ustawienia Menu/Paneli" + SSH_CONN="Połącz po SSH" ;; es*) QUICK_NAV="Navegación rápida" @@ -498,6 +516,7 @@ case $LANG in SYSINFO="System information" SHORTCUTS="Atajos del teclado" MENUPANELS="Menu/Paneles laterales" + SSH_CONN="SSH" ;; *) QUICK_NAV="Quick Navigation" @@ -508,6 +527,7 @@ case $LANG in SYSINFO="System information" SHORTCUTS="Keyboard shortcuts" MENUPANELS="Menu/Sidepanels settings" + SSH_CONN="SSH hosts" ;; esac @@ -517,6 +537,7 @@ esac panels_topmargin=${panels_topmargin:-0} menu_margin_x=${submenu_spacing:-0} +[ $panels_topmargin == 0 ] && menu_margin_x=0 eval $(xdotool getdisplaygeometry --shell) MENU_HEIGHT_MIN=$(expr $HEIGHT - $panels_topmargin - $panels_topmargin) MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN @@ -530,6 +551,7 @@ BOTTOM_IMG=${places_bottom_img:-/usr/share/mb-jgtools/mabox_3D_silver.png} [ $places_sysinfopipe == true ] && sysinfopipe=" $SYSINFO,^pipe(jgsysinfo-pipe -r)" && pipesep="^sep($PIPEMENUS)" [ $places_keyspipe == true ] && keyspipe=" $SHORTCUTS,^pipe(jgkeys-pipe -r)" && pipesep="^sep($PIPEMENUS)" [ $places_menusettingspipe == true ] && menusettingspipe=" $MENUPANELS,^pipe(jgmenusettings-pipe -r)" && pipesep="^sep($PIPEMENUS)" +[ $places_sshpipe == true ] && sshpipe=" $SSH_CONN,^pipe(jgssh -r)" && pipesep="^sep($PIPEMENUS)" mkconfigfile @@ -556,6 +578,7 @@ $pipesep $menusettingspipe $sysinfopipe $keyspipe +$sshpipe $softwarepipe . $HOME/.config/mabox/vboxes.csv