search field in mainmenu optional

master
Daniel Napora 2023-05-03 15:58:42 +02:00
parent ecaecf16ae
commit 4571a62895
1 changed files with 27 additions and 11 deletions

View File

@ -146,8 +146,7 @@ trap "rm -f ${CONFIG_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=$((jgtools_padding + 24))
panels_topmargin=0 panels_topmargin=0
case $LANG in case $LANG in
pl*) TYPE_TO_SEARCH="Pisz aby Wyszukać" pl*) TYPE_TO_SEARCH="Pisz aby Wyszukać"
@ -180,14 +179,27 @@ case $LANG in
SETTINGS="settings";; SETTINGS="settings";;
esac esac
# Search field
if [[ $search_field = "false" ]];then
MENU_PADDING_TOP=${jgtools_padding}
SEARCH_TEXT=""
SEARCH_FIELD=""
else
MENU_PADDING_TOP=$((jgtools_padding + 24))
SEARCH_TEXT="@text,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),150,20,0,left,top,auto,#000000,<span size='large'></span>"
SEARCH_FIELD="@search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i>"
fi
#apps_in_submenu=true #apps_in_submenu=true
rm -f ~/.config/jgmenu/append.csv rm -f ~/.config/jgmenu/append.csv
if [[ $apps_in_submenu == true ]] if [[ $apps_in_submenu == true ]]
then then
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> ${SEARCH_TEXT}
@search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i> ${SEARCH_FIELD}
#@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() ^sep()
. ~/.config/mabox/favorites.csv . ~/.config/mabox/favorites.csv
$APPS,^checkout(apps),applications-other $APPS,^checkout(apps),applications-other
@ -217,8 +229,10 @@ EOF
else else
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> ${SEARCH_TEXT}
@search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i> ${SEARCH_FIELD}
#@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() ^sep()
. ~/.config/mabox/favorites.csv . ~/.config/mabox/favorites.csv
EOF EOF
@ -303,6 +317,7 @@ case $LANG in
MIRROR_RANK="Ranking mirrorów" MIRROR_RANK="Ranking mirrorów"
SETTINGS="Ustawienia" SETTINGS="Ustawienia"
MCC="Centrum Sterowania Mabox" MCC="Centrum Sterowania Mabox"
SETTINGS_MENU="Konfiguracja Mabox"
SYS_AND_HARDWARE="System i sprzęt" SYS_AND_HARDWARE="System i sprzęt"
LOOK_AND_FEEL="Wygląd i zachowanie" LOOK_AND_FEEL="Wygląd i zachowanie"
HELP="Pomoc" HELP="Pomoc"
@ -351,6 +366,7 @@ case $LANG in
MIRROR_RANK="Actualizar repositorios" MIRROR_RANK="Actualizar repositorios"
SETTINGS="Ajustes" SETTINGS="Ajustes"
MCC="Centro de Control Mabox" MCC="Centro de Control Mabox"
SETTINGS_MENU="Mabox Config"
SYS_AND_HARDWARE="Sistema y Hardware" SYS_AND_HARDWARE="Sistema y Hardware"
LOOK_AND_FEEL="Apariencia" LOOK_AND_FEEL="Apariencia"
HELP="Ayuda" HELP="Ayuda"
@ -399,6 +415,7 @@ case $LANG in
MIRROR_RANK="Mirror ranking" MIRROR_RANK="Mirror ranking"
SETTINGS="Settings" SETTINGS="Settings"
MCC="Mabox Control Center" MCC="Mabox Control Center"
SETTINGS_MENU="Mabox Config"
SYS_AND_HARDWARE="System and Hardware" SYS_AND_HARDWARE="System and Hardware"
LOOK_AND_FEEL="Look and Feel" LOOK_AND_FEEL="Look and Feel"
HELP="Help" HELP="Help"
@ -487,10 +504,10 @@ cat <<EOF > ${MENU_ITEMS}
. $HOME/.config/mabox/right-prepend.csv . $HOME/.config/mabox/right-prepend.csv
^sep($SETTINGS) ^sep($SETTINGS)
$MCC,mcc,distributor-logo-mabox #$MCC,mcc,mcc,distributor-logo-mabox
^sep() #^sep()
$SETTINGS_MENU,^root(msettings),mbcc
$SYS_AND_HARDWARE,^root(system),audiocard $SYS_AND_HARDWARE,^root(system),audiocard
$LOOK_AND_FEEL,^root(wyglad),preferences-color
^sep($SOFT_MANAGEMENT) ^sep($SOFT_MANAGEMENT)
$PAMAC_UPDATE,pamac-manager --updates,system-upgrade $PAMAC_UPDATE,pamac-manager --updates,system-upgrade
@ -540,9 +557,8 @@ $GEOIP <small>pacman-mirrors -i --geoip</small>,^term(sudo pacman-mirrors -i --g
^sep() ^sep()
⮜ $BACK,^back() ⮜ $BACK,^back()
^tag(wyglad) ^tag(msettings)
. ~/.config/mabox/settings.csv . ~/.config/mabox/settings.csv
^sep() ^sep()
⮜ $BACK,^back() ⮜ $BACK,^back()
. ~/.config/mabox/settings_tags.csv . ~/.config/mabox/settings_tags.csv