settings menu

master
Daniel Napora 2020-08-29 15:40:13 +02:00
parent d555bc3c1e
commit 7a49d278b1
1 changed files with 93 additions and 47 deletions

View File

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