diff --git a/bin/colorizer b/bin/colorizer index a0fe5e9..735f653 100755 --- a/bin/colorizer +++ b/bin/colorizer @@ -62,6 +62,7 @@ case "$LANG" in REVERSE="odwrotnie" CURRENTCONF="Obecna konfiguracja" MODULES="Moduły" + FONTS="Konfiguruj Czcionki" OBTHEME="Motyw Openbox" MENUPANELS="Menu i Panele" CAVA="Cava - wizualizacja dźwięku" @@ -158,6 +159,7 @@ case "$LANG" in REVERSE="reverse" CURRENTCONF="Current configuration" MODULES="Modules" + FONTS="Configure Fonts" OBTHEME="Openbox Theme" MENUPANELS="Menus/Panels" CAVA="Cava - Audio Visualizer" @@ -299,6 +301,8 @@ fi out+=("^sep()") out+=(" $COLORIZE,^pipe(randomizer c)") out+=("^sep($MODULES)") +out+=(" $FONTS,^pipe(colorizer-fonts)") +out+=("^sep()") out+=("$OBTHEME,^pipe(colorizer-ob)") #out+=("TINT2,^pipe(colorizer-tint2)") diff --git a/bin/colorizer-conky b/bin/colorizer-conky index 95aae00..5865cdf 100755 --- a/bin/colorizer-conky +++ b/bin/colorizer-conky @@ -72,6 +72,7 @@ case "$LANG" in FONTS="Czcionka" SELECTFONT="Wybierz czcionkę..." FONTFAMILY_LBL="czcionka" + _EDIT_FAVFONTS="Edytuj ulubione czcionki" FONTSIZE_LBL="rozmiar czcionki" INCREASE="Powiększ do" DECREASE="Pomniejsz do" @@ -117,6 +118,7 @@ case "$LANG" in FONTS="Font" SELECTFONT="Select Font..." FONTFAMILY_LBL="font family" + _EDIT_FAVFONTS="Edit favorite fonts list" FONTSIZE_LBL="font size" INCREASE="Increase to" DECREASE="Decrease to" @@ -300,7 +302,15 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then out2+=("^tag(font)") out2+=("^sep($FONTS)") out2+=("󰛖 $SELECTFONT [ $FONT $FONTSIZE ],mb-setfont conky_all;$me") - + out2+=("^sep($FONTSIZE_LBL)") + out2+=("󰧴 $INCREASE $((FONTSIZE+1)) px,conkyctl basefont_inc_all;$me") + out2+=("󰧳 $DECREASE $((FONTSIZE-1)) px,conkyctl basefont_dec_all;$me") + out2+=("^sep()") + sizes=(14 13 12 11 10 9 8 7 6) + for i in "${sizes[@]}" + do + [[ "$FONTSIZE" == "$i" ]] && out2+=(" $i px,conkyctl basefont_size_all $i;$me") || out2+=(" $i px,conkyctl basefont_size_all $i;$me") + done if [ -f "$HOME/.config/mabox/fonts.list" ];then mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list) else @@ -315,16 +325,8 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then done fi out2+=("^sep()") - out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") - out2+=("^sep($FONTSIZE_LBL)") - out2+=("󰧴 $INCREASE $((FONTSIZE+1)) px,conkyctl basefont_inc_all;$me") - out2+=("󰧳 $DECREASE $((FONTSIZE-1)) px,conkyctl basefont_dec_all;$me") - out2+=("^sep()") - sizes=(14 13 12 11 10 9 8 7 6) - for i in "${sizes[@]}" - do - [[ "$FONTSIZE" == "$i" ]] && out2+=(" $i px,conkyctl basefont_size_all $i;$me") || out2+=(" $i px,conkyctl basefont_size_all $i;$me") - done + out2+=(" $_EDIT_FAVFONTS,geany ~/.config/mabox/fonts.list") + [[ "$SHADOWS" == "shadow" ]] && out+=("󰄲 $SHADOW,conkyctl shades_all no;$me") || out+=("󰄱 $SHADOW,conkyctl shades_all shadow;$me") [[ "$SHADOWS" == "outline" ]] && out+=("󰄲 $OLINE,conkyctl shades_all no;$me") || out+=("󰄱 $OLINE,conkyctl shades_all outline;$me") diff --git a/bin/colorizer-fonts b/bin/colorizer-fonts new file mode 100755 index 0000000..f6fa8c1 --- /dev/null +++ b/bin/colorizer-fonts @@ -0,0 +1,406 @@ +#!/bin/bash +# +# colorizer - set of tools for Mabox (auto)theming +# Copyright (C) 2022-2023 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 +# 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 . + +. $HOME/.config/mabox/mabox.conf + +me="colorizer-fonts -s" + +CONKYDIR="$HOME/.config/conky" +BASECONKY="$CONKYDIR/sysinfo_mbcolor.conkyrc" + + +# Favorited fonts list +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 + + +case "$LANG" in + pl*) + _INCREASE_ALL="Powiększ wszystkie" + _DECREASE_ALL="Pomniejsz wszystkie" + _RESET="Resetuj do domyślnych" + _ALL="Wszystko" + _OPENBOX_WM="Openbox" + _TITLEBAR_FONT="Czcionka tytułu" + _BOLD="Pogrubienie" + _ITALIC="Kursywa" + _TEXTALIGN="Wyrównanie" + _LEFT="Lewo" + _CENTER="Środek" + _RIGHT="Prowo" + _MENUS="Menu" + _MENU_TITLE="Nagłówek" + _MENU_ITEM="Element" + _MENU_TITLE_FONT="Czcionka nagłówka" + _MENU_ITEM_FONT="Czcionka elementu" + _FONT_CUSTOM="Wybierz czcionkę i rozmiar..." + _FONT_FAMILY="rodzina" + _EDIT_FAVFONTS="Edytuj ulubione czcionki" + _FONT_SIZE="rozmiar" + _INCREASE="Powiększ do" + _DECREASE="Pomniejsz do" + _CONKY="Conky" + _CONKYFONT="Czcionka dla Conky" + _CONKYBASEFONT="Czcionka podstawowa" + _C_EFFECTS="Efekty" + _SHADOW="Cień" + _OUTLINE="Poświata" + _PANEL="Panel tint2" + _GTK="GTK" + _FAVORITE_LBL="Ulubione czcionki" + _USE="Użyj czcionki" + _FOR="dla..." + ;; + *) + _INCREASE_ALL="Increase all" + _DECREASE_ALL="Decrease all" + _RESET="Reset to defaults..." + _ALL="All" + _OPENBOX_WM="Openbox" + _TITLEBAR_FONT="TitleBar Font" + _BOLD="Bold" + _ITALIC="Italic" + _TEXTALIGN="Text align" + _LEFT="Left" + _CENTER="Center" + _RIGHT="Right" + _MENUS="Menus" + _MENU_TITLE="Menu Title" + _MENU_ITEM="Menu Item" + _MENU_TITLE_FONT="Menu Title Font" + _MENU_ITEM_FONT="Menu Item Font" + _FONT_CUSTOM="Select custom font and size..." + _FONT_FAMILY="font family" + _EDIT_FAVFONTS="Edit favorite fonts list" + _FONT_SIZE="font size" + _INCREASE="Increase to" + _DECREASE="Decrease to" + _CONKY="Widgets (Conky)" + _CONKYFONT="Conky Font" + _CONKYBASEFONT="Base font" + _C_EFFECTS="Effects" + _SHADOW="Shadow" + _OUTLINE="Outline" + _PANEL="Panel Tint2" + _GTK="GTK Font" + _FAVORITE_LBL="Favorite Fonts" + _USE="Use" + _FOR="font for ..." + + ;; +esac + +getvalues () { +GTK2RC="$HOME"/.gtkrc-2.0 +GTK_FONT=( $(grep "gtk-font-name" ${GTK2RC} | cut -d'"' -f2) ) +GTK_FAMILY=${GTK_FONT[@]::${#GTK_FONT[@]}-1} +GTK_SIZE=${GTK_FONT[-1]} + +nspace="http://openbox.org/3.4/rc" +obcfg="$HOME/.config/openbox/rc.xml" + +OBFSIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$obcfg") +OBFNAME=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:name' "$obcfg") +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' "$obcfg") +SLANT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' "$obcfg") + +OBTHEME=$(awk '// {while (getline n) {if (match(n, //)) + {l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$HOME/.config/openbox/rc.xml") + +THEMERC="$HOME/.themes/$OBTHEME/openbox-3/themerc" + +if [ -f "$THEMERC" ];then +read TXTJUST <<< "$(grep text.justify ${THEMERC} | cut -d':' -f2)" +else +: +fi + +read FONTDEF <<< "$(grep "font .*=.*,$" ${BASECONKY} | cut -d'=' -f2,3 |cut -d"'" -f2)" +C_FONT=${FONTDEF%:*} +C_FONTSIZE=${FONTDEF#*=} +} + + getvalues +out+=("󰧴 $_INCREASE_ALL,fontctl inc_all;$me") +out+=("󰧳 $_DECREASE_ALL,fontctl dec_all;$me") +out+=("^sep()") +out+=("󰑓 $_RESET,^checkout(reset)") + out2+=("^tag(reset)") + out2+=("^sep($_RESET)") + out2+=("$_ALL,fontctl resetall;$me") + out2+=("^sep()") + out2+=("$_TITLEBAR_FONT,fontctl resetob;$me") + out2+=("$_MENUS,fontctl resetmenus;$me") + out2+=("$_CONKY,fontctl resetconky;$me") + out2+=("$_GTK,fontctl resetgtk;$me") +out+=("^sep($_OPENBOX_WM)") +out+=("$_TITLEBAR_FONT [ $OBFNAME $OBFSIZE ],^checkout(obtitletext)") +out+=("^sep($_MENUS)") +out+=("$_MENU_TITLE [ $menu_sep_font_family $menu_sep_font_size ],^checkout(mtitlefont)") +out+=("$_MENU_ITEM [ $menu_font_family $menu_font_size ],^checkout(mitemfont)") +out+=("^sep($_GTK)") +out+=("$_GTK [ ${GTK_FAMILY} ${GTK_SIZE} ],^checkout(gtkfont)") +out+=("^sep($_CONKY)") +out+=("$_CONKYBASEFONT [ $C_FONT $C_FONTSIZE ],^checkout(conkyfont)") +#out+=("^sep($_PANEL)") +#out+=("(not implemented yet)") + +# FAV FONTS in rootmenu +if [ "${#favfonts[@]}" -gt 0 ];then + out+=("^sep($_FAVORITE_LBL)") + i=0 + for fon in "${favfonts[@]}";do + out+=(" ${fon},^checkout(favfont$i),$me") + out2+=("^tag(favfont$i)") + out2+=("^sep($_USE)") + out2+=("^sep(${fon})") + out2+=("^sep($_FOR)") + out2+=("$_TITLEBAR_FONT,obtctl fontfamily \"${fon}\";$me") + out2+=("$_MENU_TITLE,mb-setvar \"menu_sep_font_family='${fon}'\";$me") + out2+=("$_MENU_ITEM,mb-setvar \"menu_font_family='${fon}'\";$me") + out2+=("$_GTK,fontctl gtk_fontfamily \"${fon}\";$me") + out2+=("$_CONKY,conkyctl basefont_family_all \"${fon}\";$me") + i=$((i+1)) + done + out+=("^sep()") + out+=(" $_EDIT_FAVFONTS ,geany ~/.config/mabox/fonts.list") +fi + + +#SUBMENUS + +# OpenBox Title Font +out2+=("^tag(obtitletext)") +out2+=("^sep($_TITLEBAR_FONT)") +out2+=("^sep($OBFNAME $OBFSIZE)") +out2+=("󰛖 $_FONT_CUSTOM,mb-setfont obtitle;$me") +out2+=("^sep($_FONT_SIZE)") +out2+=("󰧴 $_INCREASE $((OBFSIZE+1)) px,fontctl ob_fontsize inc;$me") +out2+=("󰧳 $_DECREASE $((OBFSIZE-1)) px,fontctl ob_fontsize dec;$me") +out2+=("^sep()") +sizes=(16 15 14 13 12 11 10 9 8) +for i in "${sizes[@]}" +do +[[ "$OBFSIZE" == "$i" ]] && out2+=(" $i px,obtctl fontsize $i;$me") || out2+=(" $i px,fontctl ob_fontsize $i;$me") +done +out2+=("^sep($_FONT_FAMILY)") + +if [ "${#favfonts[@]}" -gt 0 ];then + for fon in "${favfonts[@]}";do + [[ "${OBFNAME}" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},obtctl fontfamily \"${fon}\";$me") + done +fi + + +out2+=("^sep()") +[[ "$WEIGHT" =~ .*"old" ]] && out2+=(" $_BOLD,obtctl fontweight Normal;$me") || out2+=(" $_BOLD,obtctl fontweight Bold;$me") +[[ "$SLANT" =~ .*"talic" ]] && out2+=(" $_ITALIC,obtctl fontslant Normal;$me") || out2+=(" $_ITALIC,obtctl fontslant Italic;$me") + +#SHADOW +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") + + + +# Menu Title Font +out2+=("^tag(mtitlefont)") +out2+=("^sep($_MENU_TITLE_FONT)") +out2+=("^sep($menu_sep_font_family $menu_sep_font_size)") + +out2+=("󰛖 $_FONT_CUSTOM,mb-setfont menu_sep;$me") +out2+=("^sep($_FONT_SIZE)") +out2+=("󰧴 $_INCREASE $((menu_sep_font_size+1)) px,mb-setvar menu_sep_font_size=$((menu_sep_font_size+1));$me") +out2+=("󰧳 $_DECREASE $((menu_sep_font_size-1)) px,mb-setvar menu_sep_font_size=$((menu_sep_font_size-1));$me") +out2+=("^sep()") +sizes=(14 13 12 11 10 9 8) +for i in "${sizes[@]}" +do + [[ "$menu_sep_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $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+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_sep_font_family='${fon}'\";$me") + done +fi + out2+=("^sep()") + out2+=(" $_EDIT_FAVFONTS ,geany ~/.config/mabox/fonts.list") + + + + +# Item font submenu +out2+=("^tag(mitemfont)") +out2+=("^sep($_MENU_ITEM_FONT)") +out2+=("^sep($menu_font_family $menu_font_size)") +out2+=("󰛖 $_FONT_CUSTOM,mb-setfont menu_item;$me") +out2+=("^sep($_FONT_SIZE)") +out2+=("󰧴 $_INCREASE $((menu_font_size+1)) px,mb-setvar menu_font_size=$((menu_font_size+1));$me") +out2+=("󰧳 $_DECREASE $((menu_font_size-1)) px,mb-setvar menu_font_size=$((menu_font_size-1));$me") +out2+=("^sep()") +sizes=(14 13 12 11 10 9 8) +for i in "${sizes[@]}" +do + [[ "$menu_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $i px,mb-setvar menu_font_size=$i;$me") +done + +if [ "${#favfonts[@]}" -gt 0 ];then + out2+=("^sep($_FONT_FAMILY)") + for fon in "${favfonts[@]}";do + [[ "$menu_font_family" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_font_family='${fon}'\";$me") + done +fi + out2+=("^sep()") + out2+=(" $_EDIT_FAVFONTS,geany ~/.config/mabox/fonts.list") + +# Conky + +out2+=("^tag(conkyfont)") +out2+=("^sep($_CONKYFONT)") +out2+=("^sep($C_FONT $C_FONTSIZE)") +out2+=("󰛖 $_FONT_CUSTOM,mb-setfont conky_all;$me") + +out2+=("^sep($_FONT_SIZE)") +out2+=("󰧴 $_INCREASE $((C_FONTSIZE+1)) px,conkyctl basefont_inc_all;$me") +out2+=("󰧳 $_DECREASE $((C_FONTSIZE-1)) px,conkyctl basefont_dec_all;$me") +out2+=("^sep()") +sizes=(14 13 12 11 10 9 8 7 6) +for i in "${sizes[@]}" + do + [[ "$C_FONTSIZE" == "$i" ]] && out2+=(" $i px,conkyctl basefont_size_all $i;$me") || out2+=(" $i px,conkyctl basefont_size_all $i;$me") +done + +if [ "${#favfonts[@]}" -gt 0 ];then + out2+=("^sep($_FONT_FAMILY)") + for fon in "${favfonts[@]}";do + [[ "$C_FONT" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},conkyctl basefont_family_all \"${fon}\";$me") + done +fi +out2+=("^sep()") +out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") + +out2+=("^sep($_C_EFFCTS)") +[[ "$SHADOWS" == "shadow" ]] && out2+=("󰄲 $_SHADOW,conkyctl shades_all no;$me") || out2+=("󰄱 $_SHADOW,conkyctl shades_all shadow;$me") +[[ "$SHADOWS" == "outline" ]] && out2+=("󰄲 $_OUTLINE,conkyctl shades_all no;$me") || out2+=("󰄱 $_OUTLINE,conkyctl shades_all outline;$me") + + + +# GTK 2/3 font +out2+=("^tag(gtkfont)") +out2+=("^sep($_GTK)") +out2+=("^sep($menu_font_family $menu_font_size)") +out2+=("󰛖 $_FONT_CUSTOM,mb-setfont gtk;$me") +out2+=("^sep($_FONT_SIZE)") +out2+=("󰧴 $_INCREASE $((GTK_SIZE+1)) px,fontctl gtk_fontsize inc;$me") +out2+=("󰧳 $_DECREASE $((GTK_SIZE-1)) px,fontctl gtk_fontsize dec;$me") +out2+=("^sep()") +sizes=(14 13 12 11 10 9 8) +for i in "${sizes[@]}" +do + [[ "$GTK_SIZE" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $i px,fontctl gtk_fontsize $i;$me") +done + +if [ "${#favfonts[@]}" -gt 0 ];then + out2+=("^sep($_FONT_FAMILY)") + for fon in "${favfonts[@]}";do + [[ "$GTK_FAMILY" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},fontctl gtk_fontfamily \"${fon}\";$me") + done +fi + out2+=("^sep()") + out2+=(" $_EDIT_FAVFONTS,geany ~/.config/mabox/fonts.list") + +### RUN +if [[ "$1" == "-s" ]]; then + . /usr/share/mb-jgtools/pipemenu-standalone.cfg + + + CNF_DIR="$HOME/.config/colorizer" + CNF_FILE="$CNF_DIR/colorizer.conf" + source "$CNF_FILE" + + out+=("^sep()") + out+=(" ⮜⮜⮜ Colorizer,colorizer -s") + + if [[ "$colorizer_size" == "full" ]];then + eval $(xdotool getdisplaygeometry --shell) + MENU_HEIGHT_MIN="$HEIGHT" + MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN + jgtools_radius=0 + menu_margin_x="0" + else + MENU_VALIGN="center" + menu_margin_x=${submenu_spacing:-0} + fi + + + MENU_HALIGN="left" + jgmenu_icon_size=0 + + [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius + [ -z $jgmenu_use_borders ] && menu_border=0 + JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 158)) + + #WALLPAPER + 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 + convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB} + fi + + mkconfigfile + +[[ "$GR" == "1" ]] && clr=${GR_FROM} || clr=${FG} + +cat < ${MENU_ITEMS} +@icon,,$((jgtools_padding+4)),$((jgtools_padding+4)),270,150,4,left,top,,,${THUMB} +#@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-conky.png + +@rect,,$((jgtools_padding+4)),$((jgtools_padding + 120)),270,28,0,left,top,#222222 20,#222222 70, +@text,,$((jgtools_padding + 14)),$((jgtools_padding + 110)),100,28,0,left,top,#FFFFFF ,${WINCLR}, +@text,,$((jgtools_padding + 132)),$((jgtools_padding + 120)),150,28,0,left,top,#FFFFFF ,${WINCLR},Mabox Fonts config + + +$(printf '%s\n' "${out[@]}") +$(printf '%s\n' "${out2[@]}") +EOF + + jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null + exit 0 +fi + +printf '%s\n' "${out[@]}" +printf '%s\n' "${out2[@]}" + diff --git a/bin/colorizer-menus b/bin/colorizer-menus index bcdef3f..200cf7f 100755 --- a/bin/colorizer-menus +++ b/bin/colorizer-menus @@ -64,6 +64,14 @@ case "$LANG" in PRE_GRADIENTS="Gotowe gradienty" GRADIENT_REVERSE="Odwróć kolory Gradientu" ITEM="Pozycja (element) menu " + FONT="Czcionka" + INCREASE="Powiększ do" + DECREASE="Pomniejsz do" + FONT_CUSTOM="Wybierz czcionkę i rozmiar..." + FONT_FAMILY="rodzina" + FONT_SIZE="rozmiar" + ITEM_FONT="Czcionka elementu" + TITLE_FONT="Czcionka nagłówka" COLOR_NORM_FG="Kolor tekstu" COLOR_SEL_BG="Tło aktywnej pozycji" COLOR_SEL_FG="Tekst aktywnej pozycji" @@ -109,6 +117,14 @@ case "$LANG" in PRE_GRADIENTS="Predefined gradients" GRADIENT_REVERSE="Reverse gradient colors" ITEM="Item" + FONT="Font" + INCREASE="Increase to" + DECREASE="Decrease to" + FONT_CUSTOM="Select custom font and size..." + FONT_FAMILY="font family" + FONT_SIZE="font size" + ITEM_FONT="Item Font" + TITLE_FONT="Title Font" COLOR_NORM_FG="Text Color" COLOR_SEL_BG="Selected Item Background" COLOR_SEL_FG="Selected Item Text" @@ -216,6 +232,7 @@ out+=(" 󰛖 $FONT [ $menu_font_family $menu_font_size ],^checkout(mitemfont)") out+=("$(printf '%3s' "$NFGA") AbCd $COLOR_NORM_FG,^pipe(mbclr '$NFG' jgctl color_norm_fg '${COLOR_NORM_FG}' '$me')") out+=("$(printf '%3s' "$SBGA") $COLOR_SEL_BG,^pipe(mbclr '$SBG' jgctl color_sel_bg '${COLOR_SEL_BG}' '$me')") @@ -225,7 +242,68 @@ out+=("^sep()") [[ ! -z "$NORMBG" ]] && out+=("$(printf '%3s' "$NORMBGA") $COLOR_NORM_BG,^pipe(mbclr '$NORMBG' jgctl color_norm_bg '${COLOR_NORM_BG}' '$me')" "^sep()") out+=("$ITEM_BORDER [ $IBORDER ],^checkout(itemborder)") out+=("$ITEM_RADIUS [ $IRADIUS ],^checkout(itemradius)") + +# Item font submenu +out2+=("^tag(mitemfont)") +out2+=("^sep($ITEM_FONT)") +out2+=("󰛖 $FONT_CUSTOM,mb-setfont menu_item;$me") +out2+=("^sep($FONT_SIZE)") +out2+=("󰧴 $INCREASE $((menu_font_size+1)) px,mb-setvar menu_font_size=$((menu_font_size+1));$me") +out2+=("󰧳 $DECREASE $((menu_font_size-1)) px,mb-setvar menu_font_size=$((menu_font_size-1));$me") +out2+=("^sep()") +sizes=(14 13 12 11 10 9 8) +for i in "${sizes[@]}" + do + [[ "$menu_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $i px,mb-setvar menu_font_size=$i;$me") +done + +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 + out2+=("^sep($FONT_FAMILY)") + for fon in "${favfonts[@]}";do + [[ "$menu_font_family" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_font_family='${fon}'\";$me") + done + fi + out2+=("^sep()") + out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") + + + out+=("^sep($SEPARATOR_TITLE)") +out+=("󰛖 $FONT [ $menu_sep_font_family $menu_sep_font_size ],^checkout(mtitlefont)") + +out2+=("^tag(mtitlefont)") +out2+=("^sep($TITLE_FONT)") +out2+=("󰛖 $FONT_CUSTOM,mb-setfont menu_sep;$me") + +out2+=("^sep($FONT_SIZE)") +out2+=("󰧴 $INCREASE $((menu_sep_font_size+1)) px,mb-setvar menu_sep_font_size=$((menu_sep_font_size+1));$me") +out2+=("󰧳 $DECREASE $((menu_sep_font_size-1)) px,mb-setvar menu_sep_font_size=$((menu_sep_font_size-1));$me") +out2+=("^sep()") +sizes=(14 13 12 11 10 9 8) +for i in "${sizes[@]}" + do + [[ "$menu_sep_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $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+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_sep_font_family='${fon}'\";$me") + done + fi + out2+=("^sep()") + out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") + + + + out+=("$(printf '%3s' "$TBGA") $COLOR_TITLE_BG,^pipe(mbclr '$TBG' jgctl color_title_bg '${COLOR_TITLE_BG}' '$me')") out+=("$(printf '%3s' "$TFGA") AbCd $COLOR_TITLE_FG,^pipe(mbclr '$TFG' jgctl color_title_fg '${COLOR_TITLE_FG}' '$me')") out+=("$(printf '%3s' "$TBORDERA") $COLOR_TITLE_BORDER,^pipe(mbclr '$TBORDER' jgctl color_title_border '${COLOR_TITLE_BORDER}' '$me')") diff --git a/bin/colorizer-ob b/bin/colorizer-ob index a8b243d..00a996b 100755 --- a/bin/colorizer-ob +++ b/bin/colorizer-ob @@ -48,6 +48,9 @@ case "$LANG" in TITLEBAR_TEXT="Tekst paska tytułowego" FONT="Czcionka" FONTSIZE="Rozmiar czcionki" + _INCREASE="Powiększ do" + _DECREASE="Pomniejsz do" + FONTFAMILY="Czcionka (rodzina)" BOLD="Pogrubienie" ITALIC="Kursywa" TEXTALIGN="Wyrównanie tytułu" @@ -109,7 +112,10 @@ case "$LANG" in TITLEBAR_TEXT="Title Bar Text" TITLEBAR_FONT="Title Bar Font" FONT="Font" - FONTSIZE="Font size" + FONTSIZE="font size" + _INCREASE="Increase to" + _DECREASE="Decrease to" + FONTFAMILY="font family" BOLD="Bold" ITALIC="Italic" TEXTALIGN="Title align" @@ -317,9 +323,21 @@ out2+=("^tag(titletext)") out2+=("^sep(TEXT_COLOR)") out2+=(" active title $ACTIVE_FG,^pipe(mbclr '$AFG' obtctl activetextcolor '${TEXT} ${ACTIVE_FG}' '$me')") out2+=(" inactive title $INACTIVE_FG,^pipe(mbclr '$NFG' obtctl inactivetextcolor '${TEXT} ${INACTIVE_FG}' '$me')") + + out2+=("^sep($TITLEBAR_FONT)") out2+=("$FONT... [ ${FNAME} ${FSIZE} ],mb-setfont obtitle;$me") -out2+=("^sep(font family)") +out2+=("^sep($FONTSIZE)") +out2+=("󰧴 $_INCREASE $((FSIZE+1)) px,fontctl ob_fontsize inc;$me") +out2+=("󰧳 $_DECREASE $((FSIZE-1)) px,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+=(" $i px,obtctl fontsize $i;$me") || out2+=(" $i px,obtctl fontsize $i;$me") +done + +out2+=("^sep($FONTFAMILY)") if [ -f "$HOME/.config/mabox/fonts.list" ];then mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list) @@ -337,12 +355,7 @@ fi out2+=("^sep()") [[ "$WEIGHT" =~ .*"old" ]] && out2+=(" $BOLD,obtctl fontweight Normal;$me") || out2+=(" $BOLD,obtctl fontweight Bold;$me") [[ "$SLANT" =~ .*"talic" ]] && out2+=(" $ITALIC,obtctl fontslant Normal;$me") || out2+=(" $ITALIC,obtctl fontslant Italic;$me") -out2+=("^sep($FONTSIZE)") -sizes=(16 15 14 13 12 11 10 9 8) -for i in "${sizes[@]}" -do -[[ "$FSIZE" == "$i" ]] && out2+=(" $i px,obtctl fontsize $i;$me") || out2+=(" $i px,obtctl fontsize $i;$me") -done + #SHADOW out2+=("^sep($TEXTALIGN)") [[ "$TXTJUST" = left ]] && out2+=("綠  $LEFT,obtctl textjustify left;$me")||out2+=("祿  $LEFT,obtctl textjustify left;$me") diff --git a/bin/conkyctl b/bin/conkyctl index 1ecba18..6c16bb2 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -413,6 +413,7 @@ languages () { FONTS="Czcionka" SELECTFONT="Wybierz czcionkę..." FONTFAMILY_LBL="czcionka" + _EDIT_FAVFONTS="Edytuj ulubione czcionki" FONTSIZE_LBL="rozmiar czcionki" INCREASE="Powiększ do" DECREASE="Pomniejsz do" @@ -475,6 +476,7 @@ languages () { FONTS="Font" SELECTFONT="Select Font..." FONTFAMILY_LBL="font family" + _EDIT_FAVFONTS="Edit favorite fonts list" FONTSIZE_LBL="font size" INCREASE="Increase to" DECREASE="Decrease to" @@ -537,6 +539,7 @@ languages () { FONTS="Font" SELECTFONT="Select Font..." FONTFAMILY_LBL="font family" + _EDIT_FAVFONTS="Edit favorite fonts list" FONTSIZE_LBL="font size" INCREASE="Increase to" DECREASE="Decrease to" @@ -760,54 +763,42 @@ if [[ "$OLD_SYNTAX" = "true" ]];then if [[ "$1" != *"logo_mbcolor"* ]]; then if [[ "$1" != *"quoter_mbcolor"* ]]; then - out+=("󰛖 $FONTS [ $FONT $FONTSIZE ],^checkout(fontsingle)") - out2+=("^tag(fontsingle)") - out2+=("^sep($FONTS)") - out2+=("󰛖 $SELECTFONT [ $FONT $FONTSIZE ],mb-setfont conky_single ${1};$me") - - - 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 - #notify-send.sh "Ile" "${#favfonts[@]}" - if [ "${#favfonts[@]}" -gt 0 ];then - out2+=("^sep($FONTFAMILY_LBL)") - for fon in "${favfonts[@]}";do - [[ "$FONT" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},conkyctl basefont_family ${1} \"${fon}\";$me") - done - fi - out2+=("^sep()") - out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") - out2+=("^sep($FONTSIZE_LBL)") - out2+=("󰧴 $INCREASE $((FONTSIZE+1)) px,conkyctl basefont_inc ${1};$me") - out2+=("󰧳 $DECREASE $((FONTSIZE-1)) px,conkyctl basefont_dec ${1};$me") - out2+=("^sep()") - sizes=(14 13 12 11 10 9 8 7 6) - for i in "${sizes[@]}" - do - [[ "$FONTSIZE" == "$i" ]] && out2+=(" $i px,conkyctl basefont_size ${1} $i;$me") || out2+=(" $i px,conkyctl basefont_size ${1} $i;$me") - done + out+=("󰛖 $FONTS [ $FONT $FONTSIZE ],^checkout(fontsingle)") + out2+=("^tag(fontsingle)") + out2+=("^sep($FONTS)") + out2+=("󰛖 $SELECTFONT [ $FONT $FONTSIZE ],mb-setfont conky_single ${1};$me") + out2+=("^sep($FONTSIZE_LBL)") + out2+=("󰧴 $INCREASE $((FONTSIZE+1)) px,conkyctl basefont_inc ${1};$me") + out2+=("󰧳 $DECREASE $((FONTSIZE-1)) px,conkyctl basefont_dec ${1};$me") + out2+=("^sep()") + sizes=(14 13 12 11 10 9 8 7 6) + for i in "${sizes[@]}" + do + [[ "$FONTSIZE" == "$i" ]] && out2+=(" $i px,conkyctl basefont_size ${1} $i;$me") || out2+=(" $i px,conkyctl basefont_size ${1} $i;$me") + done + 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 + #notify-send.sh "Ile" "${#favfonts[@]}" + if [ "${#favfonts[@]}" -gt 0 ];then + out2+=("^sep($FONTFAMILY_LBL)") + for fon in "${favfonts[@]}";do + [[ "$FONT" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},conkyctl basefont_family ${1} \"${fon}\";$me") + done + fi + out2+=("^sep()") + out2+=(" $_EDIT_FAVFONTS,geany ~/.config/mabox/fonts.list") fi - - - [[ "$SHADOWS" == "shadow" ]] && out+=("󰄲 $SHADOW,conkyctl shades no ${1};$me") || out+=("󰄱 $SHADOW,conkyctl shades shadow ${1};$me") [[ "$SHADOWS" == "outline" ]] && out+=("󰄲 $OLINE,conkyctl shades no ${1};$me") || out+=("󰄱 $OLINE,conkyctl shades outline ${1};$me") out+=("^sep()") - #out+=("$OLINE/$SHADOW [ $SHADOWS ],^checkout(outline2)") - #out2+=("^tag(outline2)") - #out2+=("^sep($DRAW $OLINE/$SHADOW?)") - #out2+=("$NO,conkyctl shades no ${1};$me") - #out2+=("^sep()") - #out2+=("$DRAW $SHADOW,conkyctl shades shadow ${1};$me") - #out2+=("$DRAW $OLINE,conkyctl shades outline ${1};$me") - #out+=("^sep()") fi + [[ "$BORD" == false ]] && out+=("󰄱 $BORDERS [ $STIP ],^checkout(bordersingle)") || out+=("󰄲 $BORDERS [ $STIP ],^checkout(bordersingle)") out2+=("^tag(bordersingle)") out2+=("^sep($DRAW $BORDERS?)") diff --git a/bin/fontctl b/bin/fontctl new file mode 100755 index 0000000..aaa4228 --- /dev/null +++ b/bin/fontctl @@ -0,0 +1,146 @@ +#!/bin/bash + +# fontctl - cli to handle fonts in Mabox: openbox, jgmenu, tint2, conky, gtk +CONKYDIR="$HOME"/.config/conky +BASECONKY="$CONKYDIR/sysinfo_mbcolor.conkyrc" +. $HOME/.config/mabox/mabox.conf + +get_gtkfont() { +GTK2RC="$HOME"/.gtkrc-2.0 +GTK3RC="$HOME"/.config/gtk-3.0/settings.ini + +GTK_FONT=( $(grep "gtk-font-name" ${GTK2RC} | cut -d'"' -f2) ) +GTK_FAMILY=${GTK_FONT[@]::${#GTK_FONT[@]}-1} +GTK_SIZE=${GTK_FONT[-1]} +} + +gtk_fontfamily() { + get_gtkfont + sd "^gtk-font-name=.*" "gtk-font-name=\"${1} ${GTK_SIZE}\"" ${GTK2RC} + sd "^gtk-font-name=.*" "gtk-font-name=${1} ${GTK_SIZE}" ${GTK3RC} + reload-gtk +} +gtk_fontsize() { + get_gtkfont + case "$1" in + inc) SIZE=$((GTK_SIZE+1));; + dec) SIZE=$((GTK_SIZE-1));; + *) SIZE=${1};; + esac + sd "^gtk-font-name=.*" "gtk-font-name=\"${GTK_FAMILY} ${SIZE}\"" ${GTK2RC} + sd "^gtk-font-name=.*" "gtk-font-name=${GTK_FAMILY} ${SIZE}" ${GTK3RC} + reload-gtk +} +resetgtk() { + get_gtkfont + sd "^gtk-font-name=.*" "gtk-font-name=\"Ubuntu 10\"" ${GTK2RC} + sd "^gtk-font-name=.*" "gtk-font-name=Ubuntu 10" ${GTK3RC} + reload-gtk +} +resetob () { + 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:name' -v "Ubuntu" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:name' -v "Ubuntu" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' -v 9 "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:size' -v 9 "$cfg" + + #add Weight and slant + + openbox --reconfigure +} +resetmenus () { + mb-setvar menu_font_size=10 + mb-setvar menu_sep_font_size=11 + mb-setvar "menu_font_family=\'Ubuntu\'" + mb-setvar "menu_sep_font_family=\'Ubuntu Bold\'" +} +resetconky () { + sd "font .*=.*,$" "font = 'Ubuntu:size=8'," ${CONKYDIR}/*mbcolor.conkyrc +} +resetall () { + resetconky + resetob + resetmenus + resetgtk + + } + +inc_all() { + gtk_fontsize inc + inc_conky + inc_menus +} +dec_all() { + gtk_fontsize dec + dec_conky + dec_menus +} +inc_conky () { + read FONTDEF <<< "$(grep "font .*=.*,$" ${BASECONKY} | cut -d'=' -f2,3 |cut -d"'" -f2)" + FONT=${FONTDEF%:*} + FONTSIZE=${FONTDEF#*=} + ((FONTSIZE++)) + sd "font .*=.*,$" "font = '${FONT}:size=${FONTSIZE}'," ${CONKYDIR}/*mbcolor.conkyrc +} +dec_conky () { + read FONTDEF <<< "$(grep "font .*=.*,$" ${BASECONKY} | cut -d'=' -f2,3 |cut -d"'" -f2)" + FONT=${FONTDEF%:*} + FONTSIZE=${FONTDEF#*=} + ((FONTSIZE--)) + sd "font .*=.*,$" "font = '${FONT}:size=${FONTSIZE}'," ${CONKYDIR}/*mbcolor.conkyrc +} +inc_menus () { + mb-setvar menu_font_size=$((menu_font_size+1)) + mb-setvar menu_sep_font_size=$((menu_sep_font_size+1)) +} +dec_menus () { + mb-setvar menu_font_size=$((menu_font_size-1)) + mb-setvar menu_sep_font_size=$((menu_sep_font_size-1)) +} +ob_fontsize () { + nspace="http://openbox.org/3.4/rc" + cfg="$HOME/.config/openbox/rc.xml" + case "$1" in + inc|increase) + SIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$cfg") + if [ "$SIZE" -lt "21" ];then + ((SIZE=SIZE+1)) + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' -v "$SIZE" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:size' -v "$SIZE" "$cfg" + fi + ;; + dec|decrease) + SIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$cfg") + if [ "$SIZE" -gt "7" ];then + ((SIZE=SIZE-1)) + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' -v "$SIZE" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:size' -v "$SIZE" "$cfg" + fi + ;; + *) + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' -v "$1" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:size' -v "$1" "$cfg" + ;; + esac + openbox --reconfigure +} + +case "$1" in + gtk_fontfamily) gtk_fontfamily "$2";; + gtk_fontsize) gtk_fontsize "$2";; + inc_all) inc_all;; + dec_all) dec_all;; + inc_conky) inc_conky;; + dec_conky) dec_conky;; + inc_menus) inc_menus;; + dec_menus) dec_menus;; + ob_fontsize) ob_fontsize "$2";; # arg: size, inc or dec + resetall) resetall;; + resetob) resetob;; + resetmenus) resetmenus;; + resetconky) resetconky;; + resetgtk) resetgtk;; + *):;; +esac diff --git a/bin/obtctl b/bin/obtctl index e0c7a39..83a27bb 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -402,7 +402,7 @@ fontsize () { nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" case "$1" in - increase) + inc|increase) SIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$cfg") if [ "$SIZE" -lt "21" ];then ((SIZE=SIZE+1)) @@ -410,7 +410,7 @@ fontsize () { xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:size' -v "$SIZE" "$cfg" fi ;; - decrease) + dec|decrease) SIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$cfg") if [ "$SIZE" -gt "7" ];then ((SIZE=SIZE-1)) @@ -484,21 +484,21 @@ randomizer () { activegradient "$CLR" "$CLRTO" ### rand gradient type - TYPES=(solid vertical horizontal mirrorhorizontal splitvertical) - rand=$((RANDOM%5)) + TYPES=(solid vertical horizontal mirrorhorizontal diagonal pyramid) + rand=$((RANDOM%6)) G_TYPE="${TYPES[$rand]}" gradient_type "${G_TYPE}" #rand ### Random border BORDERS=(0 1 2 4) - rand=$((RANDOM%4)) + rand=$((RANDOM%3)) BORDER="${BORDERS[$rand]}" borderWidth "${BORDER}" ### Random padding - PADDINGS=(2 4 8 12 16) + PADDINGS=(2 4 8 12) rand=$((RANDOM%4)) PADDING="${PADDINGS[$rand]}" @@ -511,13 +511,7 @@ randomizer () { raised "${STYLE}" - ### Buttons - BUTTONS=(tiny normal bold dots) - rand=$((RANDOM%4)) - BUTTON="${BUTTONS[$rand]}" - - buttons "${BUTTON}" - + ### TEXT ALIGN ALIGNS=(left center right) rand=$((RANDOM%3)) @@ -526,8 +520,8 @@ randomizer () { textjustify "${ALIGN}" ### FONT FAMILY - FAMILIES=(Ubuntu Sans "Roboto Condensed" "GE Inspira") - rand=$((RANDOM%4)) + FAMILIES=(Ubuntu "Noto Sans" "Roboto Condensed" "GE Inspira" "JetBrains Mono") + rand=$((RANDOM%5)) FAMILY="${FAMILIES[$rand]}" fontfamily "${FAMILY}" @@ -555,6 +549,13 @@ randomizer () { fontsize "${FONTSIZE}" + ### Buttons + BUTTONS=(tiny normal bold dots big-12 big-14) + rand=$((RANDOM%6)) + BUTTON="${BUTTONS[$rand]}" + + buttons "${BUTTON}" + #MSG=" #Openbox Window Decoration settings