mabox-pipemenus/usr/bin/jgmenusettings-pipe

189 lines
5.9 KiB
Plaintext
Raw Normal View History

2020-09-07 16:55:43 +02:00
#!/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"
2020-09-10 14:58:34 +02:00
ICONS="Iconos"
2020-09-07 16:55:43 +02:00
CIRCLE="Circle icons"
SQUARE="Square icons"
2020-09-10 14:58:34 +02:00
SHOW_ICONS="Mostrar iconos"
HIDE_ICONS="Ocultar iconos"
2020-09-07 16:55:43 +02:00
SIZE="Tamaño de Menu/Panel lateral"
TINY="Diminuto"
SMALL="Pequeño"
NORMAL="Normal"
BIG="Grande"
HUGE="Muy Grande"
2020-09-10 14:58:34 +02:00
FONT_FAMILY="Familia tipográfica"
COLOR_SCHEME="Esquema de colores"
2020-09-07 16:55:43 +02:00
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 <small><small>$TINY</small></small>,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>$SMALL</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>$BIG</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 <big><big>$HUGE</big></big>,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+=("<span size=\"x-large\" font_family=\"Noto Sans Light\">$nol Noto Sans Light</span>,mb-setvar \"menu_font_family='Noto Sans Light'\";mb-jgtools settings")
out2+=("<span size=\"x-large\" font_family=\"Noto Sans Medium\">$nom Noto Sans Medium</span>,mb-setvar \"menu_font_family='Noto Sans Medium'\";mb-jgtools settings")
out2+=("<span size=\"x-large\" font_family=\"JetBrains Mono Regular\">$je JetBrains Mono Regular</span>,mb-setvar \"menu_font_family='JetBrains Mono Regular'\";mb-jgtools settings")
out2+=("<span size=\"x-large\" font_family=\"Autour One\">$au Autour One</span>,mb-setvar \"menu_font_family='Autour One'\";mb-jgtools settings")
out2+=("<span size=\"x-large\" font_family=\"DejaVu Serif\">$de DejaVu Serif</span>,mb-setvar \"menu_font_family='DejaVu Serif'\";mb-jgtools settings")
out2+=("<span size=\"x-large\" font_family=\"Roboto Light\">$ro Roboto Light</span>,mb-setvar \"menu_font_family='Roboto Light'\";mb-jgtools settings")
out2+=("<span size=\"x-large\" font_family=\"Inconsolata\">$in Inconsolata</span>,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()")
2020-09-10 14:58:34 +02:00
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")
2020-09-07 16:55:43 +02:00
########## THEMES
out+=("^sep($COLOR_SCHEME)")
out+=("$CHOOSE,^checkout(motywy)")
if [ $jgmenu_theme != obtheme ]; then
out+=("$EDIT_CURRENT: (<i>$jgmenu_theme</i>),geany $HOME/.config/mabox/jgobthemes/$jgmenu_theme.colorrc,geany")
2020-09-10 14:58:34 +02:00
else
ob_file=$HOME/.config/openbox/rc.xml
[[ -f $ob_file ]] && wm_theme=$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/)){l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")
out+=("$EDIT_CURRENT: (<i>$wm_theme</i>),geany $HOME/.config/mabox/jgobthemes/$wm_theme.colorrc,geany")
2020-09-07 16:55:43 +02:00
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
2020-09-15 22:35:22 +02:00
### RUN
2020-09-07 16:55:43 +02:00
2020-09-15 22:35:22 +02:00
if [ $1 == "-s" ]; then
. $HOME/bin/pipemenu-standalone.cfg
MENU_PADDING_TOP=0
MENU_HALIGN="center"
MENU_VALIGN="center"
jgmenu_icon_size=0
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
$(printf '%s\n' "${out[@]}")
$(printf '%s\n' "${out2[@]}")
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
exit 0
fi
2020-09-07 16:55:43 +02:00
printf '%s\n' "${out[@]}"
printf '%s\n' "${out2[@]}"