mabox-colorizer/bin/colorizer-ob

712 lines
34 KiB
Plaintext
Raw Normal View History

2022-05-15 03:25:01 +02:00
#!/bin/bash
#
# colorizer - set of tools for Mabox (auto)theming
# Copyright (C) 2022-2023 Daniel Napora <napcok@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2022-05-15 03:25:01 +02:00
2022-05-15 17:42:35 +02:00
MBCOLORSDIR="$HOME"/.themes/MBcolors/openbox-3/
2022-09-19 20:59:26 +02:00
GRADIENT_FILE="$HOME"/.config/colorizer/gradients_all.inc
MORE_GRADIENT_FILE="$HOME"/.config/colorizer/gradients_menu.inc
2023-09-23 13:57:32 +02:00
SYSTHEMES="/usr/share/mabox-colorizer/colorschemes/ob.csv"
USERTHEMES="$HOME/.config/colorizer/openbox/userthemes.csv"
### Wallpaper colors
WALLPALDIR="$HOME/.cache/colorizer/palettes"
mkdir -p "$WALLPALDIR"
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
NAME=${WALLPATH////_}
if [[ "${NAME}" =~ ^_home_.* ]]; then
n=${#HOME}
((n++))
NAME=${NAME:${n}}
fi
if [ ! -f "$WALLPALDIR/$NAME.clr" ]; then
convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr"
fi
mapfile -t w < "$WALLPALDIR/$NAME.clr"
2022-09-19 20:59:26 +02:00
if [ ! -f "$GRADIENT_FILE" ]; then
cp /usr/share/mabox-colorizer/gradients.inc "$GRADIENT_FILE"
fi
2022-05-15 03:25:01 +02:00
2022-05-15 17:42:35 +02:00
if [ ! -d "$MBCOLORSDIR" ]; then
2022-05-15 03:25:01 +02:00
mkdir -p ${MBCOLORSDIR}
rsync -a /usr/share/mabox-colorizer/themes/MBcolors/openbox-3/* ${MBCOLORSDIR}/
fi
OBTHEME=$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/))
{l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$HOME/.config/openbox/rc.xml")
THEMERC="$HOME/.themes/$OBTHEME/openbox-3/themerc"
me="colorizer-ob -s"
2022-08-27 16:36:46 +02:00
case "$LANG" in
pl*)
2023-09-23 13:57:32 +02:00
QUICK_TWEAKS="Ustawienia główne"
OVERALL_STYLE="Ogólny styl"
THEMES="Motywy"
SYSTEM_THEMES="Systemowe"
YOUR_THEMES="Moje motywy"
SAVE_CURRTHEME="Zapisz aktualną kobfigurację jako..."
OPEN_THEMEFILE="Odwórz plik z motywami w edytorze"
THEME="Motyw"
APPLY="Zastosuj"
APPLY_THEME="Pełny motyw (kolory, czcionki i rozmiar)"
APPLY_SCHEME="Tylko kolory"
DELETE="Usuń"
DELETE_THEME="Usuń motyw"
2022-08-27 16:36:46 +02:00
OBTHEME_LBL="Motyw OpenBox"
2022-12-23 13:48:01 +01:00
GENERATEFROMWP="Generuj z kolorów tapety..."
2023-09-23 13:57:32 +02:00
LIGHTBG=" Jasne tło"
DARKBG="Ciemne tło"
2023-09-25 13:37:33 +02:00
RANDOMIZE="Generuj losowo"
2022-08-27 16:36:46 +02:00
TITLEBAR="Pasek tytułowy"
2023-09-23 13:57:32 +02:00
ACTIVE_WINDOW="Aktywne okno"
INACTIVE_WINDOW="Nieaktywne okno"
TITLEBAR_FONT="Czcionka"
2022-08-27 16:36:46 +02:00
ACTIVE_BG="Tło aktywnego okna"
INACTIVE_BG="Tło nieaktywnego okna"
2023-09-23 13:57:32 +02:00
TEXT_COLOR="Kolor tekstu"
2022-08-27 16:36:46 +02:00
TITLEBAR_TEXT="Tekst paska tytułowego"
FONT="Czcionka"
FONTSIZE="Rozmiar czcionki"
2023-08-30 14:00:09 +02:00
_INCREASE="Powiększ do"
_DECREASE="Pomniejsz do"
FONTFAMILY="Czcionka (rodzina)"
BOLD="Pogrubienie"
ITALIC="Kursywa"
TEXTALIGN="Wyrównanie tytułu"
2022-08-27 18:52:55 +02:00
LEFT="do lewej"
CENTER="po środku"
RIGHT="do prawej"
2022-08-27 16:36:46 +02:00
SHADOW="Cień"
NOSHADOW="bez cienia"
DARK="Ciemny"
LIGHT="Jasny"
TEXT="Tekst"
ACTIVE_FG="w aktywnym oknie"
INACTIVE_FG="w nieaktywnym oknie"
PADDING="Odstęp"
VERTICAL="W pionie"
HORIZONTAL="W poziomie"
2022-12-08 17:48:55 +01:00
RAISED_OR_FLAT="Płaski, Uniesiony, Wklęsły"
2022-09-19 20:59:26 +02:00
FLAT="płaski - <b>flat</b>"
2022-12-08 17:48:55 +01:00
RAISED="uniesiony - <b>raised</b>"
2022-09-19 20:59:26 +02:00
SUNKEN="wklęsły - <b>sunken</b>"
2023-09-23 13:57:32 +02:00
BUTTONS_LBL="Przyciski"
BUTTONS_LAYOUT="Układ przycisków"
LEGEND="Legenda"
2022-08-27 16:36:46 +02:00
GRADIENT_TYPE="Typ Gradientu"
SOLID_COLOR="Jednolity kolor (brak gradientu)"
2022-09-19 20:59:26 +02:00
PRE_GRADIENTS="Gotowe gradienty"
GRADIENT_REVERSE="Odwróć kolory Gradientu"
2022-08-27 16:36:46 +02:00
SPLITVERTICAL="Podział w pionie"
MIRRORHORIZONTAL="LustroPoziome"
DIAGONAL="Przekątna"
CROSSDIAGONAL="Przekątna krzyżowa"
PYRAMID="Piramida"
ACTIVE_BG_TO="Tło aktywnego okna 2"
INACTIVE_BG_TO="Tło nieaktywnego okna 2"
2022-08-28 01:31:25 +02:00
BORDER="Obramowanie okna"
BORDER_PX="Obramowanie (px)"
2022-12-08 17:48:55 +01:00
ACTIVE_BORDER="Obramowanie akt. okna"
INACTIVE_BORDER="Obramowanie nieakt. okna"
2022-08-27 16:36:46 +02:00
HANDLEWIDTH="Uchwyt - rozmiar"
ACTIVEHANDLE="Aktywny Uchwyt"
YES="Tak"
NO="Nie"
GRIPONLY="Tylko chwyt (po bokach)"
RESET="Resetuj"
RESET_THEME="Resetuj motyw"
AREYOUSURE="Czy aby na pewno?"
NOT_SUPORTED_OBTHEME="Nie wspierany motyw"
2023-08-02 01:34:04 +02:00
UNLOCK="odblokuj swoją kreatywność..."
SWITCH_TO_MBCOLORS="Przełącz na <b>MBColors</b>"
2023-09-06 16:13:11 +02:00
_COLORIZER_ROOT="<b>Colorizer</b> - menu główne"
2022-08-27 16:36:46 +02:00
;;
*)
2023-09-23 13:57:32 +02:00
QUICK_TWEAKS="Global Settings/Quick Tweaks"
OVERALL_STYLE="Overall style"
THEMES="Themes"
SYSTEM_THEMES="System themes"
YOUR_THEMES="My Themes"
SAVE_CURRTHEME="Save current setup as..."
OPEN_THEMEFILE="Open themes file in editor"
THEME="Theme"
APPLY="Apply"
APPLY_THEME="Full theme (colors,fonts and sizing)"
APPLY_SCHEME="Colors only"
DELETE="Delete"
DELETE_THEME="Delete theme"
2022-08-27 16:36:46 +02:00
OBTHEME_LBL="OpenBox theme"
2022-12-23 13:48:01 +01:00
GENERATEFROMWP="Generate from wallpaper colors..."
2023-09-23 13:57:32 +02:00
LIGHTBG="Light Background"
DARKBG="Dark Background"
2023-09-25 13:37:33 +02:00
RANDOMIZE="Generate randomly"
2022-08-27 16:36:46 +02:00
TITLEBAR="Title Bar"
2023-09-23 13:57:32 +02:00
ACTIVE_WINDOW="Active Window"
INACTIVE_WINDOW="Inactive Window"
2022-08-27 16:36:46 +02:00
ACTIVE_BG="Active Background"
INACTIVE_BG="Inactive Background"
2023-09-23 13:57:32 +02:00
TEXT_COLOR="Text color"
2022-08-27 16:36:46 +02:00
TITLEBAR_TEXT="Title Bar Text"
TITLEBAR_FONT="Title Bar Font"
2022-08-27 16:36:46 +02:00
FONT="Font"
2023-08-30 14:00:09 +02:00
FONTSIZE="font size"
_INCREASE="Increase to"
_DECREASE="Decrease to"
FONTFAMILY="font family"
BOLD="Bold"
ITALIC="Italic"
TEXTALIGN="Title align"
2022-08-27 18:52:55 +02:00
LEFT="left"
CENTER="center"
RIGHT="right"
2022-08-27 16:36:46 +02:00
SHADOW="Shadow"
NOSHADOW="no shadow"
DARK="Dark"
LIGHT="Light"
TEXT="Text"
ACTIVE_FG="in active window"
INACTIVE_FG="in inactive window"
PADDING="Padding"
VERTICAL="Vertical"
HORIZONTAL="Horizontal"
2022-09-19 20:59:26 +02:00
RAISED_OR_FLAT="Flat, Raised or Sunken"
2022-08-27 16:36:46 +02:00
FLAT="flat"
RAISED="raised"
2022-09-19 20:59:26 +02:00
SUNKEN="sunken"
2023-09-23 13:57:32 +02:00
BUTTONS_LBL="Buttons"
BUTTONS_LAYOUT="Buttons Layout"
LEGEND="Legend"
2022-08-27 16:36:46 +02:00
GRADIENT_TYPE="Gradient type"
SPLITVERTICAL="SplitVertical"
MIRRORHORIZONTAL="MirrorHorizontal"
DIAGONAL="Diagonal"
CROSSDIAGONAL="CrossDiagonal"
PYRAMID="Pyramid"
SOLID_COLOR="Solid color (no gradient)"
2022-09-19 20:59:26 +02:00
PRE_GRADIENTS="Predefined gradients"
2023-09-23 13:57:32 +02:00
GRADIENT_REVERSE="Reverse Gradient Colors"
2022-08-27 16:36:46 +02:00
ACTIVE_BG_TO="Active Background to"
INACTIVE_BG_TO="Inactive Background to"
2022-08-28 01:31:25 +02:00
BORDER="Window Border"
BORDER_PX="Border (px)"
2022-08-27 16:36:46 +02:00
ACTIVE_BORDER="Active Border"
INACTIVE_BORDER="Inactiva Border"
HANDLEWIDTH="Handle Width"
ACTIVEHANDLE="Active Handle"
YES="Yes"
NO="No"
GRIPONLY="Grip only"
RESET="Reset"
RESET_THEME="Reset theme to default"
AREYOUSURE="Are you sure?"
2023-08-02 01:34:04 +02:00
NOT_SUPORTED_OBTHEME="Theme not supported"
UNLOCK="Unlock your creativity..."
SWITCH_TO_MBCOLORS="Switch to <b>MBColors</b>"
2023-09-06 16:13:11 +02:00
_COLORIZER_ROOT="<b>Colorizer</b> rootmenu"
2022-08-27 16:36:46 +02:00
;;
esac
getvalues () {
read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)"
read ABGTO <<< "$(grep .active.title.bg.colorTo ${THEMERC} | cut -d':' -f2)"
read NBG <<< "$(grep .inactive.title.bg.color: ${THEMERC} | cut -d':' -f2)"
read NBGTO <<< "$(grep .inactive.title.bg.colorTo ${THEMERC} | cut -d':' -f2)"
read AFG <<< "$(grep .active.label.text.color ${THEMERC} | cut -d':' -f2)"
read NFG <<< "$(grep .inactive.label.text.color ${THEMERC} | cut -d':' -f2)"
read ALINE <<< "$(grep .active.border.color ${THEMERC} | cut -d':' -f2)"
read NLINE <<< "$(grep inactive.border.color ${THEMERC} | cut -d':' -f2)"
read PHEIGHT <<< "$(grep ^padding.height: ${THEMERC} | cut -d':' -f2)"
read PWIDTH <<< "$(grep ^padding.width: ${THEMERC} | cut -d':' -f2)"
read TXTJUST <<< "$(grep text.justify ${THEMERC} | cut -d':' -f2)"
read HANDLE <<< "$(grep handle.width ${THEMERC} | cut -d':' -f2)"
read BORD <<< "$(grep border.width ${THEMERC} | cut -d':' -f2)"
2023-09-23 13:57:32 +02:00
#read BEVEL REST <<< "$(grep .title.bg: ${THEMERC} | cut -d':' -f2)"
read TITLEBG <<< "$(grep .title.bg: ${THEMERC} | cut -d':' -f2)"
case "${TITLEBG,,}" in
*flat*) BEVEL="flat";;
*raised*) BEVEL="raised";;
*sunken*) BEVEL="sunken";;
esac
case "${TITLEBG,,}" in
*solid*) GRAD=Solid;;
*splitvertical*) GRAD=SplitVertical;;
*vertical*) GRAD=Vertical;;
*mirrorhorizontal*) GRAD=MirrorHorizontal;;
*horizontal*) GRAD=Horizontal;;
*crossdiagonal*) GRAD=CrossDiagonal;;
*diagonal*) GRAD=Diagonal;;
*pyramid*) GRAD=Pyramid;;
esac
but=$(<"$MBCOLORSDIR/.buttons")
BUTTONS=${but:-tiny}
#notify-send.sh "Buttons" "$BUTTONS"
read AHBG <<< "$(grep .active.handle.bg.color: ${THEMERC} | cut -d':' -f2)"
if [ "$ABG" == "$AHBG" ];then
AHANDLE="yes"
else
AHANDLE="no"
fi
}
getvaluesrc() {
#from RC.xml
nspace="http://openbox.org/3.4/rc"
cfg="$HOME/.config/openbox/rc.xml"
FSIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$cfg")
FNAME=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:name' "$cfg")
NDSLIMC=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:titleLayout' "$cfg")
WEIGHT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:weight' "$cfg")
SLANT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' "$cfg")
}
2022-08-27 16:36:46 +02:00
if [[ -f "$THEMERC" ]] && [[ "$OBTHEME" = "MBcolor"* ]]; then
2022-05-15 03:25:01 +02:00
if [ ! -f "${THEMERC}.bak" ]; then
cp ${THEMERC} ${THEMERC}.bak
#check if lines, and add missing
# colorTo
# handle
# grip
# text.justify
# window.active.label.text.font:shadow=n:shadowtint=70:shadowoffset=1
#grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
grep ^[^#] "$THEMERC" | grep -qiF -- .active.title.bg.colorTo || echo "window.active.title.bg.colorTo: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .inactive.title.bg.colorTo || echo "window.inactive.title.bg.colorTo: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- handle.width: || echo "window.handle.width: 0" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .handle.bg: || echo "window.*.handle.bg: parentrelative" >> "$THEMERC"
################################################################################################################################## Kolory poniżej obliczyć
grep ^[^#] "$THEMERC" | grep -qiF -- .active.handle.bg.color: || echo "window.active.handle.bg.color: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .active.handle.bg.colorTo: || echo "window.active.handle.bg.colorTo: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .inactive.handle.bg.color: || echo "window.inactive.handle.bg.color: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .inactive.handle.bg.colorTo: || echo "window.inactive.handle.bg.colorTo: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .grip.bg: || echo "window.*.grip.bg: parentrelative" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .active.grip.bg.color: || echo "window.active.grip.bg.color: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .active.grip.bg.colorTo: || echo "window.active.grip.bg.colorTo: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .inactive.grip.bg.color: || echo "window.inactive.grip.bg.color: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .inactive.grip.bg.colorTo: || echo "window.inactive.grip.bg.colorTo: #222222" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .text.justify: || echo "window.*.text.justify: center" >> "$THEMERC"
grep ^[^#] "$THEMERC" | grep -qiF -- .text.font: || echo "window.*.text.font: shadow=n:shadowtint=70:shadowoffset=1" >> "$THEMERC"
fi
2022-05-15 03:25:01 +02:00
getvalues
getvaluesrc
2022-05-15 03:25:01 +02:00
2023-09-23 13:57:32 +02:00
currvalues=("${ABG}|${ABGTO}|${AFG}|${ALINE}|${NBG}|${NBGTO}|${NFG}|${NLINE}|${GRAD,,}|${TXTJUST}|${PHEIGHT}|${PWIDTH}|${HANDLE}|${BORD}|${BEVEL}|${BUTTONS}|${FSIZE}|${FNAME}|${NDSLIMC}|${WEIGHT}|${SLANT}|")
#notify-send.sh "$BEVEL" "${currvalues}"
if [ ! -f "$USERTHEMES" ]; then
mkdir -p "$HOME/.config/colorizer/openbox/"
echo " ABG | ABGTO | AFG | ALINE | NBG | NBGTO | NFG | NLINE | GRAD |TXTJUST|PHEIGHT|PWIDTH|HANDLE|BORD|BEVEL|BUTTONS|FSIZE|FNAME|NDSLIMC|WEIGHT|SLANT|scheme_name" > "$USERTHEMES"
fi
2023-08-02 01:34:04 +02:00
#out+=("^sep($OBTHEME_LBL: <i>$OBTHEME</i>)")
2023-05-10 23:50:21 +02:00
2023-09-23 13:57:32 +02:00
out+=("<big></big> $QUICK_TWEAKS,^checkout(tweaks)")
out2+=("^tag(tweaks)")
out2+=("^sep(Overall style)")
out2+=("Large,obtctl tweak large;$me")
out2+=("Big,obtctl tweak big;$me")
out2+=("Normal,obtctl tweak normal;$me")
out2+=("Small,obtctl tweak small;$me")
out2+=("Tiny,obtctl tweak tiny;$me")
2023-09-25 13:37:33 +02:00
out2+=("^sep()")
out2+=("<big></big> $RANDOMIZE,obtctl randomizer;$me")
2023-09-23 13:57:32 +02:00
out2+=("\"\"\"^sep($RAISED_OR_FLAT?)\"\"\"")
[[ "$BEVEL" == "flat" ]] && out2+=("<big>綠</big> $FLAT,obtctl raised 0;$me") || out2+=("<big>祿</big> $FLAT,obtctl raised 0;$me")
[[ "$BEVEL" == "raised" ]] && out2+=("<big>綠</big> $RAISED,obtctl raised 1;$me") || out2+=("<big>祿</big> $RAISED,obtctl raised 1;$me")
[[ "$BEVEL" == "sunken" ]] && out2+=("<big>綠</big> $SUNKEN,obtctl raised 2;$me") || out2+=("<big>祿</big> $SUNKEN,obtctl raised 2;$me")
out2+=("^sep($GRADIENT_TYPE)")
[[ "$GRAD" == Solid ]] && out2+=("<big>綠</big> $SOLID_COLOR,obtctl gradient_type solid;$me") || out2+=("<big>祿</big> $SOLID_COLOR,obtctl gradient_type solid;$me")
out2+=("^sep()")
[[ "$GRAD" == Vertical ]] && out2+=("<big>綠</big> $VERTICAL,obtctl gradient_type vertical;$me") || out2+=("<big>祿</big> $VERTICAL,obtctl gradient_type vertical;$me")
[[ "$GRAD" == Horizontal ]] && out2+=("<big>綠</big> $HORIZONTAL,obtctl gradient_type horizontal;$me") || out2+=("<big>祿</big> $HORIZONTAL,obtctl gradient_type horizontal;$me")
[[ "$GRAD" == MirrorHorizontal ]] && out2+=("<big>綠</big> $MIRRORHORIZONTAL,obtctl gradient_type mirrorhorizontal;$me") || out2+=("<big>祿</big> $MIRRORHORIZONTAL,obtctl gradient_type mirrorhorizontal;$me")
[[ "$GRAD" == SplitVertical ]] && out2+=("<big>綠</big> $SPLITVERTICAL,obtctl gradient_type splitvertical;$me") || out2+=("<big>祿</big> $SPLITVERTICAL,obtctl gradient_type splitvertical;$me")
[[ "$GRAD" == Diagonal ]] && out2+=("<big>綠</big> $DIAGONAL,obtctl gradient_type diagonal;$me") || out2+=("<big>祿</big> $DIAGONAL,obtctl gradient_type diagonal;$me")
[[ "$GRAD" == CrossDiagonal ]] && out2+=("<big>綠</big> $CROSSDIAGONAL,obtctl gradient_type crossdiagonal;$me") || out2+=("<big>祿</big> $CROSSDIAGONAL,obtctl gradient_type crossdiagonal;$me")
[[ "$GRAD" == Pyramid ]] && out2+=("<big>綠</big> $PYRAMID,obtctl gradient_type pyramid;$me") || out2+=("<big>祿</big> $PYRAMID,obtctl gradient_type pyramid;$me")
#### COLOR SCHEMES 
out+=("<big><span fgcolor='${ABGTO}'></span> <span fgcolor='${ABG}'></span> <span fgcolor='${ABGTO}'></span></big> $THEMES,^checkout(schemes)")
out2+=("^tag(schemes)")
out2+=("^sep($THEMES)")
out2+=("^sep($SYSTEM_THEMES)")
n=1
while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel buttons fsize fname ndslimc weight slant scheme_name
do
((n=n+1))
out2+=("<big><span bgcolor='${abg}' fgcolor='${afg}'><span bgcolor='${abgto}'> </span><small> <tt>$(printf '%-20s' "${scheme_name}")</tt> </small><span bgcolor='${abgto}'> </span></span> <span bgcolor='${nbgto}'> </span><span bgcolor='${nbg}' fgcolor='${nfg}'><small> <tt><i>inactive</i></tt> </small></span><span bgcolor='${nbgto}'> </span></big>,^checkout(schsys${n})")
out3+=("^tag(schsys${n}")
out3+=("^sep($THEME: ${scheme_name})")
out3+=("^sep($APPLY)")
out3+=("\"\"\"<big></big> $APPLY_THEME\"\"\",obtctl applytheme sys ${n};$me")
out3+=("^sep()")
out3+=("<big></big> $APPLY_SCHEME <big><span bgcolor='${abgto}'> </span><span bgcolor='${abg}'> </span><span bgcolor='${abgto}'> </span></big>,obtctl applyscheme sys ${n};$me")
done < <(tail -n +2 "$SYSTHEMES")
out2+=("^sep($YOUR_THEMES)")
out2+=("<big></big> $SAVE_CURRTHEME,obtctl savetheme '${currvalues}';$me")
out2+=("<big></big> $OPEN_THEMEFILE,xdg-open $USERSCHEMES")
out2+=("^sep()")
n=1
while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel buttons fsize fname ndslimc weight slant scheme_name
do
((n=n+1))
out2+=("<big><span bgcolor='${abg}' fgcolor='${afg}'><span bgcolor='${abgto}'> </span><small> <tt>$(printf '%-20s' "${scheme_name}")</tt> </small><span bgcolor='${abgto}'> </span></span> <span bgcolor='${nbgto}'> </span><span bgcolor='${nbg}' fgcolor='${nfg}'><small> <tt><i>inactive</i></tt> </small></span><span bgcolor='${nbgto}'> </span></big>,^checkout(sch${n})")
out3+=("^tag(sch${n}")
out3+=("^sep($THEME: ${scheme_name})")
out3+=("^sep($APPLY)")
out3+=("\"\"\"<big></big> $APPLY_THEME\"\"\",obtctl applytheme usr ${n};$me")
out3+=("^sep()")
out3+=("<big></big> $APPLY_SCHEME <big><span bgcolor='${abgto}'> </span><span bgcolor='${abg}'> </span><span bgcolor='${abgto}'> </span></big>,obtctl applyscheme usr ${n};$me")
out3+=("^sep($DELETE)")
out3+=("<big>󰗨</big> $DELETE_THEME: <i>${scheme_name}</i>,obtctl delscheme ${n};$me")
done < <(tail -n +2 "$USERTHEMES")
out2+=("^sep(<i>$GENERATEFROMWP</i>)")
out2+=("<big><span bgcolor='${w[-2]}' fgcolor='#222222'> <span bgcolor='${w[-4]}'> </span> $LIGHTBG <span bgcolor='${w[-4]}'> </span> </span></big>,w2theme ob light;$me")
out2+=("<big><span bgcolor='${w[2]}' fgcolor='#E5E5E5'> <span bgcolor='${w[4]}'> </span> $DARKBG <span bgcolor='${w[4]}'> </span> </span></big>,w2theme ob dark;$me")
2023-09-25 13:37:33 +02:00
out2+=("^sep()")
out2+=("<big></big> $RANDOMIZE,obtctl randomizer;$me")
2023-09-23 13:57:32 +02:00
2022-08-27 16:36:46 +02:00
out+=("^sep($TITLEBAR)")
2023-09-23 13:57:32 +02:00
out+=("<big>󰛖</big> $TITLEBAR_FONT [ <b> ${FNAME} ${FSIZE} </b> ],^checkout(titletext)")
out+=("<big>󰧈</big> $PADDING [ <b>$PHEIGHT $PWIDTH</b> ],^checkout(padding)")
out+=("<tt><span bgcolor='$ABG' fgcolor='$AFG'><small>    </small></span></tt> $BUTTONS_LBL,^checkout(tbuttons)")
out+=("^sep($ACTIVE_WINDOW)")
out+=("<tt><span bgcolor='$ABG'> </span></tt> $ACTIVE_BG,^pipe(mbclr '$ABG' obtctl clractivebg '${ACTIVE_BG}' '$me')")
2022-09-19 20:59:26 +02:00
[[ ! -z "$ABGTO" ]] && out+=("<tt><span bgcolor='$ABG'> </span><span bgcolor='$ABGTO'> </span></tt> $ACTIVE_BG_TO,^pipe(mbclr '$ABGTO' obtctl clractivebgto '${ACTIVE_BG_TO}' '$me')")
2023-09-23 13:57:32 +02:00
out+=("<tt><span bgcolor='$ABG' fgcolor='$AFG'> <b>title</b> </span></tt> $TEXT_COLOR,^pipe(mbclr '$AFG' obtctl activetextcolor '${TEXT} ${ACTIVE_FG}' '$me')")
out+=("^sep($INACTIVE_WINDOW)")
out+=("<tt><span bgcolor='$NBG'> </span></tt> $INACTIVE_BG,^pipe(mbclr '$NBG' obtctl clrnormalbg '${INACTIVE_BG}' '$me')")
2022-09-19 20:59:26 +02:00
[[ ! -z "$ABGTO" ]] && out+=("<tt><span bgcolor='$NBG'> </span><span bgcolor='$NBGTO'> </span></tt> $INACTIVE_BG_TO,^pipe(mbclr '$NBGTO' obtctl clrnormalbgto '${INACTIVE_BG_TO}' '$me')")
2023-09-23 13:57:32 +02:00
out+=("<tt><span bgcolor='$NBG' fgcolor='$NFG'> <b>title</b> </span></tt> $TEXT_COLOR,^pipe(mbclr '$NFG' obtctl inactivetextcolor '${TEXT} ${INACTIVE_FG}' '$me')")
2023-08-02 01:34:04 +02:00
2022-06-03 19:43:56 +02:00
out+=("^sep(Gradient)")
2023-09-23 13:57:32 +02:00
out+=("<big>󰹸</big> $GRADIENT_TYPE [ <b>${GRAD}</b> ],^checkout(gradient)")
2022-12-08 17:48:55 +01:00
out+=("<tt><span bgcolor='#16a084'> </span><span bgcolor='#43a480'> </span><span bgcolor='#5da97b'> </span><span bgcolor='#72ad77'> </span><span bgcolor='#84b171'> </span><span bgcolor='#95b66c'> </span><span bgcolor='#a5ba66'> </span><span bgcolor='#b5be61'> </span><span bgcolor='#c3c15a'> </span><span bgcolor='#d1c753'> </span><span bgcolor='#dfc94c'> </span><span bgcolor='#edce44'> </span><span bgcolor='#f4d03f'> </span></tt> $PRE_GRADIENTS,^pipe(mbgrad ob)")
2023-09-23 13:57:32 +02:00
out+=("<big></big> $GRADIENT_REVERSE,obtctl activegradient '${ABGTO}' '${ABG}';$me")
2022-09-19 20:59:26 +02:00
2022-08-27 16:36:46 +02:00
out+=("^sep($BORDER)")
out+=("<tt><span bgcolor='$ALINE'> </span></tt> $ACTIVE_BORDER,^pipe(mbclr '$ALINE' obtctl activeborderColor '${ACTIVE_BORDER_COLOR}' '$me')")
out+=("<tt><span bgcolor='$NLINE'> </span></tt> $INACTIVE_BORDER,^pipe(mbclr '$NLINE' obtctl inactiveborderColor '${INACTIVE_BORDER_COLOR}' '$me')")
2023-09-23 13:57:32 +02:00
out+=("<big>󰝣</big> $BORDER [ <b>$BORD</b> ],^checkout(border)")
2022-08-27 16:36:46 +02:00
out+=("$HANDLEWIDTH [ <b>$HANDLE</b> ],^checkout(handlewidth)")
2023-09-23 13:57:32 +02:00
#out+=("$ACTIVEHANDLE? [ <b>$AHANDLE</b> ],^checkout(handle)")
2023-05-10 23:50:21 +02:00
2022-05-15 03:25:01 +02:00
if [ -f "${THEMERC}.bak" ]; then
2022-08-27 16:36:46 +02:00
out+=("^sep($RESET)")
2023-06-01 11:13:09 +02:00
out+=("󰁯 $RESET_THEME,^checkout(resettheme)")
2022-08-27 16:36:46 +02:00
out2+=("^tag(resettheme)")
out2+=("^sep($AREYOUSURE)")
2022-09-19 20:59:26 +02:00
out2+=("$YES,obtctl reset;$me")
2022-05-15 03:25:01 +02:00
fi
#out+=("Edit...,xdg-open ${THEMERC}")
2022-05-15 18:50:21 +02:00
#out2+=("^tag(themes)")
#out2+=("^sep(themes)")
#for i in $(ls $HOME/.themes);do
# if [ -f "$HOME/.themes/${i}/openbox-3/themerc" ]; then
# out2+=("$i,obtctl theme $i;$me")
# fi
#done
2022-06-04 22:50:37 +02:00
#TBUTTONS
out2+=("^tag(tbuttons)")
2023-09-23 13:57:32 +02:00
out2+=("^sep($BUTTONS_LBL)")
2022-06-04 22:50:37 +02:00
out2+=("Tiny,obtctl buttons tiny;$me")
out2+=("Normal,obtctl buttons normal;$me")
out2+=("Bold,obtctl buttons bold;$me")
out2+=("Dots,obtctl buttons dots;$me")
2023-07-28 17:07:31 +02:00
out2+=("^sep()")
out2+=("Big 12px,obtctl buttons big-12;$me")
out2+=("Big 14px,obtctl buttons big-14;$me")
out2+=("^sep($BUTTONS_LAYOUT)")
[[ "$NDSLIMC" == NDSLIMC ]] && out2+=("<big>綠</big> <tt>full </tt> <b>NDSLIMC</b> (default),obtctl ndslimc NDSLIMC;$me") || out2+=("<big>祿</big> <tt>full </tt> <b>NDSLIMC</b> (default),obtctl ndslimc NDSLIMC;$me")
[[ "$NDSLIMC" == NLIMC ]] && out2+=("<big>綠</big> <tt>mini </tt> <b>NLIMC</b>,obtctl ndslimc NLIMC;$me") || out2+=("<big>祿</big> <tt>mini </tt> <b>NLIMC</b>,obtctl ndslimc NLIMC;$me")
[[ "$NDSLIMC" == LIMC ]] && out2+=("<big>綠</big> <tt>mini (no icon)</tt> <b>LIMC</b>,obtctl ndslimc LIMC;$me") || out2+=("<big>祿</big> <tt>mini (no icon)</tt> <b>LIMC</b>,obtctl ndslimc LIMC;$me")
[[ "$NDSLIMC" == CMIL ]] && out2+=("<big>綠</big> <tt>crazy </tt> <b>CMIL</b>,obtctl ndslimc CMIL;$me") || out2+=("<big>祿</big> <tt>crazy </tt> <b>CMIL</b>,obtctl ndslimc CMIL;$me")
out2+=("^sep(<small>$LEGEND</small>)")
out2+=("^sep(N:<small> Window icon</small>)")
out2+=("^sep(L:<small> Window label (Title)</small>)")
out2+=("^sep(I:<small> Iconify (Minimize)</small>)")
out2+=("^sep(M:<small> Maximize</small>)")
out2+=("^sep(C:<small> Close</small>)")
out2+=("^sep(S:<small> Shade (Roll up)</small>)")
out2+=("^sep(D:<small> Omnipresent (On all desktops)</small>)")
out2+=("^sep($TEXTALIGN)")
[[ "$TXTJUST" = left ]] && out2+=("<big>綠 </big> $LEFT,obtctl textjustify left;$me")||out2+=("<big>祿 </big> $LEFT,obtctl textjustify left;$me")
[[ "$TXTJUST" = center ]] && out2+=("<big>綠 </big> $CENTER,obtctl textjustify center;$me")||out2+=("<big>祿 </big> $CENTER,obtctl textjustify center;$me")
[[ "$TXTJUST" = right ]] && out2+=("<big>綠 </big> $RIGHT,obtctl textjustify right;$me")||out2+=("<big>祿 </big> $RIGHT,obtctl textjustify right;$me")
2022-05-15 03:25:01 +02:00
#TEXT
out2+=("^tag(titletext)")
out2+=("^sep($TITLEBAR_FONT)")
out2+=("$FONT... [ <b> ${FNAME} ${FSIZE} </b> ],mb-setfont obtitle;$me")
2023-08-30 14:00:09 +02:00
out2+=("^sep($FONTSIZE)")
out2+=("<big>󰧴</big> $_INCREASE <b>$((FSIZE+1)) px</b>,fontctl ob_fontsize inc;$me")
out2+=("<big>󰧳</big> $_DECREASE <b>$((FSIZE-1)) px</b>,fontctl ob_fontsize dec;$me")
out2+=("^sep()")
sizes=(16 15 14 13 12 11 10 9 8)
for i in "${sizes[@]}"
do
[[ "$FSIZE" == "$i" ]] && out2+=("<big>綠</big> <b>$i px</b>,obtctl fontsize $i;$me") || out2+=("<big>祿</big> $i px,obtctl fontsize $i;$me")
done
out2+=("^sep($FONTFAMILY)")
2023-08-20 09:07:52 +02:00
if [ -f "$HOME/.config/mabox/fonts.list" ];then
mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list)
else
mapfile -t favfonts < <( grep -vE "^($|#)" /usr/share/mabox-colorizer/fonts.list)
cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/
fi
if [ "${#favfonts[@]}" -gt 0 ];then
for fon in "${favfonts[@]}";do
[[ "${FNAME}" == "$fon" ]] && out2+=("<big>綠</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>祿</big> <span font_family=\"${fon}\">${fon}</span>,obtctl fontfamily \"${fon}\";$me")
done
fi
2022-05-15 03:25:01 +02:00
out2+=("^sep()")
[[ "$WEIGHT" =~ .*"old" ]] && out2+=("<big></big> <b>$BOLD</b>,obtctl fontweight Normal;$me") || out2+=("<big></big> <b>$BOLD</b>,obtctl fontweight Bold;$me")
[[ "$SLANT" =~ .*"talic" ]] && out2+=("<big></big> <i>$ITALIC</i>,obtctl fontslant Normal;$me") || out2+=("<big></big> <i>$ITALIC</i>,obtctl fontslant Italic;$me")
2023-08-30 14:00:09 +02:00
#SHADOW
2022-08-27 16:36:46 +02:00
out2+=("^sep($TEXTALIGN)")
[[ "$TXTJUST" = left ]] && out2+=("<big>綠 </big> $LEFT,obtctl textjustify left;$me")||out2+=("<big>祿 </big> $LEFT,obtctl textjustify left;$me")
[[ "$TXTJUST" = center ]] && out2+=("<big>綠 </big> $CENTER,obtctl textjustify center;$me")||out2+=("<big>祿 </big> $CENTER,obtctl textjustify center;$me")
[[ "$TXTJUST" = right ]] && out2+=("<big>綠 </big> $RIGHT,obtctl textjustify right;$me")||out2+=("<big>祿 </big> $RIGHT,obtctl textjustify right;$me")
out2+=("^sep()")
out2+=("$SHADOW,^checkout(shadow)")
2022-05-15 03:25:01 +02:00
out2+=("^tag(shadow)")
2022-08-27 16:36:46 +02:00
out2+=("^sep($SHADOW)")
out2+=("$NOSHADOW,obtctl shadow 0;$me")
2022-05-15 03:25:01 +02:00
out2+=("^sep()")
2022-08-27 16:36:46 +02:00
out2+=("$DARK,obtctl shadow 1;$me")
out2+=("$LIGHT,obtctl shadow 2;$me")
2022-05-15 03:25:01 +02:00
#PADDING
out2+=("^tag(padding)")
2022-08-27 16:36:46 +02:00
out2+=("^sep($VERTICAL)")
2022-05-15 03:25:01 +02:00
out2+=("0,obtctl paddingHeight 0;$me")
out2+=("^sep()")
out2+=("1,obtctl paddingHeight 1;$me")
out2+=("2,obtctl paddingHeight 2;$me")
out2+=("3,obtctl paddingHeight 3;$me")
out2+=("4,obtctl paddingHeight 4;$me")
out2+=("5,obtctl paddingHeight 5;$me")
out2+=("6,obtctl paddingHeight 6;$me")
out2+=("8,obtctl paddingHeight 8;$me")
out2+=("10,obtctl paddingHeight 10;$me")
2022-09-19 20:59:26 +02:00
out2+=("12,obtctl paddingHeight 12;$me")
out2+=("16,obtctl paddingHeight 16;$me")
out2+=("20,obtctl paddingHeight 20;$me")
2022-08-27 16:36:46 +02:00
out2+=("^sep($HORIZONTAL)")
2022-05-15 03:25:01 +02:00
out2+=("0,obtctl paddingWidth 0;$me")
out2+=("^sep()")
out2+=("1,obtctl paddingWidth 1;$me")
out2+=("2,obtctl paddingWidth 2;$me")
out2+=("3,obtctl paddingWidth 3;$me")
out2+=("4,obtctl paddingWidth 4;$me")
out2+=("5,obtctl paddingWidth 5;$me")
2022-09-19 20:59:26 +02:00
out2+=("6,obtctl paddingWidth 6;$me")
out2+=("8,obtctl paddingWidth 8;$me")
out2+=("10,obtctl paddingWidth 10;$me")
out2+=("12,obtctl paddingWidth 12;$me")
out2+=("16,obtctl paddingWidth 16;$me")
out2+=("20,obtctl paddingWidth 20;$me")
2022-05-15 03:25:01 +02:00
#BORDER
out2+=("^tag(border)")
2022-08-27 16:36:46 +02:00
out2+=("^sep($BORDER)")
2022-05-15 03:25:01 +02:00
out2+=("0,obtctl borderWidth 0;$me")
out2+=("^sep()")
out2+=("1,obtctl borderWidth 1;$me")
out2+=("2,obtctl borderWidth 2;$me")
out2+=("3,obtctl borderWidth 3;$me")
out2+=("4,obtctl borderWidth 4;$me")
out2+=("5,obtctl borderWidth 5;$me")
2022-09-19 20:59:26 +02:00
out2+=("6,obtctl borderWidth 6;$me")
out2+=("8,obtctl borderWidth 8;$me")
out2+=("10,obtctl borderWidth 10;$me")
out2+=("12,obtctl borderWidth 12;$me")
out2+=("16,obtctl borderWidth 16;$me")
out2+=("20,obtctl borderWidth 20;$me")
2023-09-23 13:57:32 +02:00
2022-05-15 03:25:01 +02:00
#GRADIENT
out2+=("^tag(gradient)")
2022-08-27 16:36:46 +02:00
out2+=("^sep($GRADIENT_TYPE)")
2023-09-23 13:57:32 +02:00
[[ "$GRAD" == Solid ]] && out2+=("<big>綠</big> $SOLID_COLOR,obtctl gradient_type solid;$me") || out2+=("<big>祿</big> $SOLID_COLOR,obtctl gradient_type solid;$me")
2022-05-15 03:25:01 +02:00
out2+=("^sep()")
2023-09-23 13:57:32 +02:00
[[ "$GRAD" == Vertical ]] && out2+=("<big>綠</big> $VERTICAL,obtctl gradient_type vertical;$me") || out2+=("<big>祿</big> $VERTICAL,obtctl gradient_type vertical;$me")
[[ "$GRAD" == Horizontal ]] && out2+=("<big>綠</big> $HORIZONTAL,obtctl gradient_type horizontal;$me") || out2+=("<big>祿</big> $HORIZONTAL,obtctl gradient_type horizontal;$me")
[[ "$GRAD" == MirrorHorizontal ]] && out2+=("<big>綠</big> $MIRRORHORIZONTAL,obtctl gradient_type mirrorhorizontal;$me") || out2+=("<big>祿</big> $MIRRORHORIZONTAL,obtctl gradient_type mirrorhorizontal;$me")
[[ "$GRAD" == SplitVertical ]] && out2+=("<big>綠</big> $SPLITVERTICAL,obtctl gradient_type splitvertical;$me") || out2+=("<big>祿</big> $SPLITVERTICAL,obtctl gradient_type splitvertical;$me")
[[ "$GRAD" == Diagonal ]] && out2+=("<big>綠</big> $DIAGONAL,obtctl gradient_type diagonal;$me") || out2+=("<big>祿</big> $DIAGONAL,obtctl gradient_type diagonal;$me")
[[ "$GRAD" == CrossDiagonal ]] && out2+=("<big>綠</big> $CROSSDIAGONAL,obtctl gradient_type crossdiagonal;$me") || out2+=("<big>祿</big> $CROSSDIAGONAL,obtctl gradient_type crossdiagonal;$me")
[[ "$GRAD" == Pyramid ]] && out2+=("<big>綠</big> $PYRAMID,obtctl gradient_type pyramid;$me") || out2+=("<big>祿</big> $PYRAMID,obtctl gradient_type pyramid;$me")
2022-06-03 19:43:56 +02:00
2022-05-15 03:25:01 +02:00
#HANDLE
2023-09-23 13:57:32 +02:00
#out2+=("^tag(handle)")
#out2+=("^sep($ACTIVEHANDLE)")
#out2+=("$NO,obtctl activehandle no;$me")
#out2+=("$YES,obtctl activehandle yes;$me")
#out2+=("$GRIPONLY,obtctl activehandle grip;$me")
#HANDLE WIDTH
2022-05-15 03:25:01 +02:00
out2+=("^tag(handlewidth)")
2022-08-27 16:36:46 +02:00
out2+=("^sep($HANDLEWIDTH)")
2022-05-15 03:25:01 +02:00
out2+=("0,obtctl handlewidth 0;$me")
out2+=("^sep()")
2023-09-23 13:57:32 +02:00
out2+=("1,obtctl handlewidth 1;$me")
2022-05-15 03:25:01 +02:00
out2+=("2,obtctl handlewidth 2;$me")
out2+=("3,obtctl handlewidth 3;$me")
out2+=("4,obtctl handlewidth 4;$me")
out2+=("6,obtctl handlewidth 6;$me")
out2+=("8,obtctl handlewidth 8;$me")
out2+=("10,obtctl handlewidth 10;$me")
else # Theme other than MBColors, we can only edit rc.xml
getvaluesrc
2022-08-27 16:36:46 +02:00
out+=("^sep($NOT_SUPORTED_OBTHEME)")
2023-08-02 01:34:04 +02:00
out+=("^sep(<small>$UNLOCK</small>)")
2022-08-27 16:36:46 +02:00
out+=("$SWITCH_TO_MBCOLORS,obtctl theme MBcolors;$me")
out+=("^sep($TITLEBAR_FONT)")
out+=("$FONT... [ <b> ${FNAME} ${FSIZE} </b> ],mb-setfont obtitle;$me")
out+=("^sep(font family)")
2023-08-20 09:07:52 +02:00
if [ -f "$HOME/.config/mabox/fonts.list" ];then
mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list)
else
mapfile -t favfonts < <( grep -vE "^($|#)" /usr/share/mabox-colorizer/fonts.list)
cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/
fi
if [ "${#favfonts[@]}" -gt 0 ];then
for fon in "${favfonts[@]}";do
[[ "${FNAME}" == "$fon" ]] && out+=("<big>綠</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out+=("<big>祿</big> <span font_family=\"${fon}\">${fon}</span>,obtctl fontfamily \"${fon}\";$me")
done
fi
out+=("^sep()")
[[ "$WEIGHT" =~ .*"old" ]] && out+=("<big></big> <b>$BOLD</b>,obtctl fontweight Normal;$me") || out+=("<big></big> <b>$BOLD</b>,obtctl fontweight Bold;$me")
[[ "$SLANT" =~ .*"talic" ]] && out+=("<big></big> <i>$ITALIC</i>,obtctl fontslant Normal;$me") || out+=("<big></big> <i>$ITALIC</i>,obtctl fontslant Italic;$me")
out+=("^sep()")
out+=("$FONTSIZE [ <b>$FSIZE px</b> ],^checkout(obfsize)")
out2+=("^tag(obfsize)")
out2+=("^sep($FONTSIZE)")
2023-08-20 09:07:52 +02:00
sizes=(16 15 14 13 12 11 10 9 8)
for i in "${sizes[@]}"
do
[[ "$FSIZE" == "$i" ]] && out2+=("<big>綠</big> <b>$i px</b>,obtctl fontsize $i;$me") || out2+=("<big>祿</big> $i px,obtctl fontsize $i;$me")
done
out+=("^sep($BUTTONS_LAYOUT)")
[[ "$NDSLIMC" == NDSLIMC ]] && out+=("<big>綠</big> <tt>full </tt> <b>NDSLIMC</b> (default),obtctl ndslimc NDSLIMC;$me") || out+=("<big>祿</big> <tt>full </tt> <b>NDSLIMC</b> (default),obtctl ndslimc NDSLIMC;$me")
[[ "$NDSLIMC" == NLIMC ]] && out+=("<big>綠</big> <tt>mini </tt> <b>NLIMC</b>,obtctl ndslimc NLIMC;$me") || out+=("<big>祿</big> <tt>mini </tt> <b>NLIMC</b>,obtctl ndslimc NLIMC;$me")
[[ "$NDSLIMC" == LIMC ]] && out+=("<big>綠</big> <tt>mini (no icon)</tt> <b>LIMC</b>,obtctl ndslimc LIMC;$me") || out+=("<big>祿</big> <tt>mini (no icon)</tt> <b>LIMC</b>,obtctl ndslimc LIMC;$me")
[[ "$NDSLIMC" == CMIL ]] && out+=("<big>綠</big> <tt>crazy </tt> <b>CMIL</b>,obtctl ndslimc CMIL;$me") || out+=("<big>祿</big> <tt>crazy </tt> <b>CMIL</b>,obtctl ndslimc CMIL;$me")
out+=("^sep(<small>$LEGEND</small>)")
out+=("^sep(N:<small> Window icon</small>)")
out+=("^sep(L:<small> Window label (Title)</small>)")
out+=("^sep(I:<small> Iconify (Minimize)</small>)")
out+=("^sep(M:<small> Maximize</small>)")
out+=("^sep(C:<small> Close</small>)")
out+=("^sep(S:<small> Shade (Roll up)</small>)")
out+=("^sep(D:<small> Omnipresent (On all desktops)</small>)")
2022-05-15 03:25:01 +02:00
fi
### RUN
if [[ "$1" == "-s" ]]; then
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
. $HOME/.config/mabox/mabox.conf
2022-08-16 16:50:11 +02:00
source $HOME/.config/colorizer/colorizer.conf
2022-05-15 03:25:01 +02:00
out+=("^sep()")
2023-09-06 16:13:11 +02:00
out+=(" ${arrow_string_left} $_COLORIZER_ROOT,colorizer -s")
2022-05-15 03:25:01 +02:00
2022-08-16 16:50:11 +02:00
if [[ "$colorizer_size" == "full" ]];then
eval $(xdotool getdisplaygeometry --shell)
MENU_HEIGHT_MIN="$HEIGHT"
MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN
2022-12-03 18:44:36 +01:00
jgtools_radius=0
2022-08-16 16:50:11 +02:00
menu_margin_x="0"
else
2022-05-15 03:25:01 +02:00
MENU_VALIGN="center"
2022-08-16 16:50:11 +02:00
menu_margin_x=${submenu_spacing:-0}
fi
2022-05-15 03:25:01 +02:00
MENU_PADDING_TOP=${jgtools_padding:-0}
MENU_HALIGN="left"
jgmenu_icon_size=0
JGWIDTH=40
2022-08-16 16:50:11 +02:00
2022-05-15 03:25:01 +02:00
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
[ -z $jgmenu_use_borders ] && menu_border=0
2023-09-05 17:18:04 +02:00
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 150))
2022-05-15 03:25:01 +02:00
# WALLPAPER IMAGE
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
THUMBDIR="$HOME/.cache/colorizer/thumbs"
mkdir -p ${THUMBDIR}
NAME=${WALLPATH////_}
if [[ "${NAME}" =~ ^_home_.* ]]; then
n=${#HOME}
((n++))
NAME=${NAME:${n}}
fi
THUMB="${THUMBDIR}/${NAME}.png"
if [[ ! -f "$THUMB" ]]
then
2022-05-15 03:25:01 +02:00
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
fi
2022-05-15 03:25:01 +02:00
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
2023-09-05 17:18:04 +02:00
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-ob.png
@rect,,$((jgtools_padding)),$((jgtools_padding + 124)),270,22,0,left,top,#222222 20,#222222 70,
@text,,$((jgtools_padding + 138)),$((jgtools_padding + 120)),130,30,0,left,top,#FFFFFF ,${WINCLR},<span size='10400' font_family='Ubuntu'><b>Colorizer</b> Openbox</span>
2022-05-15 03:25:01 +02:00
$(printf '%s\n' "${out[@]}")
$(printf '%s\n' "${out2[@]}")
2023-09-23 13:57:32 +02:00
$(printf '%s\n' "${out3[@]}")
2022-05-15 03:25:01 +02:00
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
exit 0
fi
printf '%s\n' "${out[@]}"
printf '%s\n' "${out2[@]}"
2023-09-23 13:57:32 +02:00
printf '%s\n' "${out3[@]}"