#!/bin/bash
. $HOME/.config/mabox/mabox.conf
case $LANG in
pl*)
TITLE="Ustawienia Menu i Paneli"
ICONS="Ikony"
CIRCLE="Okrągłe ikony"
SQUARE="Kwadratowe ikony"
SHOW_ICONS="Pokaż ikony"
HIDE_ICONS="Ukryj ikony"
SIZE="Rozmiar i czcionka"
TINY="malutki"
SMALL="mały"
NORMAL="normalny"
BIG="duży"
HUGE="wielki"
FONT_FAMILY="Czcionka"
COLOR_SCHEME="Motyw kolorów"
EDIT_CURRENT="Edytuj aktywny"
FOLLOW_OB="Zgodny z motywem OpenBox"
CHOOSE="Wybierz..."
;;
es*)
TITLE="Menu/Panel lateral"
ICONS="Iconos"
CIRCLE="Circle icons"
SQUARE="Square icons"
SHOW_ICONS="Mostrar iconos"
HIDE_ICONS="Ocultar iconos"
SIZE="Tamaño de Menu/Panel lateral"
TINY="Diminuto"
SMALL="Pequeño"
NORMAL="Normal"
BIG="Grande"
HUGE="Muy Grande"
FONT_FAMILY="Familia tipográfica"
COLOR_SCHEME="Esquema de colores"
EDIT_CURRENT="Edit current"
FOLLOW_OB="Same as OpenBox theme"
CHOOSE="Choose..."
;;
*)
TITLE="Menu settings"
ICONS="Icons"
CIRCLE="Circle icons"
SQUARE="Square icons"
SHOW_ICONS="Show icons"
HIDE_ICONS="Hide icons"
SIZE="Menu/Sidepanels Size and Font"
TINY="tiny"
SMALL="small"
NORMAL="normal"
BIG="big"
HUGE="huge"
FONT_FAMILY="Font Family"
COLOR_SCHEME="Color Scheme"
EDIT_CURRENT="Edit current"
FOLLOW_OB="Same as OpenBox theme"
CHOOSE="Choose..."
;;
esac
#out+=("^sep($TITLE)")
case $menu_font_size in
7)
t=""
;;
8)
s=""
;;
9)
n=""
;;
10)
b=""
;;
12)
h=""
;;
*)
;;
esac
out+=("^sep($SIZE)")
out+=(" $t $TINY,mb-setvar menu_font_size=7;mb-setvar jgmenu_item_height=14;mb-setvar jgmenu_icon_size=8;mb-setvar sep_height=1;mb-setvar item_margin_y=1; mb-jgtools settings
$s $SMALL,mb-setvar menu_font_size=8;mb-setvar jgmenu_item_height=16;mb-setvar jgmenu_icon_size=12;mb-setvar sep_height=2;mb-setvar item_margin_y=2;mb-jgtools settings
$n $NORMAL,mb-setvar menu_font_size=9;mb-setvar jgmenu_item_height=18;mb-setvar jgmenu_icon_size=16;mb-setvar sep_height=2;mb-setvar item_margin_y=2;mb-jgtools settings
$b $BIG,mb-setvar menu_font_size=10;mb-setvar jgmenu_item_height=20;mb-setvar jgmenu_icon_size=18;mb-setvar sep_height=4;mb-setvar item_margin_y=3;mb-jgtools settings
$h $HUGE,mb-setvar menu_font_size=12;mb-setvar jgmenu_item_height=24;mb-setvar jgmenu_icon_size=20;mb-setvar sep_height=5;mb-setvar item_margin_y=3;mb-jgtools settings")
#out+=("^sep($FONT_FAMILY)")
######### FONT FAMILY
out+=("^sep()")
out+=("$FONT_FAMILY,^checkout(fonty)")
case $menu_font_family in
"Noto Sans Light")
nol=""
;;
"Noto Sans Medium")
nom=""
;;
Jet*)
je=""
;;
Aut*)
au=""
;;
Deja*)
de=""
;;
Robo*)
ro=""
;;
Inco*)
in=""
;;
*)
;;
esac
out2+=("^tag(fonty)")
out2+=("^sep($FONT_FAMILY)")
out2+=("$nol Noto Sans Light,mb-setvar \"menu_font_family='Noto Sans Light'\";mb-jgtools settings")
out2+=("$nom Noto Sans Medium,mb-setvar \"menu_font_family='Noto Sans Medium'\";mb-jgtools settings")
out2+=("$je JetBrains Mono Regular,mb-setvar \"menu_font_family='JetBrains Mono Regular'\";mb-jgtools settings")
out2+=("$au Autour One,mb-setvar \"menu_font_family='Autour One'\";mb-jgtools settings")
out2+=("$de DejaVu Serif,mb-setvar \"menu_font_family='DejaVu Serif'\";mb-jgtools settings")
out2+=("$ro Roboto Light,mb-setvar \"menu_font_family='Roboto Light'\";mb-jgtools settings")
out2+=("$in Inconsolata,mb-setvar menu_font_family=Inconsolata;mb-jgtools settings")
########## ICONS
out+=("^sep($ICONS)")
if [ $jgmenu_use_icons == true ]; then
out+=("$HIDE_ICONS,mb-setvar jgmenu_use_icons=false;mb-jgtools settings")
else
out+=("$SHOW_ICONS,mb-setvar jgmenu_use_icons=true;mb-jgtools settings")
fi
out+=("^sep()")
out+=("$SQUARE,mb-setvar jgmenu_icon_theme=Numix-Square;mb-setvar jgmenu_use_icons=true;mb-jgtools settings")
out+=("$CIRCLE,mb-setvar jgmenu_icon_theme=Numix-Circle;mb-setvar jgmenu_use_icons=true;mb-jgtools settings")
########## THEMES
out+=("^sep($COLOR_SCHEME)")
out+=("$CHOOSE,^checkout(motywy)")
if [ $jgmenu_theme != obtheme ]; then
out+=("$EDIT_CURRENT: ($jgmenu_theme),geany $HOME/.config/mabox/jgobthemes/$jgmenu_theme.colorrc,geany")
else
ob_file=$HOME/.config/openbox/rc.xml
[[ -f $ob_file ]] && wm_theme=$(awk '// {while (getline n) {if (match(n, //)){l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")
out+=("$EDIT_CURRENT: ($wm_theme),geany $HOME/.config/mabox/jgobthemes/$wm_theme.colorrc,geany")
fi
out2+=("^tag(motywy)")
out2+=("$FOLLOW_OB,mb-setvar jgmenu_theme=obtheme;mb-jgtools settings
^sep()")
for item in "$HOME"/.config/mabox/jgobthemes/*colorrc; do
theme="${item##*/}"
out2+=("${theme%.*},mb-setvar jgmenu_theme=${theme%.*};mb-jgtools settings")
done
printf '%s\n' "${out[@]}"
printf '%s\n' "${out2[@]}"