From 89f905268f60085b38b98b21bd9ee042b9d7ead6 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Thu, 22 Feb 2024 14:24:51 +0100 Subject: [PATCH] add monocolor --- bin/checkupdates.sh | 4 +- bin/colorizer-conky | 19 +- bin/colorizer-menus | 20 +- bin/colorizer-ob | 38 +- bin/conkyctl | 103 ++++- bin/jgctl | 101 ++++- bin/obtctl | 76 +++- share/mabox-colorizer/help/en.html | 343 +++++++++++------ share/mabox-colorizer/help/pl.html | 356 +++++++++++------- .../themes/MBcolors/openbox-3/themerc | 2 +- 10 files changed, 763 insertions(+), 299 deletions(-) diff --git a/bin/checkupdates.sh b/bin/checkupdates.sh index b17b625..73276f8 100755 --- a/bin/checkupdates.sh +++ b/bin/checkupdates.sh @@ -7,6 +7,8 @@ CNF_DIR="$HOME/.config/colorizer/conky" CNF_FILE="$CNF_DIR/conky.cfg" source <(grep = $CNF_FILE) +PKGS=$(checkupdates | wc -l) +mb-setvar updates=${PKGS} case "$LANG" in pl*) @@ -49,7 +51,7 @@ esac if [ -f /tmp/"$CONKYPID" ]; then - PKGS=$(pamac checkupdates --no-aur -q| wc -l) + PKGS=$(checkupdates | wc -l) if [ "$PKGS" != "0" ]; then if [[ "$update_notifications" == "true" ]];then notify-send.sh -u critical -i mbcc "$AVAIL_UPDATES" "$PKGS_TO_UPDATE $PKGS" -o "$YAY_UPD:terminator -T '$YAY_UPD' -e yay" \ diff --git a/bin/colorizer-conky b/bin/colorizer-conky index 86f8dba..36407f2 100755 --- a/bin/colorizer-conky +++ b/bin/colorizer-conky @@ -1,7 +1,7 @@ #!/bin/bash # # colorizer - set of tools for Mabox (auto)theming -# Copyright (C) 2022-2023 Daniel Napora +# Copyright (C) 2022-2024 Daniel Napora # # 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 @@ -85,6 +85,8 @@ case "$LANG" in APPLY_SCHEME="Zastosuj" DELETE="Usuń" DELETE_SCHEME="Usuń schemat kolorów" + MONOCHROMATIC="Monochromatyczny" + CHOOSE_AND_PICK="Wybierz wariant i pobierz kolor..." GENERATEFROMWP="Generuj z kolorów tapety" LIGHTBG="Jasne tło" DARKBG="Ciemne tło" @@ -140,6 +142,8 @@ case "$LANG" in APPLY_SCHEME="Apply colorscheme" DELETE="Delete" DELETE_SCHEME="Delete colorscheme" + MONOCHROMATIC="Monochromatic" + CHOOSE_AND_PICK="Choose variant and pick color..." GENERATEFROMWP="Generate from wallpaper colors" LIGHTBG="Light Background" DARKBG="Dark Background" @@ -319,6 +323,15 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then out+=(" $REGENERATE,^checkout(regenconky)") out2+=("^tag(regenconky)") out2+=("^sep($REGENERATE)") + out2+=("^sep($MONOCHROMATIC)") + out2+=("^sep($CHOOSE_AND_PICK)") + out2+=(" $DARKBG...,conkyctl mono pick dark") + out2+=(" $LIGHTBG...,conkyctl mono pick light") + + out2+=("^sep($GENERATEFROMWP)") + out2+=(" $LIGHTBG ,w2theme conky light;$me") + out2+=(" $DARKBG ,w2theme conky dark;$me") + out2+=("^sep($SYSTEM_SCHEMES)") n=1 while IFS="|" read -r winclr clr clr0 clr1 clr2 wintrans outline shades bord stip scheme_name @@ -348,9 +361,7 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then done < <(tail -n +2 "$USERSCHEMES") - out2+=("^sep($GENERATEFROMWP)") - out2+=(" $LIGHTBG ,w2theme conky light;$me") - out2+=(" $DARKBG ,w2theme conky dark;$me") + out+=("^sep()") diff --git a/bin/colorizer-menus b/bin/colorizer-menus index b5d8d9f..ee9db5f 100755 --- a/bin/colorizer-menus +++ b/bin/colorizer-menus @@ -89,6 +89,8 @@ case "$LANG" in WIDE="szerokie" NORMAL="normalne" TIGHT="wąskie" + MONOCHROMATIC="Monochromatyczny" + CHOOSE_AND_PICK="Wybierz wariant i pobierz kolor..." GENERATEFROMWP="Generuj z kolorów tapety..." LIGHTBG="Jasne tło" DARKBG="Ciemne tło" @@ -171,6 +173,8 @@ case "$LANG" in WIDE="wide" NORMAL="normal" TIGHT="tight" + MONOCHROMATIC="Monochromatic" + CHOOSE_AND_PICK="Choose variant and pick color..." GENERATEFROMWP="Generate from wallpaper colors..." LIGHTBG="Light Background" DARKBG="Dark Background" @@ -281,11 +285,11 @@ out+=(" $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+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_border=${i};$me")") || out3+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_border=${i};$me")");done + for i in 0 1 2 3 4 5 6 8 10 12; do [[ "$jgtools_border" == $i ]] && out3+=(" $(printf "%3s,%s" "$i" "jgctl border ${i}")") || out3+=(" $(printf "%3s,%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+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_padding=${i};$me")") || out3+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_padding=${i};$me")");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+=(" $(printf "%3s,%s" "$i" "jgctl padding ${i}")") || out3+=(" $(printf "%3s,%s" "$i" "jgctl padding ${i}")");done out3+=("^tag(subspacing)") out3+=("^sep($SUBSPACING)") @@ -334,6 +338,13 @@ out+=(" $QUICK_TWEAKS,^checkout(tweaks)") out+=(" $SCHEMES,^checkout(schemes)") out2+=("^tag(schemes)") out2+=("^sep($SCHEMES)") + out2+=("^sep($MONOCHROMATIC)") + out2+=("^sep($CHOOSE_AND_PICK)") + out2+=(" $LIGHTBG...,jgctl mono pick light") + out2+=(" $DARKBG...,jgctl mono pick dark") + out2+=("^sep($GENERATEFROMWP)") + out2+=(" $LIGHTBG ,w2theme menu light;$me") + out2+=(" $DARKBG ,w2theme menu dark;$me") out2+=("^sep($SYSTEM_SCHEMES)") n=1 @@ -382,11 +393,6 @@ out+=(" $LIGHTBG ,w2theme menu light;$me") - out2+=(" $DARKBG ,w2theme menu dark;$me") - out+=("^sep($FONTS)") out+=("󰛖 $TITLE [ $menu_sep_font_family $menu_sep_font_size ],^checkout(mtitlefont)") out+=("󰛖 $ITEM [ $menu_font_family $menu_font_size ],^checkout(mitemfont)") diff --git a/bin/colorizer-ob b/bin/colorizer-ob index 6b60f1d..e619957 100755 --- a/bin/colorizer-ob +++ b/bin/colorizer-ob @@ -71,6 +71,8 @@ case "$LANG" in DELETE="Usuń" DELETE_THEME="Usuń motyw" OBTHEME_LBL="Motyw OpenBox" + MONOCHROMATIC="Monochromatyczny" + CHOOSE_AND_PICK="Wybierz wariant i pobierz kolor..." GENERATEFROMWP="Generuj z kolorów tapety..." LIGHTBG=" Jasne tło" DARKBG="Ciemne tło" @@ -154,6 +156,8 @@ case "$LANG" in DELETE="Delete" DELETE_THEME="Delete theme" OBTHEME_LBL="OpenBox theme" + MONOCHROMATIC="Monochromatic" + CHOOSE_AND_PICK="Choose variant and pick color..." GENERATEFROMWP="Generate from wallpaper colors..." LIGHTBG="Light Background" DARKBG="Dark Background" @@ -276,7 +280,9 @@ getvaluesrc() { 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") + WEIGHT_INACT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:weight' "$cfg") + SLANT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' "$cfg") + SLANT_INACT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:slant' "$cfg") } @@ -356,6 +362,16 @@ out+=(" $QUICK_TWEAKS,^checkout(tweaks)") out+=(" $THEMES,^checkout(schemes)") out2+=("^tag(schemes)") out2+=("^sep($THEMES)") + out2+=("^sep($MONOCHROMATIC)") + out2+=("^sep($CHOOSE_AND_PICK)") + out2+=(" $LIGHTBG...,obtctl mono pick light") + out2+=(" $DARKBG...,obtctl mono pick dark") + out2+=("^sep($GENERATEFROMWP)") + out2+=(" $LIGHTBG ,w2theme ob light;$me") + out2+=(" $DARKBG ,w2theme ob dark;$me") + out2+=("^sep()") + out2+=(" $RANDOMIZE,obtctl randomizer;$me") + 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 @@ -388,11 +404,7 @@ out+=(" 󰗨 $DELETE_THEME: ${scheme_name},obtctl delscheme ${n};$me") done < <(tail -n +2 "$USERTHEMES") - out2+=("^sep($GENERATEFROMWP)") - out2+=(" $LIGHTBG ,w2theme ob light;$me") - out2+=(" $DARKBG ,w2theme ob dark;$me") - out2+=("^sep()") - out2+=(" $RANDOMIZE,obtctl randomizer;$me") + out+=("^sep($TITLEBAR)") out+=("󰛖 $TITLEBAR_FONT [ ${FNAME} ${FSIZE} ],^checkout(titletext)") @@ -406,6 +418,9 @@ out+=("^sep($INACTIVE_WINDOW)") out+=(" $INACTIVE_BG,^pipe(mbclr '$NBG' obtctl clrnormalbg '${INACTIVE_BG}' '$me')") [[ ! -z "$ABGTO" ]] && out+=(" $INACTIVE_BG_TO,^pipe(mbclr '$NBGTO' obtctl clrnormalbgto '${INACTIVE_BG_TO}' '$me')") out+=(" title $TEXT_COLOR,^pipe(mbclr '$NFG' obtctl inactivetextcolor '${TEXT} ${INACTIVE_FG}' '$me')") +out+=("^sep()") +[[ "$WEIGHT_INACT" =~ .*"old" ]] && out+=(" $BOLD,obtctl fontweight_inactive Normal;$me") || out+=(" $BOLD,obtctl fontweight_inactive Bold;$me") +[[ "$SLANT_INACT" =~ .*"talic" ]] && out+=(" $ITALIC,obtctl fontslant_inactive Normal;$me") || out+=(" $ITALIC,obtctl fontslant_inactive Italic;$me") out+=("^sep(Gradient)") out+=("󰹸 $GRADIENT_TYPE [ ${GRAD} ],^checkout(gradient)") @@ -428,7 +443,7 @@ out+=("^sep($RESET)") out+=("󰁯 $RESET_THEME,^checkout(resettheme)") out2+=("^tag(resettheme)") out2+=("^sep($AREYOUSURE)") - out2+=("$YES,obtctl reset;$me") + out2+=("$YES,obtctl resetMBcolors;$me") fi #out+=("Edit...,xdg-open ${THEMERC}") @@ -449,6 +464,11 @@ out2+=("Dots,obtctl buttons dots;$me") out2+=("^sep()") out2+=("Big 12px,obtctl buttons big-12;$me") out2+=("Big 14px,obtctl buttons big-14;$me") +out2+=("^sep($TEXTALIGN)") +[[ "$TXTJUST" = left ]] && out2+=("綠  $LEFT,obtctl textjustify left;$me")||out2+=("祿  $LEFT,obtctl textjustify left;$me") +[[ "$TXTJUST" = center ]] && out2+=("綠  $CENTER,obtctl textjustify center;$me")||out2+=("祿  $CENTER,obtctl textjustify center;$me") +[[ "$TXTJUST" = right ]] && out2+=("綠  $RIGHT,obtctl textjustify right;$me")||out2+=("祿  $RIGHT,obtctl textjustify right;$me") + out2+=("^sep($BUTTONS_LAYOUT)") [[ "$NDSLIMC" == NDSLIMC ]] && out2+=(" full NDSLIMC (default),obtctl ndslimc NDSLIMC;$me") || out2+=(" full NDSLIMC (default),obtctl ndslimc NDSLIMC;$me") [[ "$NDSLIMC" == NLIMC ]] && out2+=(" mini NLIMC,obtctl ndslimc NLIMC;$me") || out2+=(" mini NLIMC,obtctl ndslimc NLIMC;$me") @@ -462,10 +482,6 @@ out2+=("^sep(M: Maximize)") out2+=("^sep(C: Close)") out2+=("^sep(S: Shade (Roll up))") out2+=("^sep(D: Omnipresent (On all desktops))") -out2+=("^sep($TEXTALIGN)") -[[ "$TXTJUST" = left ]] && out2+=("綠  $LEFT,obtctl textjustify left;$me")||out2+=("祿  $LEFT,obtctl textjustify left;$me") -[[ "$TXTJUST" = center ]] && out2+=("綠  $CENTER,obtctl textjustify center;$me")||out2+=("祿  $CENTER,obtctl textjustify center;$me") -[[ "$TXTJUST" = right ]] && out2+=("綠  $RIGHT,obtctl textjustify right;$me")||out2+=("祿  $RIGHT,obtctl textjustify right;$me") #TEXT out2+=("^tag(titletext)") diff --git a/bin/conkyctl b/bin/conkyctl index e4a043d..8a4f4ed 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -419,6 +419,8 @@ languages () { NEWTHEME="Nowy motyw kolorów..." SAVENEWTHEME="utwórz nowy motyw..." SAVE_CURRSCHEME="Zapisz aktualną kolorystykę jako..." + MONOCHROMATIC="Monochromatyczny" + CHOOSE_AND_PICK="Wybierz wariant i pobierz kolor..." LIGHTBG="Jasne tło" DARKBG="Ciemne tło" RESETCOLORS="Przywróć domyślne kolory" @@ -485,6 +487,8 @@ languages () { NEWTHEME="New Color scheme..." SAVENEWTHEME="from current colors..." SAVE_CURRSCHEME="Save current colors as..." + MONOCHROMATIC="Monochromatic" + CHOOSE_AND_PICK="Choose variant and pick color..." LIGHTBG="Light Background" DARKBG="Dark Background" RESETCOLORS="Restore default colors" @@ -551,6 +555,8 @@ languages () { NEWTHEME="New Color scheme..." SAVENEWTHEME="from current colors..." SAVE_CURRSCHEME="Save current colors as..." + MONOCHROMATIC="Monochromatic" + CHOOSE_AND_PICK="Choose variant and pick color..." LIGHTBG="Light Background" DARKBG="Dark Background" RESETCOLORS="Restore default colors" @@ -754,7 +760,13 @@ if [[ "$OLD_SYNTAX" = "true" ]];then #if [ "$WINTRANS" == false ];then out+=(" $COLORSCHEME,^checkout(regensingle)") out2+=("^tag(regensingle)") - + out2+=("^sep($MONOCHROMATIC)") + out2+=("^sep($CHOOSE_AND_PICK)") + out2+=(" $DARKBG...,conkyctl monoone pick dark ${1}") + out2+=(" $LIGHTBG...,conkyctl monoone pick light ${1}") + out2+=("^sep($GENFROMWP)") + out2+=(" $LIGHTBG ,w2theme conkyone light ${1}") + out2+=(" $DARKBG ,w2theme conkyone dark ${1}") out2+=("^sep($APPLY_THEME)") out2+=("^sep($SYSTEM_SCHEMES)") n=1 @@ -780,9 +792,7 @@ if [[ "$OLD_SYNTAX" = "true" ]];then done < <(tail -n +2 "$USERSCHEMES") - out2+=("^sep($GENFROMWP)") - out2+=(" $LIGHTBG ,w2theme conkyone light ${1}") - out2+=(" $DARKBG ,w2theme conkyone dark ${1}") + out+=("^sep()") #fi @@ -1242,6 +1252,89 @@ baseconky_info() { esac colorizer-conky -s } +mono () { +lighten=(0.92 0.8 0.65 0.45 0.28) +darken=(0.9 0.74 0.54 0.38 0.18) + +if [ "${1}" == pick ];then + color=$(gpick -pso 2>/dev/null) +else + color="${1}" +fi + +if [ "${#color}" == 7 ];then + for i in "${lighten[@]}" + do + pal+=("$(pastel mix -f $i "#ffffff" "$color"|pastel format hex)") + done + pal+=("$color") + + for i in "${darken[@]}" + do + pal+=("$(pastel mix -f $i "$color" "#000000"|pastel format hex)") + done +else + exit 0 +fi + +#colorize Conky +if [ "$2" == "dark" ];then + win_bgcolor_all "${pal[10]}" + default_color_all "${pal[0]}" + color0_all "${pal[3]}" + color1_all "${pal[4]}" + color2_all "${pal[5]}" +else # light + win_bgcolor_all "${pal[4]}" + default_color_all "${pal[9]}" + color0_all "${pal[7]}" + color1_all "${pal[8]}" + color2_all "${pal[1]}" +fi +colorizer-conky -s 2>/dev/null +} +monoone () { +lighten=(0.92 0.8 0.65 0.45 0.28) +darken=(0.9 0.74 0.54 0.38 0.18) + +if [ "${1}" == pick ];then + color=$(gpick -pso 2>/dev/null) +else + color="${1}" +fi + +if [ "${#color}" == 7 ];then + for i in "${lighten[@]}" + do + pal+=("$(pastel mix -f $i "#ffffff" "$color"|pastel format hex)") + done + pal+=("$color") + + for i in "${darken[@]}" + do + pal+=("$(pastel mix -f $i "$color" "#000000"|pastel format hex)") + done +else + exit 0 +fi + +# colorize one Conky +if [ "$2" == "dark" ];then + win_bgcolor "${pal[10]}" "${3}" + default_color "${pal[0]}" "${3}" + color0 "${pal[3]}" "${3}" + color1 "${pal[4]}" "${3}" + color2 "${pal[5]}" "${3}" +else # light + win_bgcolor "${pal[4]}" "${3}" + default_color "${pal[9]}" "${3}" + color0 "${pal[7]}" "${3}" + color1 "${pal[8]}" "${3}" + color2 "${pal[1]}" "${3}" +fi +} + + case "$1" in transparent_all) transparent_all "$2";; transparent) transparent "$2" "$3";; @@ -1296,5 +1389,7 @@ case "$1" in netdevice) netdevice ;; convert_from_old) convert_from_old "$2";; baseconky_info) baseconky_info;; + mono) mono "$2" "$3";; + monoone) monoone "$2" "$3" "$4";; *) : ;; esac diff --git a/bin/jgctl b/bin/jgctl index deec535..1726864 100755 --- a/bin/jgctl +++ b/bin/jgctl @@ -266,25 +266,53 @@ tweak () { sizing) case "$2" in tight) - mb-setvar jgtools_padding=0 + mb-setvar jgtools_padding=4 mb-setvar jgtools_border=0 - mb-setvar submenu_spacing=1 + mb-setvar submenu_spacing=2 + mb-setvar arrow_string= ;; normal) mb-setvar jgtools_padding=8 - mb-setvar jgtools_border=0 - mb-setvar submenu_spacing=2 + mb-setvar jgtools_border=3 + mb-setvar submenu_spacing=3 + mb-setvar arrow_string= ;; wide) mb-setvar jgtools_padding=20 - mb-setvar jgtools_border=4 - mb-setvar submenu_spacing=4 + mb-setvar jgtools_border=6 + mb-setvar submenu_spacing=6 + mb-setvar arrow_string= ;; esac ;; *):;; esac + [[ "$3" == "menu" ]] && colorizer-menus -s 2>/dev/null } + +t_search_field () { + [[ $search_field == "false" ]] && mb-setvar search_field=true || mb-setvar search_field=false + mb-jgtools main ipc +} +t_apps_in_submenu () { + [[ $apps_in_submenu == "true" ]] && mb-setvar apps_in_submenu=false || mb-setvar apps_in_submenu=true + mb-jgtools main ipc +} +t_icons () { + [[ $jgmenu_use_icons == "true" ]] && mb-setvar jgmenu_use_icons=false || mb-setvar jgmenu_use_icons=true + mb-jgtools main ipc +} +border () { + [[ "$jgtools_padding" -lt "${1}" ]] && mb-setvar jgtools_padding=${1} + mb-setvar jgtools_border=${1} + colorizer-menus -s +} +padding () { + [[ "$jgtools_border" -gt "${1}" ]] && mb-setvar jgtools_border=${1} + mb-setvar jgtools_padding=${1} + colorizer-menus -s +} + opacity () { # jgctl opacity element value read FUNC B COLOR OPACITY REST<<< "$(grep ${1} ${THEMERC})" @@ -348,6 +376,59 @@ done < <(awk 'NR == n' n=$2 "$SCHEMEFILE") delscheme() { sed -i ${1}d "$HOME/.config/colorizer/menus/userschemes.csv" } +mono () { +lighten=(0.92 0.8 0.65 0.45 0.28) +darken=(0.9 0.74 0.54 0.38 0.18) + +if [ "${1}" == pick ];then + color=$(gpick -pso 2>/dev/null) +else + color="${1}" +fi + +if [ "${#color}" == 7 ];then + for i in "${lighten[@]}" + do + pal+=("$(pastel mix -f $i "#ffffff" "$color"|pastel format hex)") + done + pal+=("$color") + + for i in "${darken[@]}" + do + pal+=("$(pastel mix -f $i "$color" "#000000"|pastel format hex)") + done +else + exit 0 +fi + +# colorize menu +if [ "$2" == "dark" ];then + #notify-send.sh "$1" "gen_menu" + color_menu_bg "${pal[8]}" + color_menu_bg_to "${pal[7]}" + color_menu_border "${pal[10]}" + color_title_bg "${pal[9]}" + color_title_border "${pal[9]}" + color_title_fg "${pal[2]}" + color_norm_fg "${pal[3]}" + color_sel_bg "${pal[6]}" + color_sel_fg "${pal[1]}" + color_sep_fg "${pal[6]}" +else #light + color_menu_bg "${pal[2]}" + color_menu_bg_to "${pal[3]}" + color_menu_border "${pal[1]}" + color_title_bg "${pal[3]}" + color_title_border "${pal[4]}" + color_title_fg "${pal[10]}" + color_norm_fg "${pal[8]}" + color_sel_bg "${pal[4]}" + color_sel_fg "${pal[10]}" + color_sep_fg "${pal[3]}" +fi +colorizer-menus -s 2>/dev/null +} + case "$1" in theme) theme "$2";; reset) reset ;; @@ -370,8 +451,14 @@ case "$1" in color_sel_fg) color_sel_fg "$2";; color_sel_border) color_sel_border "$2";; accent) accent "$2" "$3";; - tweak) tweak "$2" "$3";; + tweak) tweak "$2" "$3" "$4";; opacity) opacity "$2" "$3";; + t_search_field)t_search_field;; + t_apps_in_submenu) t_apps_in_submenu;; + t_icons)t_icons;; + border)border "$2";; + padding)padding "$2";; + mono) mono "$2" "$3";; savescheme) savescheme "$2";; applyscheme) applyscheme "$2" "$3";; delscheme) delscheme "$2";; diff --git a/bin/obtctl b/bin/obtctl index f93cd50..a94f395 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -100,7 +100,7 @@ paddingHeight () { sd "^padding.width:.*$" "padding.width: ${PHEIGHT}" ${THEMERC} fi ;; - 0|1|2|3|4|6|8|10|12|16|20) + 0|1|2|3|4|5|6|8|10|12|16|20) sd "^padding.height:.*$" "padding.height: $1" ${THEMERC} sd "^padding.width:.*$" "padding.width: $1" ${THEMERC} ;; @@ -505,11 +505,15 @@ fontsize () { fontweight () { nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" - xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:weight' -v "${1}" "$cfg" xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:weight' -v "${1}" "$cfg" } +fontweight_inactive () { + nspace="http://openbox.org/3.4/rc" + cfg="$HOME/.config/openbox/rc.xml" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:weight' -v "${1}" "$cfg" +} fontweighttoggle (){ nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" @@ -523,10 +527,15 @@ fontweighttoggle (){ fontslant (){ nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" - xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' -v "${1}" "$cfg" xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:slant' -v "${1}" "$cfg" } +fontslant_inactive (){ + nspace="http://openbox.org/3.4/rc" + cfg="$HOME/.config/openbox/rc.xml" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:slant' -v "${1}" "$cfg" +} + fontslanttoggle (){ nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" @@ -569,8 +578,8 @@ randomizer () { #rand ### Random border - BORDERS=(0 0 1 2 4) - rand=$((RANDOM%4)) + BORDERS=(0 0 1 2 4 6) + rand=$((RANDOM%5)) BORDER="${BORDERS[$rand]}" borderWidth "${BORDER}" @@ -673,21 +682,21 @@ tweak() { fontsize 14 paddingHeight 8 buttons big-14 - borderWidth 4 + borderWidth 6 handlewidth 6 ;; big) fontsize 12 paddingHeight 6 buttons big-12 - borderWidth 1 + borderWidth 4 handlewidth 4 ;; normal) fontsize 11 paddingHeight 4 buttons tiny - borderWidth 0 + borderWidth 1 handlewidth 3 ;; small) @@ -767,6 +776,54 @@ applytheme() { delscheme() { sed -i ${1}d "$HOME/.config/colorizer/openbox/userthemes.csv" } +mono() { +lighten=(0.92 0.8 0.65 0.45 0.28) +darken=(0.9 0.74 0.54 0.38 0.18) + +if [ "${1}" == pick ];then + color=$(gpick -pso 2>/dev/null) +else + color="${1}" +fi + +if [ "${#color}" == 7 ];then + for i in "${lighten[@]}" + do + pal+=("$(pastel mix -f $i "#ffffff" "$color"|pastel format hex)") + done + pal+=("$color") + + for i in "${darken[@]}" + do + pal+=("$(pastel mix -f $i "$color" "#000000"|pastel format hex)") + done +else + exit 0 +fi + +#colorize OB +if [ "$2" == "dark" ];then + clractivebg "${pal[4]}" + clractivebgto "${pal[6]}" + activeborderColor "${pal[2]}" + activetextcolor "${pal[1]}" + clrnormalbg "${pal[9]}" + clrnormalbgto "${pal[10]}" + inactiveborderColor "${pal[8]}" + inactivetextcolor "${pal[4]}" +else #light + clractivebg "${pal[2]}" + clractivebgto "${pal[4]}" + activeborderColor "${pal[0]}" + activetextcolor "${pal[9]}" + clrnormalbg "${pal[9]}" + clrnormalbgto "${pal[10]}" + inactiveborderColor "${pal[7]}" + inactivetextcolor "${pal[5]}" +fi +openbox --reconfigure +colorizer-ob -s 2>/dev/null +} case "$1" in theme) theme "$2";; @@ -800,12 +857,15 @@ case "$1" in activebuttonscolors) activebuttonscolors "$2";; fontfamily) fontfamily "$2";; fontweight) fontweight "$2";; + fontweight_inactive) fontweight_inactive "$2";; fontslant) fontslant "$2";; + fontslant_inactive) fontslant_inactive "$2";; fontsize) fontsize "$2";; fontweighttoggle) fontweighttoggle;; fontslanttoggle) fontslanttoggle;; randomizer) randomizer;; tweak) tweak "$2";; + mono) mono "$2" "$3";; savetheme) savetheme "$2";; applyscheme) applyscheme "$2" "$3";; applytheme) applytheme "$2" "$3";; diff --git a/share/mabox-colorizer/help/en.html b/share/mabox-colorizer/help/en.html index ddaf6ba..2ab704a 100644 --- a/share/mabox-colorizer/help/en.html +++ b/share/mabox-colorizer/help/en.html @@ -14,7 +14,7 @@ color: #999999; font-size: 1.6vw !important; font-family: 'Symbols', sans-serif; } -.dark{background-color:#292929;} +.dark{background-color:#191919;} div.fixed { position: fixed; top: 4px; @@ -27,23 +27,32 @@ div.fixeddown { left:0; width:20%; } +nav button.tablink {padding:3px 8px !important;width:94%;float:right;text-align:left;border-left:4px solid transparent;} +nav button.tablink:hover {background-color:#444444 !important;color:white !important;border-left:4px solid #222222;} +nav button.bg {background-color:#222222;color:white !important;border-left:4px solid #34BE5B !important;border-radius:4px 0 0 4px;} +hr {margin:0;border: 0;height: 1px;background-image: linear-gradient(to right, rgba(105, 105, 105, 0), rgba(105, 105, 105, 0.75), rgba(105, 105, 105, 0));} div.fixed .bar-item {margin-right:4px; border-radius:4px;} .third {padding: 0.01em 4px;} .button {position:relative;} .button .right {position:absolute; top:0; right:6px;} +main div.dark .button{min-width:8vw;border-radius:2px;} section.tab {padding-top: 0;} section#Colorizer {padding-top: 0.01em;} +#logoheader {padding:16px 0 12px 0;background-color:#111111;border-bottom:1px solid #444444;} +#logo {width:8vw;height:8vw;} div.fixeddown p {margin:0;} -div.fixeddown p.black a {text-decoration:none;margin:0 4px;} -.logo {cursor:pointer;width:6vw;height:6vw;} +p#links a {text-decoration:none;margin:0 4px;font-size:2.4vw !important;} +#links {background-color:#111111;border-top:1px solid #444444;} .link {cursor:pointer;} .bar-block .btn {width: 100px;text-align:center;} .bar-block .btn:hover {background-color:white;color:gray;} .dropdown-content {min-width: 20px;} -a.tag {color: transparent; border:1px solid #666666; margin-bottom:4px;} -a.tag:hover {color: transparent; border:1px solid #EEEEEE;margin-bottom:4px;} -p a.tag {text-decoration:none; border:none;margin-bottom: 4px;border-radius:3px; padding:1px 6px;} -p a.tag:hover {text-decoration:none; border:none;margin-bottom: 4px;filter: brightness(0.8);} +a.tag {text-decoration:none; border:none;margin-bottom: 4px;border-radius:3px; padding:1px 6px;filter: brightness(0.8);} +a.tag:hover {text-decoration:none; border:none;margin-bottom: 4px;filter: brightness(1);} +.colors a.tag {border-radius:0;border:1px solid #333333;filter: brightness(1);} +.colors a.tag:hover {border:1px solid #EEEEEE;} +.attribs a.tag {margin-left:0;margin-right:1px;border:none;border-radius:0;filter: brightness(0.8);} +.attribs a.tag:hover {margin-left:0; margin-right:1px;border:none;border-radius:0;filter: brightness(1);} kbd { background-color: #eee; border-radius: 3px; @@ -57,7 +66,6 @@ kbd { padding: 2px 4px; white-space: nowrap; } -nav button.bar-item {padding:3px 12px !important;} .small {font-size: 1.5vw !important;} .tiny {font-size: 1.25vw !important;} h2 {font-size: 3vw !important;} @@ -65,28 +73,68 @@ h3 {font-size: 2.4vw !important;} h4 {font-size: 2.2vw !important;} h5 {font-size: 2vw !important;border-bottom: 1px solid;padding-left: 1em;} .large {width:3.2vw !important;height:2.4vw !important;font-size: 2.4vw !important;} -p.black a {font-size:2.4vw !important;} + +.grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(8em, 1fr)); + grid-gap: .5em; +} +.grid + .grid { + margin-top: .5em; +} +.grid div { + border: 0 solid currentcolor; + border-radius: 4px; + /**min-height: 15vh;**/ + padding: 1em; + /**color: #0178d4; + background-color:#191919;**/ + font-size: 1em; + text-align: center; + /**display: flex; + flex-direction: column;**/ + justify-content: center; +} +.gi2 {grid-column: span 2;} +.gi3 {grid-column: span 3;} +.gi4 {grid-column: span 4;} +.gi22 { + grid-column: span 2; + grid-row: span 2; +} +.gi2r{grid-row: span 2;} +.gi3r{grid-row: span 3;} +.gi4r{grid-row: span 4;} + -