glyphicons

This commit is contained in:
2026-04-13 11:33:17 +02:00
parent eb758ac162
commit 7093630d54
3 changed files with 141 additions and 162 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
#
# colorizer - set of tools for Mabox (auto)theming
# Copyright (C) 2022-2023 Daniel Napora <napcok@gmail.com>
# Copyright (C) 2022-2026 Daniel Napora <danieln@maboxlinux.org>
#
# 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
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. /usr/share/mb-jgtools/jgtools.inc
SYSSCHEMES="/usr/share/mabox-colorizer/colorschemes/menus.csv"
@@ -41,17 +42,18 @@ mapfile -t w < "$WALLPALDIR/$NAME.clr"
me="colorizer-menus -s"
. $HOME/.config/mabox/mabox.conf
case "$jgmenu_theme" in
obtheme)
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");
#echo "$OBTHEME"
THEMERC="$HOME/.config/mabox/jgobthemes/${OBTHEME}.colorrc"
jgmenu_theme="$OBTHEME";; #only to show real theme name in menu
*)
THEMERC="$HOME/.config/mabox/jgobthemes/${jgmenu_theme}.colorrc";;
esac
#. $HOME/.config/mabox/mabox.conf
#case "$jgmenu_theme" in
# obtheme)
# 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");
# #echo "$OBTHEME"
# THEMERC="$HOME/.config/mabox/jgobthemes/${OBTHEME}.colorrc"
# jgmenu_theme="$OBTHEME";; #only to show real theme name in menu
# *)
# THEMERC="$HOME/.config/mabox/jgobthemes/${jgmenu_theme}.colorrc";;
#esac
THEMERC="$HOME/.config/mabox/jgobthemes/MBcolors.colorrc"
GRADIENT_FILE="$HOME"/.config/colorizer/gradients_menu.inc
@@ -291,19 +293,19 @@ out+=("<big></big> $QUICK_TWEAKS,^checkout(tweaks)")
out3+=("^tag(mborder)")
out3+=("^sep($BORDER)")
for i in 0 1 2 3 4 5 6 8 10 12; do [[ "$jgtools_border" == $i ]] && out3+=("<big></big> $(printf "<b><tt>%3s</tt></b>,%s" "$i" "jgctl border ${i}")") || out3+=("<big></big> $(printf "<tt>%3s</tt>,%s" "$i" "jgctl border ${i}")");done
for i in 0 1 2 3 4 5 6 8 10 12; do [[ "$jgtools_border" == $i ]] && out3+=("<big>${ron}</big> $(printf "<b><tt>%3s</tt></b>,%s" "$i" "jgctl border ${i}")") || out3+=("<big>${roff}</big> $(printf "<tt>%3s</tt>,%s" "$i" "jgctl border ${i}")");done
out3+=("^tag(mpadding)")
out3+=("^sep($PADDING)")
for i in 0 2 4 6 8 10 12 14 16 18 20 22 24 28 32 40; do [[ "$jgtools_padding" == $i ]] && out3+=("<big></big> $(printf "<b><tt>%3s</tt></b>,%s" "$i" "jgctl padding ${i}")") || out3+=("<big></big> $(printf "<tt>%3s</tt>,%s" "$i" "jgctl padding ${i}")");done
for i in 0 2 4 6 8 10 12 14 16 18 20 22 24 28 32 40; do [[ "$jgtools_padding" == $i ]] && out3+=("<big>${ron}</big> $(printf "<b><tt>%3s</tt></b>,%s" "$i" "jgctl padding ${i}")") || out3+=("<big>${roff}</big> $(printf "<tt>%3s</tt>,%s" "$i" "jgctl padding ${i}")");done
out3+=("^tag(subspacing)")
out3+=("^sep($SUBSPACING)")
for i in -20 -12 -10 -8 -6 -4 -2 0 1 2 4 6 8 10 12 14 16 18 20; do [[ "$submenu_spacing" == $i ]] && out3+=("<big></big> $(printf "<b><tt>%4s</tt></b>,%s" "$i" "mb-setvar submenu_spacing=${i};$me")") || out3+=("<big></big> $(printf "<tt>%4s</tt>,%s" "$i" "mb-setvar submenu_spacing=${i};$me")");done
for i in -20 -12 -10 -8 -6 -4 -2 0 1 2 4 6 8 10 12 14 16 18 20; do [[ "$submenu_spacing" == $i ]] && out3+=("<big>${ron}</big> $(printf "<b><tt>%4s</tt></b>,%s" "$i" "mb-setvar submenu_spacing=${i};$me")") || out3+=("<big>${roff}</big> $(printf "<tt>%4s</tt>,%s" "$i" "mb-setvar submenu_spacing=${i};$me")");done
out3+=("^tag(lineheight)")
out3+=("^sep($LINE_HEIGHT)")
for i in 160 180 200 220 240 280 300; do [[ "$item_height_factor" == $i ]] && out3+=("<big></big> $(printf "<b><tt>%4s%%</tt></b>,%s" "$i" "mb-setvar item_height_factor=${i};$me")") || out3+=("<big></big> $(printf "<tt>%4s%%</tt>,%s" "$i" "mb-setvar item_height_factor=${i};$me")");done
for i in 160 180 200 220 240 280 300; do [[ "$item_height_factor" == $i ]] && out3+=("<big>${ron}</big> $(printf "<b><tt>%4s%%</tt></b>,%s" "$i" "mb-setvar item_height_factor=${i};$me")") || out3+=("<big>${roff}</big> $(printf "<tt>%4s%%</tt>,%s" "$i" "mb-setvar item_height_factor=${i};$me")");done
out3+=("^tag(arrow)")
out3+=("^sep($ARROW_STRING)")
@@ -361,14 +363,14 @@ out+=("<big><span bgcolor='${MBG}'> <span fgcolor='${TBG}'></span> <span fgco
((n=n+1))
case "$grad" in
none)icon="󰄱";;
top)icon="";;
right)icon="";;
bottom)icon="";;
left)icon="";;
top_left)icon="";;
top_right)icon="";;
bottom_left)icon="";;
bottom_right)icon="";;
top)icon="";;
right)icon="";;
bottom)icon="";;
left)icon="";;
top_left)icon="";;
top_right)icon="";;
bottom_left)icon="";;
bottom_right)icon="";;
esac
out2+=("<tt>$(printf '%-20s' "${scheme_name}")</tt><big><span bgcolor='${mbg}' fgcolor='${nfg}'> <small>item</small> <span bgcolor='${tbg}' fgcolor='${tfg}'> <small><b>title</b></small> </span> <span bgcolor='${sbg}' fgcolor='${sfg}'> <small>[ sel ]</small> </span> <span bgcolor='${mbgt}'> <small>${icon}</small> </span></span></big>,jgctl applyscheme sys $n;$me")
done < <(tail -n +2 "$SYSSCHEMES")
@@ -383,14 +385,14 @@ out+=("<big><span bgcolor='${MBG}'> <span fgcolor='${TBG}'></span> <span fgco
((n=n+1))
case "$grad" in
none)icon="󰄱";;
top)icon="";;
right)icon="";;
bottom)icon="";;
left)icon="";;
top_left)icon="";;
top_right)icon="";;
bottom_left)icon="";;
bottom_right)icon="";;
top)icon="";;
right)icon="";;
bottom)icon="";;
left)icon="";;
top_left)icon="";;
top_right)icon="";;
bottom_left)icon="";;
bottom_right)icon="";;
esac
out2+=("<tt>$(printf '%-20s' "${scheme_name}")</tt><big><span bgcolor='${mbg}' fgcolor='${nfg}'> <small>item</small> <span bgcolor='${tbg}' fgcolor='${tfg}'> <small><b>title</b></small> </span> <span bgcolor='${sbg}' fgcolor='${sfg}'> <small>[ sel ]</small> </span> <span bgcolor='${mbgt}'> <small>${icon}</small> </span></span></big>,^checkout(sch${n})")
out3+=("^tag(sch${n}")
@@ -412,14 +414,14 @@ out+=("^sep()")
case "$GRADIENT" in
none)icon="󰄱";;
top)icon="";;
right)icon="";;
bottom)icon="";;
left)icon="";;
top_left)icon="";;
top_right)icon="";;
bottom_left)icon="";;
bottom_right)icon="";;
top)icon="";;
right)icon="";;
bottom)icon="";;
left)icon="";;
top_left)icon="";;
top_right)icon="";;
bottom_left)icon="";;
bottom_right)icon="";;
esac
out+=("<big>$icon</big> $GRADIENT_POS [ <b>$icon</b> ],^checkout(gradientpos)")
@@ -464,9 +466,9 @@ out+=("<tt><small>$(printf '%3s' "$TBORDERA")</small> <span bgcolor='$TBORDER' b
out+=("^sep()")
case "$SEPHALIGN" in
left) icon="";;
center) icon="";;
right) icon="";;
left) icon="";;
center) icon="";;
right) icon="";;
esac
out+=("<big>$icon</big> $SEP_HALIGN [ <b>$SEPHALIGN</b> ],^checkout(sephalign)")
@@ -491,7 +493,7 @@ out+=("<big>󰛖</big> $ITEM [ <b>$menu_font_family $menu_font_size</b> ],^che
sizes=(14 13 12 11 10 9 8)
for i in "${sizes[@]}"
do
[[ "$menu_font_size" == "$i" ]] && out2+=("<big></big> <b>$i px</b>,$me") || out2+=("<big></big> $i px,mb-setvar menu_font_size=$i;$me")
[[ "$menu_font_size" == "$i" ]] && out2+=("<big>${ron}</big> <b>$i px</b>,$me") || out2+=("<big>${roff}</big> $i px,mb-setvar menu_font_size=$i;$me")
done
if [ -f "$HOME/.config/mabox/fonts.list" ];then
@@ -504,7 +506,7 @@ out+=("<big>󰛖</big> $ITEM [ <b>$menu_font_family $menu_font_size</b> ],^che
if [ "${#favfonts[@]}" -gt 0 ];then
out2+=("^sep($FONT_FAMILY)")
for fon in "${favfonts[@]}";do
[[ "$menu_font_family" == "$fon" ]] && out2+=("<big></big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big></big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_font_family='${fon}'\";$me")
[[ "$menu_font_family" == "$fon" ]] && out2+=("<big>${ron}</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>${roff}</big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_font_family='${fon}'\";$me")
done
fi
@@ -519,13 +521,13 @@ out+=("<big>󰛖</big> $ITEM [ <b>$menu_font_family $menu_font_size</b> ],^che
sizes=(14 13 12 11 10 9 8)
for i in "${sizes[@]}"
do
[[ "$menu_sep_font_size" == "$i" ]] && out2+=("<big></big> <b>$i px</b>,$me") || out2+=("<big></big> $i px,mb-setvar menu_sep_font_size=$i;$me")
[[ "$menu_sep_font_size" == "$i" ]] && out2+=("<big>${ron}</big> <b>$i px</b>,$me") || out2+=("<big>${roff}</big> $i px,mb-setvar menu_sep_font_size=$i;$me")
done
if [ "${#favfonts[@]}" -gt 0 ];then
out2+=("^sep($FONT_FAMILY)")
for fon in "${favfonts[@]}";do
[[ "$menu_sep_font_family" == "$fon" ]] && out2+=("<big></big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big></big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_sep_font_family='${fon}'\";$me")
[[ "$menu_sep_font_family" == "$fon" ]] && out2+=("<big>${ron}</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>${roff}</big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_sep_font_family='${fon}'\";$me")
done
fi
@@ -536,36 +538,36 @@ out2+=("^tag(gradientpos)")
out2+=("^sep($GRADIENT_POS <small>$GRADIENT</small>)")
out2+=("󰄱 $NONE,jgctl menu_gradient_pos none;$me")
out2+=("^sep()")
out2+=(" $TOP,jgctl menu_gradient_pos top;$me")
out2+=(" $RIGHT,jgctl menu_gradient_pos right;$me")
out2+=(" $BOTTOM,jgctl menu_gradient_pos bottom;$me")
out2+=(" $LEFT,jgctl menu_gradient_pos left;$me")
out2+=(" $TOP_LEFT,jgctl menu_gradient_pos top_left;$me")
out2+=(" $TOP_RIGHT,jgctl menu_gradient_pos top_right;$me")
out2+=(" $BOTTOM_LEFT,jgctl menu_gradient_pos bottom_left;$me")
out2+=(" $BOTTOM_RIGHT,jgctl menu_gradient_pos bottom_right;$me")
out2+=(" $TOP,jgctl menu_gradient_pos top;$me")
out2+=(" $RIGHT,jgctl menu_gradient_pos right;$me")
out2+=(" $BOTTOM,jgctl menu_gradient_pos bottom;$me")
out2+=(" $LEFT,jgctl menu_gradient_pos left;$me")
out2+=(" $TOP_LEFT,jgctl menu_gradient_pos top_left;$me")
out2+=(" $TOP_RIGHT,jgctl menu_gradient_pos top_right;$me")
out2+=(" $BOTTOM_LEFT,jgctl menu_gradient_pos bottom_left;$me")
out2+=(" $BOTTOM_RIGHT,jgctl menu_gradient_pos bottom_right;$me")
out2+=("^tag(sephalign)")
out2+=("^sep($SEP_HALIGN)")
[[ "$SEPHALIGN" == "left" ]] && out2+=("<big></big> $H_LEFT,jgctl sep_halign left;$me") || out2+=("<big></big> $H_LEFT,jgctl sep_halign left;$me")
[[ "$SEPHALIGN" == "center" ]] && out2+=("<big></big> $H_CENTER,jgctl sep_halign center;$me") || out2+=("<big></big> $H_CENTER,jgctl sep_halign center;$me")
[[ "$SEPHALIGN" == "right" ]] && out2+=("<big></big> $H_RIGHT,jgctl sep_halign right;$me") || out2+=("<big></big> $H_RIGHT,jgctl sep_halign right;$me")
[[ "$SEPHALIGN" == "left" ]] && out2+=("<big>${ron}</big> <b>$H_LEFT</b>,jgctl sep_halign left;$me") || out2+=("<big>${roff}</big> $H_LEFT,jgctl sep_halign left;$me")
[[ "$SEPHALIGN" == "center" ]] && out2+=("<big>${ron}</big> <b>$H_CENTER</b>,jgctl sep_halign center;$me") || out2+=("<big>${roff}</big> $H_CENTER,jgctl sep_halign center;$me")
[[ "$SEPHALIGN" == "right" ]] && out2+=("<big>${ron}</big> <b>$H_RIGHT</b>,jgctl sep_halign right;$me") || out2+=("<big>${roff}</big> $H_RIGHT,jgctl sep_halign right;$me")
out2+=("^tag(itemborder_radius)")
out2+=("^sep($ITEM_BORDER)")
[[ "$IBORDER" == 0 ]] && out2+=("<big></big> 0 px,jgctl item_border 0;$me") || out2+=("<big></big> 0 px,jgctl item_border 0;$me")
[[ "$IBORDER" == 0 ]] && out2+=("<big>${ron}</big> <b>0 px</b>,jgctl item_border 0;$me") || out2+=("<big>${roff}</big> 0 px,jgctl item_border 0;$me")
out2+=("^sep()")
[[ "$IBORDER" == 1 ]] && out2+=("<big></big> 1 px,jgctl item_border 1;$me") || out2+=("<big></big> 1 px,jgctl item_border 1;$me")
[[ "$IBORDER" == 2 ]] && out2+=("<big></big> 2 px,jgctl item_border 2;$me") || out2+=("<big></big> 2 px,jgctl item_border 2;$me")
[[ "$IBORDER" == 1 ]] && out2+=("<big>${ron}</big> <b>1 px</b>,jgctl item_border 1;$me") || out2+=("<big>${roff}</big> 1 px,jgctl item_border 1;$me")
[[ "$IBORDER" == 2 ]] && out2+=("<big>${ron}</big> <b>2 px</b>,jgctl item_border 2;$me") || out2+=("<big>${roff}</big> 2 px,jgctl item_border 2;$me")
out2+=("^sep($ITEM_RADIUS)")
[[ "$IRADIUS" == 0 ]] && out2+=("<big></big> 0 px,jgctl item_radius 0;$me") || out2+=("<big></big> 0 px,jgctl item_radius 0;$me")
[[ "$IRADIUS" == 0 ]] && out2+=("<big>${ron}</big> <b>0 px</b>,jgctl item_radius 0;$me") || out2+=("<big>${roff}</big> 0 px,jgctl item_radius 0;$me")
out2+=("^sep()")
[[ "$IRADIUS" == 1 ]] && out2+=("<big></big> 1 px,jgctl item_radius 1;$me") || out2+=("<big></big> 1 px,jgctl item_radius 1;$me")
[[ "$IRADIUS" == 2 ]] && out2+=("<big></big> 2 px,jgctl item_radius 2;$me") || out2+=("<big></big> 2 px,jgctl item_radius 2;$me")
[[ "$IRADIUS" == 3 ]] && out2+=("<big></big> 3 px,jgctl item_radius 3;$me") || out2+=("<big></big> 3 px,jgctl item_radius 3;$me")
[[ "$IRADIUS" == 4 ]] && out2+=("<big></big> 4 px,jgctl item_radius 4;$me") || out2+=("<big></big> 4 px,jgctl item_radius 4;$me")
[[ "$IRADIUS" == 5 ]] && out2+=("<big></big> 5 px,jgctl item_radius 5;$me") || out2+=("<big></big> 5 px,jgctl item_radius 5;$me")
[[ "$IRADIUS" == 6 ]] && out2+=("<big></big> 6 px,jgctl item_radius 6;$me") || out2+=("<big></big> 6 px,jgctl item_radius 6;$me")
[[ "$IRADIUS" == 1 ]] && out2+=("<big>${ron}</big> <b>1 px</b>,jgctl item_radius 1;$me") || out2+=("<big>${roff}</big> 1 px,jgctl item_radius 1;$me")
[[ "$IRADIUS" == 2 ]] && out2+=("<big>${ron}</big> <b>2 px</b>,jgctl item_radius 2;$me") || out2+=("<big>${roff}</big> 2 px,jgctl item_radius 2;$me")
[[ "$IRADIUS" == 3 ]] && out2+=("<big>${ron}</big> <b>3 px</b>,jgctl item_radius 3;$me") || out2+=("<big>${roff}</big> 3 px,jgctl item_radius 3;$me")
[[ "$IRADIUS" == 4 ]] && out2+=("<big>${ron}</big> <b>4 px</b>,jgctl item_radius 4;$me") || out2+=("<big>${roff}</big> 4 px,jgctl item_radius 4;$me")
[[ "$IRADIUS" == 5 ]] && out2+=("<big>${ron}</big> <b>5 px</b>,jgctl item_radius 5;$me") || out2+=("<big>${roff}</big> 5 px,jgctl item_radius 5;$me")
[[ "$IRADIUS" == 6 ]] && out2+=("<big>${ron}</big> <b>6 px</b>,jgctl item_radius 6;$me") || out2+=("<big>${roff}</big> 6 px,jgctl item_radius 6;$me")
#out+=("^sep($MORE_MENU_SETTINGS)")
@@ -574,8 +576,6 @@ out2+=("^sep()")
### RUN
if [[ "$1" == "-s" ]]; then
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
. $HOME/.config/mabox/mabox.conf
CNF_DIR="$HOME/.config/colorizer"
CNF_FILE="$CNF_DIR/colorizer.conf"