From 7a49d278b18ecc0c60d7dc69682d000ea81f36e8 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sat, 29 Aug 2020 15:40:13 +0200 Subject: [PATCH] settings menu --- bin/mb-jgtools | 140 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 93 insertions(+), 47 deletions(-) diff --git a/bin/mb-jgtools b/bin/mb-jgtools index 962cf80..686cea0 100755 --- a/bin/mb-jgtools +++ b/bin/mb-jgtools @@ -1,5 +1,25 @@ #!/bin/bash +# +# mb-jgtools: Menu, Sidepanels, Screenshot Tool and Exit Dialog for Mabox +# Copyright (C) 2019-2020 Daniel Napora + +## TEMPORARY SETTINGS MENU FIX +FILE="$HOME/.config/mabox/settings.csv" +if [ ! -f "$FILE" ]; then + case $LANG in + pl*) + rsync -a /usr/share/mabox/lang/pl/.config/mabox/settings* $HOME/.config/mabox/ + ;; + es*) + rsync -a /usr/share/mabox/lang/es/.config/mabox/settings* $HOME/.config/mabox/ + ;; + *) + rsync -a /usr/share/mabox/lang/en/.config/mabox/settings* $HOME/.config/mabox/ + ;; + esac +fi +## END TEMPORARY SETTINGS MENU FIX . $HOME/.config/mabox/mabox.conf jgmenu_theme=${jgmenu_theme:-obtheme} @@ -116,6 +136,7 @@ unset font #MENU GŁÓWNE main() { + CONFIG_FILE=$(mktemp) MENU_ITEMS=$(mktemp) trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT @@ -193,6 +214,7 @@ case $LANG in NORMAL="normalny" BIG="duży" HUGE="wielki" + UGUIDE_TITLE="Przewodnik Użytkownika Mabox" UGUIDE=". /usr/share/mb-jgtools/userguide_PL.csv" ;; es*) @@ -241,6 +263,7 @@ case $LANG in NORMAL="Normal" BIG="Grande" HUGE="Muy Grande" + UGUIDE_TITLE="Mabox User Guide" UGUIDE=". /usr/share/mb-jgtools/userguide.csv" ;; *) @@ -289,6 +312,7 @@ case $LANG in NORMAL="normal" BIG="big" HUGE="huge" + UGUIDE_TITLE="Mabox User Guide" UGUIDE=". /usr/share/mb-jgtools/userguide.csv" ;; esac @@ -307,6 +331,13 @@ cat < ${MENU_ITEMS} . $HOME/.config/mabox/right-prepend.csv +^sep($SETTINGS) +$MCC,mcc,distributor-logo-mabox +^sep() +$SYS_AND_HARDWARE,^root(system),audiocard +$LOOK_AND_FEEL,^root(wyglad),preferences-color +$SIZE,^checkout(menusize),applications-development + ^sep($SOFT_MANAGEMENT) $PAMAC_UPDATE,pamac-manager --updates,system-upgrade $CLI_UPDATE,^term(sudo pacman -Syyu),openterm @@ -314,12 +345,10 @@ $PAMAC,pamac-manager,pamac $RENEW_KEYS,^term(sudo pacman -Sy archlinux-keyring manjaro-keyring mabox-keyring),keysync $MIRROR_RANK,^root(mirrory),download -^sep($SETTINGS) -$MCC,mcc,distributor-logo-mabox -$SYS_AND_HARDWARE,^root(system),audiocard -$LOOK_AND_FEEL,^root(wyglad),preferences-color -$SIZE,^checkout(menusize),applications-development ^sep($HELP) + +$UGUIDE_TITLE,^root(userguide),distributor-logo-mabox +Mabox Forum,exo-open --launch WebBrowser https://forum.maboxlinux.org,distributor-logo-mabox $SHORTCUTS,mb-kb --gui &>/dev/null,key_bindings $ONLINE_RES,^root(weblinks),web-browser @@ -337,7 +366,11 @@ $NORMAL,cat /usr/share/mb-jgtools/normal > ~/.config/mabox/jgmenusize.conf && mb $HUGE,cat /usr/share/mb-jgtools/huge > ~/.config/mabox/jgmenusize.conf && mb-jgtools right ^tag(system) +^sep($SETTINGS) +$MCC,mcc,distributor-logo-mabox ^sep($SYS_AND_HARDWARE) +Manjaro Settings Manager,manjaro-settings-manager,distributor-logo-manjaro +^sep() $LOCALE_SETTINGS,manjaro-settings-manager -m msm_locale,chronometer $LANGUAGE_PACKAGES,manjaro-settings-manager -m msm_language_packages,globe $KERNEL,manjaro-settings-manager -m msm_kernel,distributor-logo-linux @@ -345,7 +378,8 @@ $USER_ACCOUNTS,manjaro-settings-manager -m msm_users,system-config-users $TIME_DATE,manjaro-settings-manager -m msm_timedate,system-config-date $KEYBOARD,manjaro-settings-manager -m msm_keyboard,preferences-desktop-keyboard $HARDWARE,manjaro-settings-manager -m msm_mhwd,preferences-desktop-peripherals-directory -^sep() +^sep(System Info) +CPU-X,cpu-x,cpu-x ⮜ $BACK,^back() ^tag(mirrory) @@ -356,26 +390,33 @@ $GEOIP pacman-mirrors -i --geoip,^term(sudo pacman-mirrors -i --g ⮜ $BACK,^back() ^tag(wyglad) -^sep($LOOK_AND_FEEL) -$LXAPPEARANCE,lxappearance,preferences-desktop-theme -$NITROGEN,nitrogen,nitrogen -$OBCONF,obconf,obconf -$NOTIFYD,xfce4-notifyd-config,xfce4-notifyd -$PREFERRED_APPS,exo-preferred-applications,preferences-desktop-default-applications -$LIGHTDM,lightdm-gtk-greeter-settings-pkexec,lightdm-gtk-greeter-settings -$POWER_MNGR,xfce4-power-manager-settings,xfce4-power-manager-settings -^sep($MABOX_DESK_ELEM) -Conky,^pipe(jgmenu_run ob --cmd=mabox-conky-pipemenu),desktop-effects -$TINT2,^pipe(jgmenu_run ob --cmd=mabox-tint2-pipemenu),tint2conf -$COMPOSER,^pipe(jgmenu_run ob --cmd='mabox-compositor' --tag='Kompo'),compton -^sep($MABOX_THEMES) -$THEME_MNGR,mb-obthemes,preferences-desktop-theme +. ~/.config/mabox/settings.csv + +#^sep($LOOK_AND_FEEL) +#$LXAPPEARANCE,lxappearance,preferences-desktop-theme +#$NITROGEN,nitrogen,nitrogen +#$OBCONF,obconf,obconf +#$NOTIFYD,xfce4-notifyd-config,xfce4-notifyd +#$PREFERRED_APPS,exo-preferred-applications,preferences-desktop-default-applications +#$LIGHTDM,lightdm-gtk-greeter-settings-pkexec,lightdm-gtk-greeter-settings +#$POWER_MNGR,xfce4-power-manager-settings,xfce4-power-manager-settings +#^sep($MABOX_DESK_ELEM) +#Conky,^pipe(jgmenu_run ob --cmd=mabox-conky-pipemenu),desktop-effects +#$TINT2,^pipe(jgmenu_run ob --cmd=mabox-tint2-pipemenu),tint2conf +#$COMPOSER,^pipe(jgmenu_run ob --cmd='mabox-compositor' --tag='Kompo'),compton +#^sep($MABOX_THEMES) +#$THEME_MNGR,mb-obthemes,preferences-desktop-theme ^sep() ⮜ $BACK,^back() +. ~/.config/mabox/settings_tags.csv +^tag(userguide) +$UGUIDE +^sep() +⮜ $BACK,^back() ^tag(weblinks) ^sep($ONLINE_RES) -$UGUIDE + ^sep(Manjaro) Stable Updates,exo-open --launch WebBrowser https://forum.manjaro.org/c/announcements/stable-updates/,distributor-logo-manjaro Manjaro Wiki,exo-open --launch WebBrowser https://wiki.manjaro.org,distributor-logo-manjaro @@ -417,10 +458,10 @@ case $LANG in ROOTDIR="Katalog główny" ;; es*) - QUICK_NAV="Navegación rápida" - HOME_DIR="Carpeta personal" - ROOTDIR="Directorio raíz" - ;; + QUICK_NAV="Navegación rápida" + HOME_DIR="Carpeta personal" + ROOTDIR="Directorio raíz" + ;; *) QUICK_NAV="Quick Navigation" HOME_DIR="Home Directory" @@ -628,7 +669,8 @@ MENU_PADDING_TOP=0 MENU_PADDING_RIGHT=0 MENU_PADDING_BOTTOM=0 MENU_PADDING_LEFT=0 -jgmenu_icon_size=0 +#jgmenu_icon_size=20 + case $LANG in pl*) @@ -777,28 +819,32 @@ esac mkconfigfile cat < ${MENU_ITEMS} -^sep( $SETTINGS ) -^sep($LOOK_AND_FEEL) -$LXAPPEARANCE,lxappearance,preferences-desktop-theme -$NITROGEN,nitrogen,nitrogen -$OBCONF,obconf,obconf -$NOTIFYD,xfce4-notifyd-config,xfce4-notifyd -$PREFERRED_APPS,exo-preferred-applications,preferences-desktop-default-applications -$LIGHTDM,lightdm-gtk-greeter-settings-pkexec,lightdm-gtk-greeter-settings -$POWER_MNGR,xfce4-power-manager-settings,xfce4-power-manager-settings -^sep($MABOX_DESK_ELEM) -$SIZE,^checkout(menusize),applications-development -Conky,^pipe(jgmenu_run ob --cmd=mabox-conky-pipemenu),desktop-effects -$TINT2,^pipe(jgmenu_run ob --cmd=mabox-tint2-pipemenu),tint2conf -$COMPOSER,^pipe(jgmenu_run ob --cmd=mabox-compositor),compton -^tag(menusize) -^sep($SIZE) -$TINY,cat /usr/share/mb-jgtools/tiny > ~/.config/mabox/jgmenusize.conf && mb-jgtools right -$SMALL,cat /usr/share/mb-jgtools/small > ~/.config/mabox/jgmenusize.conf && mb-jgtools right -$NORMAL,cat /usr/share/mb-jgtools/normal > ~/.config/mabox/jgmenusize.conf && mb-jgtools right -$BIG,cat /usr/share/mb-jgtools/big > ~/.config/mabox/jgmenusize.conf && mb-jgtools right -$HUGE,cat /usr/share/mb-jgtools/huge > ~/.config/mabox/jgmenusize.conf && mb-jgtools right +. ~/.config/mabox/settings.csv +. ~/.config/mabox/settings_tags.csv + +#^sep( $SETTINGS ) +#^sep($LOOK_AND_FEEL) +#$LXAPPEARANCE,lxappearance,preferences-desktop-theme +#$NITROGEN,nitrogen,nitrogen +#$OBCONF,obconf,obconf +#$NOTIFYD,xfce4-notifyd-config,xfce4-notifyd +#$PREFERRED_APPS,exo-preferred-applications,preferences-desktop-default-applications +#$LIGHTDM,lightdm-gtk-greeter-settings-pkexec,lightdm-gtk-greeter-settings +#$POWER_MNGR,xfce4-power-manager-settings,xfce4-power-manager-settings +#^sep($MABOX_DESK_ELEM) +#$SIZE,^checkout(menusize),applications-development +#Conky,^pipe(jgmenu_run ob --cmd=mabox-conky-pipemenu),desktop-effects +#$TINT2,^pipe(jgmenu_run ob --cmd=mabox-tint2-pipemenu),tint2conf +#$COMPOSER,^pipe(jgmenu_run ob --cmd=mabox-compositor),compton + +#^tag(menusize) +#^sep($SIZE) +#$TINY,cat /usr/share/mb-jgtools/tiny > ~/.config/mabox/jgmenusize.conf && mb-jgtools right +#$SMALL,cat /usr/share/mb-jgtools/small > ~/.config/mabox/jgmenusize.conf && mb-jgtools right +#$NORMAL,cat /usr/share/mb-jgtools/normal > ~/.config/mabox/jgmenusize.conf && mb-jgtools right +#$BIG,cat /usr/share/mb-jgtools/big > ~/.config/mabox/jgmenusize.conf && mb-jgtools right +#$HUGE,cat /usr/share/mb-jgtools/huge > ~/.config/mabox/jgmenusize.conf && mb-jgtools right EOF jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null }