Openbox save/restore theme/colorscheme
This commit is contained in:
parent
106b6909d9
commit
05a80516b6
@ -63,8 +63,9 @@ case "$LANG" in
|
||||
CURRENTCONF="Obecna konfiguracja"
|
||||
MODULES="Moduły"
|
||||
FONTS="Konfiguruj <b>Czcionki</b>"
|
||||
OBTHEME="Motyw Openbox"
|
||||
MENUPANELS="Menu i Panele"
|
||||
OBTHEME="Motyw <b>Openbox</b>"
|
||||
MENUPANELS="<b>Menu</b> i Panele boczne"
|
||||
COLORIZER_CONKY="<b>Conky</b> Manager i Colorizer"
|
||||
CAVA="Cava - wizualizacja dźwięku"
|
||||
TERMINALTHEME="Motyw terminala"
|
||||
WALLCOLORS="Kolory z tapety"
|
||||
@ -160,8 +161,9 @@ case "$LANG" in
|
||||
CURRENTCONF="Current configuration"
|
||||
MODULES="Modules"
|
||||
FONTS="Configure <b>Fonts</b>"
|
||||
OBTHEME="Openbox Theme"
|
||||
MENUPANELS="Menus/Panels"
|
||||
OBTHEME="<b>Openbox</b> Theme"
|
||||
MENUPANELS="<b>Menus/SidePanels</b>"
|
||||
COLORIZER_CONKY="<b>Conky</b> Manager & Colorizer"
|
||||
CAVA="Cava - Audio Visualizer"
|
||||
TERMINALTHEME="Terminal color scheme"
|
||||
WALLCOLORS="Wallpaper Colors"
|
||||
@ -307,7 +309,7 @@ out+=("$OBTHEME,colorizer-ob -s")
|
||||
|
||||
#out+=("TINT2,^pipe(colorizer-tint2)")
|
||||
out+=("$MENUPANELS,colorizer-menus -s")
|
||||
out+=("Conky Manager,colorizer-conky -s")
|
||||
out+=("$COLORIZER_CONKY,colorizer-conky -s")
|
||||
out+=("^sep()")
|
||||
#out+=("Systray HW monitor,^pipe(colorizer-phwmon)")
|
||||
|
||||
|
@ -506,7 +506,7 @@ if [[ "$1" == "-s" ]]; then
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
||||
@rect,,$((jgtools_padding)),$((jgtools_padding + 112)),270,34,0,left,top,#222222 20,#222222 70,
|
||||
@rect,,$((jgtools_padding)),$((jgtools_padding + 116)),270,28,0,left,top,#222222 20,#222222 70,
|
||||
#@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-conky.png
|
||||
@text,,$((jgtools_padding + 80)),$((jgtools_padding + 116)),190,30,0,left,top,#FFFFFF ,${WINCLR},<span size='10400' font_family='Ubuntu'><b>Conky</b> Manager & Colorizer</span>
|
||||
@rect,,$((jgtools_padding + 239)),$((jgtools_padding + 2)),29,60,0,left,top,#FFFFFF 30,${WINCLR} 60,
|
||||
|
@ -263,7 +263,7 @@ if [ ! -f "$USERSCHEMES" ]; then
|
||||
fi
|
||||
|
||||
out+=("^sep($MENU_THEME: <i>${jgmenu_theme}</i>)")
|
||||
out+=("$QUICK_TWEAKS,^checkout(tweaks)")
|
||||
out+=("<big></big> $QUICK_TWEAKS,^checkout(tweaks)")
|
||||
|
||||
out2+=("^tag(tweaks)")
|
||||
out2+=("^sep($OVERALL_STYLE)")
|
||||
@ -462,7 +462,7 @@ case "$GRADIENT" in
|
||||
esac
|
||||
|
||||
out+=("<big>$icon</big> $GRADIENT_POS [ <b>$GRADIENT</b> ],^checkout(gradientpos)")
|
||||
out+=("<big>凌</big> $GRADIENT_REVERSE,jgctl gradient '${MBGT}' '${MBG}';$me")
|
||||
out+=("<big></big> $GRADIENT_REVERSE,jgctl gradient '${MBGT}' '${MBG}';$me")
|
||||
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 menu)")
|
||||
|
||||
### TITLE/SEPARATOR
|
||||
|
239
bin/colorizer-ob
239
bin/colorizer-ob
@ -20,6 +20,26 @@ MBCOLORSDIR="$HOME"/.themes/MBcolors/openbox-3/
|
||||
GRADIENT_FILE="$HOME"/.config/colorizer/gradients_all.inc
|
||||
MORE_GRADIENT_FILE="$HOME"/.config/colorizer/gradients_menu.inc
|
||||
|
||||
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"
|
||||
|
||||
|
||||
if [ ! -f "$GRADIENT_FILE" ]; then
|
||||
cp /usr/share/mabox-colorizer/gradients.inc "$GRADIENT_FILE"
|
||||
fi
|
||||
@ -37,14 +57,30 @@ me="colorizer-ob -s"
|
||||
|
||||
case "$LANG" in
|
||||
pl*)
|
||||
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"
|
||||
OBTHEME_LBL="Motyw OpenBox"
|
||||
GENERATEFROMWP="Generuj z kolorów tapety..."
|
||||
LIGHTBG="Jasne"
|
||||
DARKBG="Ciemne"
|
||||
LIGHTBG=" Jasne tło"
|
||||
DARKBG="Ciemne tło"
|
||||
TITLEBAR="Pasek tytułowy"
|
||||
ACTIVE_WINDOW="Aktywne okno"
|
||||
INACTIVE_WINDOW="Nieaktywne okno"
|
||||
TITLEBAR_FONT="Czcionka"
|
||||
ACTIVE_BG="Tło aktywnego okna"
|
||||
INACTIVE_BG="Tło nieaktywnego okna"
|
||||
TEXT_COLOR="Kolor tekstu"
|
||||
TITLEBAR_TEXT="Tekst paska tytułowego"
|
||||
FONT="Czcionka"
|
||||
FONTSIZE="Rozmiar czcionki"
|
||||
@ -71,7 +107,7 @@ case "$LANG" in
|
||||
FLAT="płaski - <b>flat</b>"
|
||||
RAISED="uniesiony - <b>raised</b>"
|
||||
SUNKEN="wklęsły - <b>sunken</b>"
|
||||
BUTTONS="Przyciski"
|
||||
BUTTONS_LBL="Przyciski"
|
||||
BUTTONS_LAYOUT="Układ przycisków"
|
||||
LEGEND="Legenda"
|
||||
GRADIENT_TYPE="Typ Gradientu"
|
||||
@ -103,13 +139,29 @@ case "$LANG" in
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> - menu główne"
|
||||
;;
|
||||
*)
|
||||
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"
|
||||
OBTHEME_LBL="OpenBox theme"
|
||||
GENERATEFROMWP="Generate from wallpaper colors..."
|
||||
LIGHTBG="Light"
|
||||
DARKBG="Dark"
|
||||
LIGHTBG="Light Background"
|
||||
DARKBG="Dark Background"
|
||||
TITLEBAR="Title Bar"
|
||||
ACTIVE_WINDOW="Active Window"
|
||||
INACTIVE_WINDOW="Inactive Window"
|
||||
ACTIVE_BG="Active Background"
|
||||
INACTIVE_BG="Inactive Background"
|
||||
TEXT_COLOR="Text color"
|
||||
TITLEBAR_TEXT="Title Bar Text"
|
||||
TITLEBAR_FONT="Title Bar Font"
|
||||
FONT="Font"
|
||||
@ -137,7 +189,7 @@ case "$LANG" in
|
||||
FLAT="flat"
|
||||
RAISED="raised"
|
||||
SUNKEN="sunken"
|
||||
BUTTONS="Buttons"
|
||||
BUTTONS_LBL="Buttons"
|
||||
BUTTONS_LAYOUT="Buttons Layout"
|
||||
LEGEND="Legend"
|
||||
GRADIENT_TYPE="Gradient type"
|
||||
@ -148,7 +200,7 @@ case "$LANG" in
|
||||
PYRAMID="Pyramid"
|
||||
SOLID_COLOR="Solid color (no gradient)"
|
||||
PRE_GRADIENTS="Predefined gradients"
|
||||
GRADIENT_REVERSE="Reverse Gradient"
|
||||
GRADIENT_REVERSE="Reverse Gradient Colors"
|
||||
ACTIVE_BG_TO="Active Background to"
|
||||
INACTIVE_BG_TO="Inactive Background to"
|
||||
BORDER="Window Border"
|
||||
@ -184,7 +236,27 @@ getvalues () {
|
||||
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)"
|
||||
read WINRAISED REST <<< "$(grep .title.bg: ${THEMERC} | cut -d':' -f2)"
|
||||
#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"
|
||||
@ -241,39 +313,109 @@ if [[ -f "$THEMERC" ]] && [[ "$OBTHEME" = "MBcolor"* ]]; then
|
||||
getvalues
|
||||
getvaluesrc
|
||||
|
||||
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
|
||||
|
||||
#out+=("^sep($OBTHEME_LBL: <i>$OBTHEME</i>)")
|
||||
|
||||
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")
|
||||
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")
|
||||
|
||||
|
||||
out+=("^sep($TITLEBAR)")
|
||||
out+=("<tt><span bgcolor='$ABG' fgcolor='$AFG'> <b>AbCd</b> </span></tt> $TITLEBAR_TEXT,^checkout(titletext)")
|
||||
out+=("<tt><span bgcolor='$ABG' fgcolor='$AFG'><small> </small></span></tt> $BUTTONS,^checkout(tbuttons)")
|
||||
out+=("^sep()")
|
||||
out+=("<tt><span bgcolor='$ABG'> </span></tt> $ACTIVE_BG,^pipe(mbclr '$ABG' obtctl clractivebg_only '${ACTIVE_BG}' '$me')")
|
||||
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')")
|
||||
[[ ! -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')")
|
||||
out+=("^sep()")
|
||||
|
||||
out+=("<tt><span bgcolor='$NBG'> </span></tt> $INACTIVE_BG,^pipe(mbclr '$NBG' obtctl clrnormalbg_only '${INACTIVE_BG}' '$me')")
|
||||
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')")
|
||||
[[ ! -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')")
|
||||
|
||||
out+=("^sep()")
|
||||
out+=("$PADDING [ <b>$PHEIGHT $PWIDTH</b> ],^checkout(padding)")
|
||||
out+=("\"\"\"$RAISED_OR_FLAT? [ <b>$WINRAISED</b> ]\"\"\",^checkout(raised)")
|
||||
out+=("<tt><span bgcolor='$NBG' fgcolor='$NFG'> <b>title</b> </span></tt> $TEXT_COLOR,^pipe(mbclr '$NFG' obtctl inactivetextcolor '${TEXT} ${INACTIVE_FG}' '$me')")
|
||||
|
||||
out+=("^sep(Gradient)")
|
||||
out+=("$GRADIENT_TYPE [ <b>${REST##* }</b> ],^checkout(gradient)")
|
||||
out+=("<big></big> $GRADIENT_TYPE [ <b>${GRAD}</b> ],^checkout(gradient)")
|
||||
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)")
|
||||
out+=("凌 $GRADIENT_REVERSE,obtctl activegradient '${ABGTO}' '${ABG}';$me")
|
||||
out+=("<big></big> $GRADIENT_REVERSE,obtctl activegradient '${ABGTO}' '${ABG}';$me")
|
||||
|
||||
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')")
|
||||
out+=("$BORDER [ <b>$BORD</b> ],^checkout(border)")
|
||||
out+=("<big></big> $BORDER [ <b>$BORD</b> ],^checkout(border)")
|
||||
out+=("$HANDLEWIDTH [ <b>$HANDLE</b> ],^checkout(handlewidth)")
|
||||
out+=("$ACTIVEHANDLE? [ <b>$AHANDLE</b> ],^checkout(handle)")
|
||||
#out+=("$ACTIVEHANDLE? [ <b>$AHANDLE</b> ],^checkout(handle)")
|
||||
|
||||
|
||||
|
||||
out+=("^sep(<i>$GENERATEFROMWP</i>)")
|
||||
out+=("$LIGHTBG,w2theme ob light;$me")
|
||||
out+=("$DARKBG,w2theme ob dark;$me")
|
||||
|
||||
if [ -f "${THEMERC}.bak" ]; then
|
||||
|
||||
@ -294,7 +436,7 @@ fi
|
||||
#done
|
||||
#TBUTTONS
|
||||
out2+=("^tag(tbuttons)")
|
||||
out2+=("^sep($BUTTONS)")
|
||||
out2+=("^sep($BUTTONS_LBL)")
|
||||
out2+=("Tiny,obtctl buttons tiny;$me")
|
||||
out2+=("Normal,obtctl buttons normal;$me")
|
||||
out2+=("Bold,obtctl buttons bold;$me")
|
||||
@ -322,11 +464,6 @@ out2+=("^sep($TEXTALIGN)")
|
||||
|
||||
#TEXT
|
||||
out2+=("^tag(titletext)")
|
||||
out2+=("^sep(TEXT_COLOR)")
|
||||
out2+=("<tt><span bgcolor='$ABG' fgcolor='$AFG'> <b>active title</b> </span></tt> $ACTIVE_FG,^pipe(mbclr '$AFG' obtctl activetextcolor '${TEXT} ${ACTIVE_FG}' '$me')")
|
||||
out2+=("<tt><span bgcolor='$NBG' fgcolor='$NFG'> <b>inactive title</b> </span></tt> $INACTIVE_FG,^pipe(mbclr '$NFG' obtctl inactivetextcolor '${TEXT} ${INACTIVE_FG}' '$me')")
|
||||
|
||||
|
||||
out2+=("^sep($TITLEBAR_FONT)")
|
||||
out2+=("$FONT... [ <b> ${FNAME} ${FSIZE} </b> ],mb-setfont obtitle;$me")
|
||||
out2+=("^sep($FONTSIZE)")
|
||||
@ -417,36 +554,32 @@ out2+=("10,obtctl borderWidth 10;$me")
|
||||
out2+=("12,obtctl borderWidth 12;$me")
|
||||
out2+=("16,obtctl borderWidth 16;$me")
|
||||
out2+=("20,obtctl borderWidth 20;$me")
|
||||
#RAISED
|
||||
out2+=("^tag(raised)")
|
||||
out2+=("\"\"\"^sep($RAISED_OR_FLAT?)\"\"\"")
|
||||
out2+=("$FLAT,obtctl raised 0;$me")
|
||||
out2+=("$RAISED,obtctl raised 1;$me")
|
||||
out2+=("$SUNKEN,obtctl raised 2;$me")
|
||||
|
||||
#GRADIENT
|
||||
out2+=("^tag(gradient)")
|
||||
out2+=("^sep($GRADIENT_TYPE)")
|
||||
out2+=("$SOLID_COLOR,obtctl gradient_type solid;$me")
|
||||
[[ "$GRAD" == Solid ]] && out2+=("<big>綠</big> $SOLID_COLOR,obtctl gradient_type solid;$me") || out2+=("<big>祿</big> $SOLID_COLOR,obtctl gradient_type solid;$me")
|
||||
out2+=("^sep()")
|
||||
out2+=("$VERTICAL,obtctl gradient_type vertical;$me")
|
||||
out2+=("$HORIZONTAL,obtctl gradient_type horizontal;$me")
|
||||
out2+=("$MIRRORHORIZONTAL,obtctl gradient_type mirrorhorizontal;$me")
|
||||
out2+=("$SPLITVERTICAL,obtctl gradient_type splitvertical;$me")
|
||||
out2+=("$DIAGONAL,obtctl gradient_type diagonal;$me")
|
||||
out2+=("$CROSSDIAGONAL,obtctl gradient_type crossdiagonal;$me")
|
||||
out2+=("$PYRAMID,obtctl gradient_type pyramid;$me")
|
||||
[[ "$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")
|
||||
|
||||
#HANDLE
|
||||
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
|
||||
#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
|
||||
out2+=("^tag(handlewidth)")
|
||||
out2+=("^sep($HANDLEWIDTH)")
|
||||
out2+=("0,obtctl handlewidth 0;$me")
|
||||
out2+=("^sep()")
|
||||
out2+=("1,obtctl handlewidth 1;$me")
|
||||
out2+=("2,obtctl handlewidth 2;$me")
|
||||
out2+=("3,obtctl handlewidth 3;$me")
|
||||
out2+=("4,obtctl handlewidth 4;$me")
|
||||
@ -560,6 +693,7 @@ cat <<EOF > ${MENU_ITEMS}
|
||||
@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>
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
@ -569,3 +703,4 @@ exit 0
|
||||
fi
|
||||
printf '%s\n' "${out[@]}"
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
|
229
bin/obtctl
229
bin/obtctl
@ -73,7 +73,7 @@ borderWidth () {
|
||||
sd "^border.width:.*$" "border.width: ${BWIDTH}" ${THEMERC}
|
||||
fi
|
||||
;;
|
||||
0|1|2|3|4|5|6|7|8)
|
||||
*)
|
||||
sd "^border.width:.*$" "border.width: $1" ${THEMERC}
|
||||
;;
|
||||
esac
|
||||
@ -179,14 +179,59 @@ random_gradient () {
|
||||
activegradient "$CLR" "$CLRTO"
|
||||
}
|
||||
activegradient () {
|
||||
#notify-send.sh "zmiennne obtctl" "${1} ${2}"
|
||||
# ACTIVE
|
||||
|
||||
# ACTIVE GRIP and HANDLE
|
||||
colorTo=$(pastel darken 0.1 "${1}"|pastel format hex)
|
||||
#activehandle?
|
||||
###read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
###read AHBG <<< "$(grep .active.handle.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
###if [ "$ABG" == "$AHBG" ];then
|
||||
|
||||
###fi
|
||||
sd "\.active.grip.bg.color:.*$" ".active.grip.bg.color: ${1}" ${THEMERC}
|
||||
sd "\.active.grip.bg.colorTo:.*$" ".active.grip.bg.colorTo: ${colorTo}" ${THEMERC}
|
||||
sd "^window.active.title.bg.color:.*$" "window.active.title.bg.color: ${1}" ${THEMERC}
|
||||
sd "\.active.border.color:.*$" ".active.border.color: ${1}" ${THEMERC}
|
||||
|
||||
sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${colorTo}" ${THEMERC}
|
||||
|
||||
|
||||
#sd "\.active.handle.bg.color:.*$" ".active.handle.bg.color: ${1}" ${THEMERC}
|
||||
sd "^window.active.title.bg.color:.*$" "window.active.title.bg.color: ${1}" ${THEMERC}
|
||||
sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${2}" ${THEMERC}
|
||||
|
||||
# Border color = active.title.bg.color (gradient start color)
|
||||
sd "\.active.border.color:.*$" ".active.border.color: $1" ${THEMERC}
|
||||
|
||||
#### INACTIVE
|
||||
icolor=$(pastel mix -s RGB -f 0.3 ${1} '#000000' |pastel format hex)
|
||||
icolorTo=$(pastel mix -s RGB -f 0.3 ${2} '#000000' |pastel format hex)
|
||||
|
||||
|
||||
sd "^window.inactive.title.bg.color:.*$" "window.inactive.title.bg.color: ${icolor}" ${THEMERC}
|
||||
sd "^window.inactive.title.bg.colorTo:.*$" "window.inactive.title.bg.colorTo: ${icolorTo}" ${THEMERC}
|
||||
# Border color = active.title.bg.color (gradient start color)
|
||||
sd "\.inactive.border.color:.*$" ".inactive.border.color: ${icolor}" ${THEMERC}
|
||||
|
||||
## INACTIVE GRIP and HANDLE
|
||||
#normalhandle?
|
||||
###read IBG <<< "$(grep .inactive.title.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
###read IHBG <<< "$(grep .inactive.handle.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
###if [ "$IBG" == "$IHBG" ];then
|
||||
sd "\.inactive.handle.bg.color:.*$" ".inactive.handle.bg.color: ${icolor}" ${THEMERC}
|
||||
sd "\.inactive.handle.bg.colorTo:.*$" ".inactive.handle.bg.colorTo: ${icolorTo}" ${THEMERC}
|
||||
###fi
|
||||
sd "\.inactive.grip.bg.color:.*$" ".inactive.grip.bg.color: ${icolor}" ${THEMERC}
|
||||
sd "\.inactive.grip.bg.colorTo:.*$" ".inactive.grip.bg.colorTo: ${icolorTo}" ${THEMERC}
|
||||
sd "^window.inactive.title.bg.color:.*$" "window.inactive.title.bg.color: ${icolor}" ${THEMERC}
|
||||
sd "\.inactive.border.color:.*$" ".inactive.border.color: ${icolor}" ${THEMERC}
|
||||
sd "^window.inactive.title.bg.colorTo:.*$" "window.inactive.title.bg.colorTo: ${icolorTo}" ${THEMERC}
|
||||
|
||||
## Active handle always have inactive colors
|
||||
sd "\.active.handle.bg.color:.*$" ".active.handle.bg.color: ${icolor}" ${THEMERC}
|
||||
sd "\.active.handle.bg.colorTo:.*$" ".active.handle.bg.colorTo: ${icolorTo}" ${THEMERC}
|
||||
|
||||
|
||||
# calculate color for title.fg and buttons
|
||||
TITLE_FG=$(pastel textcolor ${2}|pastel format hex)
|
||||
if [[ "${TITLE_FG}" == *"ffffff"* ]];then
|
||||
@ -207,10 +252,47 @@ activegradient () {
|
||||
shadow light
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
activegradient_reverse () {
|
||||
gradient () {
|
||||
sd "^window.active.title.bg.color:.*$" "window.active.title.bg.color: ${1}" ${THEMERC}
|
||||
sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${2}" ${THEMERC}
|
||||
# Border color = active.title.bg.color (gradient start color)
|
||||
sd "\.active.border.color:.*$" ".active.border.color: $1" ${THEMERC}
|
||||
|
||||
#### INACTIVE
|
||||
icolor=$(pastel darken 0.5 ${1}|pastel format hex)
|
||||
icolorTo=$(pastel darken 0.5 ${2}|pastel format hex)
|
||||
|
||||
sd "^window.inactive.title.bg.color:.*$" "window.inactive.title.bg.color: ${icolor}" ${THEMERC}
|
||||
sd "^window.inactive.title.bg.colorTo:.*$" "window.inactive.title.bg.colorTo: ${icolorTo}" ${THEMERC}
|
||||
# Border color = active.title.bg.color (gradient start color)
|
||||
sd "\.inactive.border.color:.*$" ".inactive.border.color: ${icolor}" ${THEMERC}
|
||||
|
||||
|
||||
|
||||
# calculate color for title.fg and buttons
|
||||
TITLE_FG=$(pastel textcolor ${2}|pastel format hex)
|
||||
if [[ "${TITLE_FG}" == *"ffffff"* ]];then
|
||||
TITLE_FG="#E5E5E5"
|
||||
else
|
||||
TITLE_FG="#222222"
|
||||
fi
|
||||
sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC}
|
||||
|
||||
# Button colors
|
||||
activebuttonscolors "${TITLE_FG}"
|
||||
# Shadow
|
||||
read SHADOW <<< "$(grep .active.label.text.font: ${THEMERC} | cut -d':' -f2| cut -d'=' -f2)"
|
||||
if [ "$SHADOW" == "y" ];then
|
||||
if [ "$TITLE_FG" == "#E5E5E5" ];then
|
||||
shadow dark
|
||||
else
|
||||
shadow light
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
gradient_reverse () {
|
||||
:
|
||||
}
|
||||
activehandle () {
|
||||
@ -305,39 +387,33 @@ clrnormalbg_only () {
|
||||
|
||||
clrnormalbg () {
|
||||
colorTo=$(pastel darken 0.1 "${1}"|pastel format hex)
|
||||
#normalhandle?
|
||||
read IBG <<< "$(grep .inactive.title.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
read IHBG <<< "$(grep .inactive.handle.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
if [ "$IBG" == "$IHBG" ];then
|
||||
sd "\.inactive.handle.bg.color:.*$" ".inactive.handle.bg.color: ${1}" ${THEMERC}
|
||||
sd "\.inactive.handle.bg.colorTo:.*$" ".inactive.handle.bg.colorTo: ${colorTo}" ${THEMERC}
|
||||
fi
|
||||
|
||||
###sd "\.inactive.handle.bg.color:.*$" ".inactive.handle.bg.color: ${1}" ${THEMERC}
|
||||
###sd "\.inactive.handle.bg.colorTo:.*$" ".inactive.handle.bg.colorTo: ${colorTo}" ${THEMERC}
|
||||
sd "\.handle.bg.color:.*$" ".handle.bg.color: ${1}" ${THEMERC}
|
||||
sd "\.handle.bg.colorTo:.*$" ".handle.bg.colorTo: ${colorTo}" ${THEMERC}
|
||||
|
||||
sd "\.inactive.grip.bg.color:.*$" ".inactive.grip.bg.color: ${1}" ${THEMERC}
|
||||
sd "\.inactive.grip.bg.colorTo:.*$" ".inactive.grip.bg.colorTo: ${colorTo}" ${THEMERC}
|
||||
sd "^window.inactive.title.bg.color:.*$" "window.inactive.title.bg.color: ${1}" ${THEMERC}
|
||||
sd "\.inactive.border.color:.*$" ".inactive.border.color: ${1}" ${THEMERC}
|
||||
sd "^window.inactive.title.bg.colorTo:.*$" "window.inactive.title.bg.colorTo: ${colorTo}" ${THEMERC}
|
||||
sd "\.inactive.border.color:.*$" ".inactive.border.color: ${1}" ${THEMERC}
|
||||
}
|
||||
|
||||
clractivebgto () {
|
||||
sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${1}" ${THEMERC}
|
||||
#activehandle?
|
||||
read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
read AHBG <<< "$(grep .active.handle.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
if [ "$ABG" == "$AHBG" ];then
|
||||
###read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
###read AHBG <<< "$(grep .active.handle.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
###if [ "$ABG" == "$AHBG" ];then
|
||||
sd "\.active.handle.bg.colorTo:.*$" ".active.handle.bg.colorTo: ${1}" ${THEMERC}
|
||||
fi
|
||||
###fi
|
||||
sd "\.active.grip.bg.colorTo:.*$" ".active.grip.bg.colorTo: ${1}" ${THEMERC}
|
||||
}
|
||||
|
||||
clrnormalbgto () {
|
||||
sd "^window.inactive.title.bg.colorTo:.*$" "window.inactive.title.bg.colorTo: ${1}" ${THEMERC}
|
||||
#normalhandle?
|
||||
read IBG <<< "$(grep .inactive.title.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
read IHBG <<< "$(grep .inactive.handle.bg.color: ${THEMERC} | cut -d':' -f2)"
|
||||
if [ "$IBG" == "$IHBG" ];then
|
||||
sd "\.inactive.handle.bg.colorTo:.*$" ".inactive.handle.bg.colorTo: ${1}" ${THEMERC}
|
||||
fi
|
||||
sd "\.inactive.grip.bg.colorTo:.*$" ".inactive.grip.bg.colorTo: ${1}" ${THEMERC}
|
||||
}
|
||||
activetextcolor () {
|
||||
@ -578,6 +654,107 @@ randomizer () {
|
||||
-o "Regenerate:randomizer ob" -o "Customize:colorizer-ob -s"
|
||||
}
|
||||
|
||||
tweak() {
|
||||
case "$1" in
|
||||
large)
|
||||
fontsize 14
|
||||
paddingHeight 8
|
||||
buttons big-14
|
||||
borderWidth 4
|
||||
handlewidth 6
|
||||
;;
|
||||
big)
|
||||
fontsize 12
|
||||
paddingHeight 6
|
||||
buttons big-12
|
||||
borderWidth 1
|
||||
handlewidth 4
|
||||
;;
|
||||
normal)
|
||||
fontsize 11
|
||||
paddingHeight 4
|
||||
buttons tiny
|
||||
borderWidth 0
|
||||
handlewidth 3
|
||||
;;
|
||||
small)
|
||||
fontsize 10
|
||||
paddingHeight 2
|
||||
buttons dots
|
||||
borderWidth 0
|
||||
handlewidth 2
|
||||
;;
|
||||
tiny)
|
||||
fontsize 9
|
||||
paddingHeight 1
|
||||
buttons normal
|
||||
borderWidth 0
|
||||
handlewidth 0
|
||||
;;
|
||||
*):;;
|
||||
esac
|
||||
}
|
||||
savetheme () {
|
||||
case "$LANG" in
|
||||
pl*)SAVE_AS="Nowy motyw Openbox"
|
||||
DESC="Zapisz obecne ustawionia Openbox jako nowy motyw..."
|
||||
LABEL="Nazwa:"
|
||||
NAME="nazwa";;
|
||||
*) SAVE_AS="New Openbox theme"
|
||||
DESC="Save current Openbox window decoration setup as theme..."
|
||||
LABEL="Name:"
|
||||
NAME="theme-name";;
|
||||
esac
|
||||
# ask for scheme name
|
||||
schemename=$(yad --center --width=300 --borders=20 --window-icon=mbcc --title "$SAVE_AS" --text="$DESC" --entry --entry-label="$LABEL" --entry-text="$NAME") || exit 1
|
||||
|
||||
echo "${1}${schemename}" >> "$HOME/.config/colorizer/openbox/userthemes.csv"
|
||||
}
|
||||
applyscheme () {
|
||||
theme MBcolors
|
||||
case "$1" in
|
||||
sys) SCHEMEFILE="/usr/share/mabox-colorizer/colorschemes/ob.csv";;
|
||||
usr) SCHEMEFILE="$HOME/.config/colorizer/openbox/userthemes.csv";;
|
||||
esac
|
||||
while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel button fsize fname ndslim weight slant scheme_name
|
||||
do
|
||||
clractivebg "${abg}"
|
||||
clractivebgto "${abgto}"
|
||||
activetextcolor "${afg}"
|
||||
activeborderColor "${aline}"
|
||||
clrnormalbg "${nbg}"
|
||||
clrnormalbgto "${nbgto}"
|
||||
inactivetextcolor "${nfg}"
|
||||
inactiveborderColor "${nline}"
|
||||
gradient_type "${grad}"
|
||||
done < <(awk 'NR == n' n=$2 "$SCHEMEFILE")
|
||||
}
|
||||
applytheme() {
|
||||
case "$1" in
|
||||
sys) SCHEMEFILE="/usr/share/mabox-colorizer/colorschemes/ob.csv";;
|
||||
usr) SCHEMEFILE="$HOME/.config/colorizer/openbox/userthemes.csv";;
|
||||
esac
|
||||
applyscheme "$1" "$2"
|
||||
while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel button fsize fname ndslim weight slant scheme_name
|
||||
do
|
||||
textjustify "${txtjust}"
|
||||
paddingHeight "${pheight}"
|
||||
paddingWidth "${pwidth}"
|
||||
handlewidth "${handle}"
|
||||
borderWidth "${bord}"
|
||||
raised "${bevel}"
|
||||
buttons "${button}"
|
||||
fontsize "${fsize}"
|
||||
fontfamily "${fname}"
|
||||
ndslimc "${ndslim}"
|
||||
fontweight "${weight}"
|
||||
fontslant "${slant}"
|
||||
done < <(awk 'NR == n' n=$2 "$SCHEMEFILE")
|
||||
}
|
||||
delscheme() {
|
||||
sed -i ${1}d "$HOME/.config/colorizer/openbox/userthemes.csv"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
theme) theme "$2";;
|
||||
reset) reset;;
|
||||
@ -595,6 +772,7 @@ case "$1" in
|
||||
gradient_type) gradient_type "$2";;
|
||||
random_gradient) random_gradient;;
|
||||
activegradient) activegradient "$2" "$3";;
|
||||
gradient_reverse) gradient_reverse;;
|
||||
activehandle) activehandle "$2";;
|
||||
clractivebg_only) clractivebg_only "$2";; #ADVANCED - do not calculate colorTo
|
||||
clractivebg) clractivebg "$2";;
|
||||
@ -614,6 +792,11 @@ case "$1" in
|
||||
fontweighttoggle) fontweighttoggle;;
|
||||
fontslanttoggle) fontslanttoggle;;
|
||||
randomizer) randomizer;;
|
||||
tweak) tweak "$2";;
|
||||
savetheme) savetheme "$2";;
|
||||
applyscheme) applyscheme "$2" "$3";;
|
||||
applytheme) applytheme "$2" "$3";;
|
||||
delscheme) delscheme "$2";;
|
||||
*) : ;;
|
||||
esac
|
||||
|
||||
|
@ -284,6 +284,7 @@ case "$1" in
|
||||
obtctl clrnormalbgto "$(pastel darken 0.1 "${w[1]}"|pastel format hex)"
|
||||
;;
|
||||
esac
|
||||
obtctl shadow 0
|
||||
}
|
||||
colorize () {
|
||||
source ~/.config/colorizer/colorizer.conf
|
||||
|
7
share/mabox-colorizer/colorschemes/ob.csv
Normal file
7
share/mabox-colorizer/colorschemes/ob.csv
Normal file
@ -0,0 +1,7 @@
|
||||
ABG | ABGTO | AFG | ALINE | NBG | NBGTO | NFG | NLINE | GRAD |TXTJUST|PHEIGHT|PWIDTH|HANDLE|BORD|BEVEL|BUTTONS|FSIZE|FNAME|NDSLIMC|WEIGHT|SLANT|scheme_name
|
||||
#579c8e|#41756a|#ffffff|#579c8e|#383838|#2a2a2a|#898989|#292929|vertical|center|4|4|4|1|raised|tiny|11|Noto Sans|NDSLIMC|Normal|Normal|Mabox Istredd
|
||||
#d2cda1|#c6b76b|#222222|#d2cda1|#0c1d23|#000000|#898989|#0c1d23|vertical|center|4|4|2|0|raised|big-12|12|Noto Sans|NLIMC|Normal|Normal|Mabox Jaskier Light
|
||||
#283433|#1a231a|#E5E5E5|#283433|#0c100f|#080b08|#898989|#0c100f|horizontal|center|4|4|2|0|raised|tiny|11|Noto Sans|NLIMC|Normal|Normal|Mabox Jaskier Dark
|
||||
#D9D9D9|#B6B6B6|#0F0F0F|#BDBBB9|#D9D9D9|#B4B4B4|#656565|#BFBCBB|vertical|left|2|2|1|0|raised|bold|11|Ubuntu Bold|NLIMC|Bold|Normal|Light Grey
|
||||
#CE5C00|#9b4600|#E5E5E5|#CE5C00|#D3D7CF|#B4B4B4|#656565|#BFBCBB|mirrorhorizontal|center|2|2|1|0|raised|dots|11|Noto Sans|NLIMC|Normal|Normal|Orange
|
||||
#F7941E|#004E8F|#E5E5E5|#F7941E|#4a2c09|#00172b|#656565|#4a2c09|mirrorhorizontal|center|4|4|1|0|raised|big-14|13|Ubuntu|NLIMC|Normal|Normal|Sky and Sea
|
|
Loading…
Reference in New Issue
Block a user