diff --git a/bin/colorizer b/bin/colorizer index f57125c..85f3829 100755 --- a/bin/colorizer +++ b/bin/colorizer @@ -138,7 +138,7 @@ case "$LANG" in ACCENT="accent - zmień kolor akcentu" SELECT="select - wybierz akcję..." DIFF_CONKY_COLORS="Różne kolory dla Conky" - HELP="Pomoc" + HELP="Okno główne i Pomoc" RESET_COLORS="Resetuj kolory" RESET_CHOOSE="Resetuj..." RESET_SEP="Resetuj kolory dla" @@ -229,7 +229,7 @@ case "$LANG" in ACCENT="accent - chenge accent color" SELECT="select - select action" DIFF_CONKY_COLORS="Different colors for each Conky" - HELP="About and Help" + HELP="Main Window and Help" RESET_COLORS="Reset Colors" RESET_CHOOSE="Reset..." RESET_SEP="Resey Colors of ..." @@ -274,20 +274,12 @@ out+=("^sep(Mabox Colorizer)") out+=(" $SETTINGS,^checkout(settings)") LNG=${LANG:0:2} if [[ -f "/usr/share/mabox-colorizer/help/$LNG.html" ]];then -out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/$LNG.html 'Mabox Help - Colorizer'") +out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/$LNG.html 'Mabox Colorizer'") else -out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/en.html 'Mabox Help - Colorizer'") +out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/en.html 'Mabox Colorizer'") fi out+=("^sep()") -out+=("北 $REGENERATE,^checkout(regen)") - out2+=("^tag(regen)") - out2+=("^sep($REGENERATEALL)") - out2+=(" $ASCONFIGURED,w2theme colorize;colorizer -s") - out2+=(" $REVERSE,w2theme reverse;colorizer -s") - #out2+=("^sep($CURRENTCONF)") - #out2+=("$MENUPANELS [ ${wall2themes_menu} ],^checkout(mp)") - #out2+=("Conky [ ${wall2themes_conky} ],^checkout(conky)") - #out2+=("PyRadio [ ${wall2themes_pyradio} ],^checkout(pyradio)") +out+=(" Randomizer,^pipe(randomizer c)") out+=("^sep($MODULES)") out+=("$OBTHEME,^pipe(colorizer-ob)") out+=("Conky,^pipe(colorizer-conky)") @@ -301,6 +293,16 @@ if pgrep -f pyradio >/dev/null ;then fi out+=("^sep($WALLCOLORS)") +out+=("北 $REGENERATE,^checkout(regen)") + out2+=("^tag(regen)") + out2+=("^sep($REGENERATEALL)") + out2+=(" $ASCONFIGURED,w2theme colorize;colorizer -s") + out2+=(" $REVERSE,w2theme reverse;colorizer -s") + #out2+=("^sep($CURRENTCONF)") + #out2+=("$MENUPANELS [ ${wall2themes_menu} ],^checkout(mp)") + #out2+=("Conky [ ${wall2themes_conky} ],^checkout(conky)") + #out2+=("PyRadio [ ${wall2themes_pyradio} ],^checkout(pyradio)") + [[ $rootcolors = select ]]&& out+=("^sep($SELECT_ACTION)")||out+=("^sep($ACCENTINFO)") n=0 for i in "${w[@]}" @@ -512,15 +514,16 @@ if [[ "$gradient_obtheme" == "yes" || "$gradient_menu" == "yes" ]];then out+=("^sep($GRADIENTS $OBGRAD $MENUGRAD)") out+=(" $PRE_GRADIENTS,^pipe(mbgrad)") fi -out+=("^sep($RESET_COLORS)") -out+=("$RESET_CHOOSE,^checkout(resetroot)") -out2+=("^tag(resetroot)") -out2+=("^sep($RESET_SEP)") -out2+=("$RES_OB_WD,obtctl resetMBcolors;colorizer -s") -out2+=("$RES_MENU,jgctl reset;colorizer -s") -out2+=("$RES_CONKY,conkyctl resetcolorsall;colorizer -s") -out2+=("^sep()") -out2+=("\"\"\"$RES_ALL\"\"\",obtctl resetMBcolors;conkyctl resetcolorsall;jgctl reset;colorizer -s") +### RESET ACTIONS (replaced by Randomizer) +#out+=("^sep($RESET_COLORS)") +#out+=("$RESET_CHOOSE,^checkout(resetroot)") +#out2+=("^tag(resetroot)") +#out2+=("^sep($RESET_SEP)") +#out2+=("$RES_OB_WD,obtctl resetMBcolors;colorizer -s") +#out2+=("$RES_MENU,jgctl reset;colorizer -s") +#out2+=("$RES_CONKY,conkyctl resetcolorsall;colorizer -s") +#out2+=("^sep()") +#out2+=("\"\"\"$RES_ALL\"\"\",obtctl resetMBcolors;conkyctl resetcolorsall;jgctl reset;colorizer -s") if [[ "$related_tools" == "show" ]];then out+=(". $CUSTOM_COMMANDS_FILE") @@ -692,8 +695,8 @@ if [[ "$1" == "-s" ]]; then mkconfigfile #THUMB="$(DISPLAY=:0 scrot -t 220x100 -o $HOME/.config/mabox/colorizer.png -e 'echo $m')" case "$LANG" in - pl*) THGEN="generuj motywy :";; - *) THGEN="theme generation:";; + pl*) THGEN="generuj motywy:";; + *) THGEN="auto theming:";; esac if [ "$wall2themes" = "yes" ]; then FGCOL="limegreen" diff --git a/bin/colorizer-conky b/bin/colorizer-conky index 658ed36..1f799f8 100755 --- a/bin/colorizer-conky +++ b/bin/colorizer-conky @@ -137,7 +137,7 @@ if pgrep -af "conky.*mbcolor" >/dev/null; then [[ "$WINTRANS" == false ]] && BG="bgcolor='$WINCLR'" || BG="" out+=("^sep($COLORIZECONKY)") - out+=(" $MOVEABLEALL,conkyctl makemoveableall") + out+=(" $MOVEABLEALL,conkyctl makemoveableall") out+=("^sep($GLOBALSETTINGS)") out+=(" $REGENERATE,^checkout(regenconky)") out2+=("^tag(regenconky)") diff --git a/bin/colorizer-ob b/bin/colorizer-ob index 097237d..f43cafc 100755 --- a/bin/colorizer-ob +++ b/bin/colorizer-ob @@ -309,15 +309,15 @@ out2+=("$SUNKEN,obtctl raised 2;$me") #GRADIENT out2+=("^tag(gradient)") out2+=("^sep($GRADIENT_TYPE)") -out2+=("$SOLID_COLOR,obtctl gradient solid;$me") +out2+=("$SOLID_COLOR,obtctl gradient_type solid;$me") out2+=("^sep()") -out2+=("$VERTICAL,obtctl gradient vertical;$me") -out2+=("$HORIZONTAL,obtctl gradient horizontal;$me") -out2+=("$MIRRORHORIZONTAL,obtctl gradient mirrorhorizontal;$me") -out2+=("$SPLITVERTICAL,obtctl gradient splitvertical;$me") -out2+=("$DIAGONAL,obtctl gradient diagonal;$me") -out2+=("$CROSSDIAGONAL,obtctl gradient crossdiagonal;$me") -out2+=("$PYRAMID,obtctl gradient pyramid;$me") +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") #HANDLE out2+=("^tag(handle)") diff --git a/bin/conkyctl b/bin/conkyctl index ed3f79a..5e5d584 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -1,12 +1,12 @@ #!/bin/bash # -# conkyctl +# conkyctl - script to handle various Conky operations in Mabox CONKYDIR="$HOME/.config/conky" BASECONKY="$CONKYDIR/sysinfo_mbcolor.conkyrc" SESSIONFILE="$CONKYDIR/conky-sessionfile" COLORIZERDIR="$HOME/.config/colorizer" CONKYTHEMEDIR="$COLORIZERDIR/conky/themes" -CONKYTHEMEDIR="$COLORIZERDIR/conky/themes" + if [ ! -d "$CONKYTHEMEDIR" ];then mkdir -p "$CONKYTHEMEDIR" rsync -a /usr/share/mabox-colorizer/themes/conky/* ${CONKYTHEMEDIR}/ @@ -35,8 +35,7 @@ win_bgcolor_all () { win_bgcolor () { sd "own_window_colour .*=.*$" "own_window_colour = '${1}'," ${2} sd "own_window_transparent.*$" "own_window_transparent = false," ${2} - - #notify-send.sh "${FG_COLOR}" "${2}" + } draw_borders_all () { sd "draw_borders.*$" "draw_borders = ${1}," ${CONKYDIR}/*mbcolor.conkyrc @@ -556,11 +555,11 @@ single () { [[ "$WINTRANS" == false ]] && BG="bgcolor='$WINCLR'" || BG="" out+=("^sep(Conky: [ ${title^} ])") + out+=(" $POSITION,^checkout(position)") if [[ "$1" =~ "etwork_mbcolor" ]]; then out+=("$NOT_WORKING,conkyctl netdevice") fi #out+=("^sep($POSITION)") - out+=(" $POSITION,^checkout(position)") out2+=("^tag(position)") out2+=("^sep($POSITION)") out2+=(" $MARKNEWPOS,conkyctl setpos ${1};$me") @@ -794,12 +793,6 @@ contextmenu () { #notify-send.sh -t 0 "Window" "z xdotool: ${WINDOW} \n X $X \n Y $Y \n hexid: $hexid \n $CONKYCFG \n ${WINCLR}\n ${name}\n $HOME/.config/mabox/${name}.csv" - #if [ ! -f ${CONKYDIR}/menuscripts/${name}.csv ]; then - #touch $HOME/.config/mabox/${name}.csv - #CUSTOMCOMMANDS="" - #else - #CUSTOMCOMMANDS=". ${CONKYDIR}/menuscripts/${name}.csv" - #fi . /usr/share/mb-jgtools/pipemenu-standalone.cfg . $HOME/.config/mabox/mabox.conf @@ -899,10 +892,10 @@ cmdmenu () { bash "${CONKYDIR}/menuscripts/${name}" exit 0 fi - + # if CSV for menu exist show it if [ -f ${CONKYDIR}/menuscripts/${name}.csv ]; then LINES=$(grep -Ev "^#|^$" ${CONKYDIR}/menuscripts/${name}.csv|wc -l) - notify-send.sh "$LINES" + #notify-send.sh "$LINES" if [ ${LINES} != 0 ]; then CUSTOMCOMMANDS=". ${CONKYDIR}/menuscripts/${name}.csv" else @@ -912,8 +905,7 @@ cmdmenu () { contextmenu fi - #notify-send.sh "Conky cmdmenu" "${filename}\n${name}\n${title}" - # otherwise build and show standalone menu with custom commands + # otherwise build and show standalone menu with custom commands sleep .2 read WINTRANS <<< "$(grep own_window_transparent ${CONKYCFG} | cut -d'=' -f2 | cut -d"," -f1)" diff --git a/bin/jgctl b/bin/jgctl index eaab541..28b1cbb 100755 --- a/bin/jgctl +++ b/bin/jgctl @@ -15,12 +15,21 @@ esac if [ ! -f "${THEMERC}.bak" ]; then cp ${THEMERC} ${THEMERC}.bak fi - +theme () { + mb-setvar jgmenu_theme=${1} +} reset () { rm ${THEMERC} mv ${THEMERC}.bak ${THEMERC} } - +resetMBcolors() { + mb-setvar jgmenu_theme=MBcolors + reset + case "$1" in + show) colorizer-menus -s;; + *):;; + esac +} color_menu_bg () { read MBG MBGA<<< "$(grep 'color_menu_bg ' ${THEMERC} | cut -d'=' -f2)" case "${#1}" in @@ -206,7 +215,9 @@ color_sel_border () { esac } case "$1" in + theme) theme "$2";; reset) reset ;; + resetMBcolors) resetMBcolors "$2";; color_menu_bg) color_menu_bg "$2";; color_menu_bg_to) color_menu_bg_to "$2";; color_menu_border) color_menu_border "$2";; diff --git a/bin/mbclr b/bin/mbclr index e78e058..aa0afc3 100755 --- a/bin/mbclr +++ b/bin/mbclr @@ -92,12 +92,10 @@ out2+=(" 5 < out2+=(" 0 ,jgctl $3 0 ;${5}") fi - - #Current out+=("^sep($SELECT_COLOR)") -out+=(" $PICK_FROM_SCREEN,mbclr pixelcolor $2 $3 ${5} ${6}") -out+=(" $SELECT_OR_PICK,mbclr pick $2 $3 ${5} ${6}") +out+=(" $PICK_FROM_SCREEN,mbclr pixelcolor $2 $3 ${5} ${6}") +out+=(" $SELECT_OR_PICK,mbclr pick $2 $3 ${5} ${6}") out+=("^sep()") out+=(" $SHADES_OF_CURRENT ($1),^checkout(curshades)") diff --git a/bin/obtctl b/bin/obtctl index 913a8a8..d9b1e8f 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -26,6 +26,19 @@ reset () { resetMBcolors() { theme MBcolors rsync -a /usr/share/mabox-colorizer/themes/MBcolors/openbox-3/* ${MBCOLORSDIR}/ + #set font + 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="ActiveWindow"]/a:size' -v "9" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:weight' -v "Bold" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' -v "Normal" "$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="InactiveWindow"]/a:size' -v "9" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:weight' -v "Bold" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:slant' -v "Normal" "$cfg" } borderWidth () { @@ -84,17 +97,17 @@ textjustify () { } shadow () { case "$1" in - 0) + 0|no) sd "\.active.label.text.font:.*$" ".active.label.text.font: shadow=n:shadowtint=70:shadowoffset=1" ${THEMERC} sd "\.inactive.label.text.font:.*$" ".inactive.label.text.font: shadow=n:shadowtint=20:shadowoffset=1" ${THEMERC} ;; - 1) + 1|dark) sd "\.active.label.text.font:.*$" ".active.label.text.font: shadow=y:shadowtint=70:shadowoffset=1" ${THEMERC} - sd "\.inactive.label.text.font:.*$" ".inactive.label.text.font: shadow=y:shadowtint=20:shadowoffset=1" ${THEMERC} + #sd "\.inactive.label.text.font:.*$" ".inactive.label.text.font: shadow=y:shadowtint=20:shadowoffset=1" ${THEMERC} ;; - 2) - sd "\.active.label.text.font:.*$" ".active.label.text.font: shadow=y:shadowtint=-70:shadowoffset=1" ${THEMERC} - sd "\.inactive.label.text.font:.*$" ".inactive.label.text.font: shadow=y:shadowtint=-20:shadowoffset=1" ${THEMERC} + 2|light) + sd "\.active.label.text.font:.*$" ".active.label.text.font: shadow=y:shadowtint=-40:shadowoffset=1" ${THEMERC} + #sd "\.inactive.label.text.font:.*$" ".inactive.label.text.font: shadow=y:shadowtint=-20:shadowoffset=1" ${THEMERC} ;; esac @@ -106,24 +119,24 @@ raised () { #flat 0 or raised 1 or sunken 2 read WINRAISED REST <<< "$(grep .title.bg: ${THEMERC} | cut -d':' -f2)" case "$1" in - 0) + 0|flat) sd "\.title.bg:.*$" ".title.bg: flat ${REST}" ${THEMERC} sd "\.handle.bg:.*$" ".handle.bg: flat ${REST}" ${THEMERC} sd "\.grip.bg:.*$" ".grip.bg: flat ${REST}" ${THEMERC} ;; - 1) + 1|raised) sd "\.title.bg:.*$" ".title.bg: raised ${REST}" ${THEMERC} sd "\.handle.bg:.*$" ".handle.bg: raised ${REST}" ${THEMERC} sd "\.grip.bg:.*$" ".grip.bg: raised ${REST}" ${THEMERC} ;; - 2) + 2|sunken) sd "\.title.bg:.*$" ".title.bg: sunken ${REST}" ${THEMERC} sd "\.handle.bg:.*$" ".handle.bg: sunken ${REST}" ${THEMERC} sd "\.grip.bg:.*$" ".grip.bg: sunken ${REST}" ${THEMERC} ;; esac } -gradient () { +gradient_type () { #solid or gradient gradient-type read WINRAISED REST <<< "$(grep .title.bg: ${THEMERC} | cut -d':' -f2)" case "$1" in @@ -139,6 +152,14 @@ gradient () { ;; esac } +random_gradient () { + GRADIENT_FILE="$HOME"/.config/colorizer/gradients_all.inc + if [ ! -f $GRADIENT_FILE ]; then + cp -a /usr/share/mabox-colorizer/gradients_all.inc $GRADIENT_FILE + fi + read CLR CLRTO REST <<< "$(shuf -n 1 $GRADIENT_FILE)" + activegradient "$CLR" "$CLRTO" +} activegradient () { #notify-send.sh "zmiennne obtctl" "${1} ${2}" #sd "\.active.handle.bg.color:.*$" ".active.handle.bg.color: ${1}" ${THEMERC} @@ -159,6 +180,17 @@ activegradient () { # 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" == "#EEEEEE" ];then + shadow dark + else + shadow light + fi + fi + + } activegradient_reverse () { : @@ -275,6 +307,7 @@ clrnormalbgto () { } activetextcolor () { sd "\.active.label.text.color:.*$" ".active.label.text.color: ${1}" ${THEMERC} + activebuttonscolors ${1} } inactivetextcolor () { sd "\.inactive.label.text.color:.*$" ".inactive.label.text.color: ${1}" ${THEMERC} @@ -292,6 +325,13 @@ activebuttonscolors () { #disabled=$() sd "^window.active.button.*.hover.image.color:.*$" "window.active.button.*.hover.image.color: ${hover}" ${THEMERC} } +fontfamily () { + 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 "${1}" "$cfg" + xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="InactiveWindow"]/a:name' -v "${1}" "$cfg" +} fontsize () { nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" @@ -318,6 +358,14 @@ fontsize () { ;; esac } +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" + +} fontweighttoggle (){ nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" @@ -328,6 +376,13 @@ fontweighttoggle (){ xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:weight' -v "Normal" "$cfg" fi } +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" +} fontslanttoggle (){ nspace="http://openbox.org/3.4/rc" cfg="$HOME/.config/openbox/rc.xml" @@ -338,6 +393,119 @@ fontslanttoggle (){ xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' -v "Normal" "$cfg" fi } +randomizer () { + + # TODO: - maybe put all options to cnf file and let users cistomize oprions??? + + ### ensure we use MBColors at the moment + theme MBcolors + ### SHADOW (here, because we must know if is set later when title font color is calculated) + SHADOWS=(no dark light) + rand=$((RANDOM%3)) + SHADOW="${SHADOWS[$rand]}" + + obtctl shadow "${SHADOW}" + + ### RANDOM GRADIENT COLORS + GRADIENT_FILE="$HOME"/.config/colorizer/gradients_all.inc + if [ ! -f $GRADIENT_FILE ]; then + cp -a /usr/share/mabox-colorizer/gradients_all.inc $GRADIENT_FILE + fi + read CLR CLRTO GRAD_NAME <<< "$(shuf -n 1 $GRADIENT_FILE)" + #obtctl random_gradient + activegradient "$CLR" "$CLRTO" + + ### rand gradient type + TYPES=(solid vertical horizontal mirrorhorizontal splitvertical) + rand=$((RANDOM%5)) + G_TYPE="${TYPES[$rand]}" + gradient_type "${G_TYPE}" + #rand + + ### Random border + BORDERS=(0 1 2 4) + rand=$((RANDOM%4)) + BORDER="${BORDERS[$rand]}" + + borderWidth "${BORDER}" + + ### Random padding + PADDINGS=(2 4 8 12 16) + rand=$((RANDOM%4)) + PADDING="${PADDINGS[$rand]}" + + paddingHeight "${PADDING}" + + ### TITLEBAR STYLE + STYLES=(flat raised sunken) + rand=$((RANDOM%3)) + STYLE="${STYLES[$rand]}" + + 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)) + ALIGN="${ALIGNS[$rand]}" + + textjustify "${ALIGN}" + + ### FONT FAMILY + FAMILIES=(Ubuntu Sans Serif "Roboto Condensed" "GE Inspira") + rand=$((RANDOM%5)) + FAMILY="${FAMILIES[$rand]}" + + fontfamily "${FAMILY}" + + ### FONT WEIGHT + WEIGHTS=(Bold Normal) + rand=$((RANDOM%2)) + WEIGHT="${WEIGHTS[$rand]}" + + fontweight "${WEIGHT}" + + ### FONT SLANT + SLANTS=(Italic Normal) + rand=$((RANDOM%2)) + SLANT="${SLANTS[$rand]}" + + fontslant "${SLANT}" + + + + ### FONT SIZE + FONTSIZES=(8 10 11 12 14 16) + rand=$((RANDOM%6)) + FONTSIZE="${FONTSIZES[$rand]}" + + fontsize "${FONTSIZE}" + + +MSG=" +Openbox Window Decoration settings +Gradient +name: ${GRAD_NAME} +colors: ${CLR} to ${CLRTO} +type: $G_TYPE + +Border: ${BORDER} +Padding: ${PADDING} + +Titlebar style: ${STYLE} +Buttons: ${BUTTON} +Title align: ${ALIGN} +Font: ${FAMILY} ${WEIGHT} ${SLANT} ${FONTSIZE} +" + notify-send.sh -R /tmp/randomizer_notify -t 10000 -i mbcc "Mabox Colorizer" "${MSG}" \ + -o "Regenerate:randomizer ob" -o "Customize:colorizer-ob -s" +} case "$1" in theme) theme "$2";; @@ -352,7 +520,8 @@ case "$1" in shadow) shadow "$2";; handlewidth) handlewidth "$2";; raised) raised "$2";; - gradient) gradient "$2";; + gradient_type) gradient_type "$2";; + random_gradient) random_gradient;; activegradient) activegradient "$2" "$3";; activehandle) activehandle "$2";; clractivebg) clractivebg "$2";; @@ -363,9 +532,13 @@ case "$1" in inactivetextcolor) inactivetextcolor "$2";; buttons) buttons "$2";; activebuttonscolors) activebuttonscolors "$2";; + fontfamily) fontfamily "$2";; + fontweight) fontweight "$2";; + fontslant) fontslant "$2";; fontsize) fontsize "$2";; fontweighttoggle) fontweighttoggle;; fontslanttoggle) fontslanttoggle;; + randomizer) randomizer;; *) : ;; esac diff --git a/bin/randomizer b/bin/randomizer new file mode 100755 index 0000000..2f9641b --- /dev/null +++ b/bin/randomizer @@ -0,0 +1,104 @@ +#!/bin/bash + +# randomizer + +ob () { + obtctl randomizer +} +menu () { + mb-setvar jgmenu_theme=$(basename -s .colorrc $(ls ~/.config/mabox/jgobthemes/*.colorrc | shuf -n 1)) + case "$1" in + show) colorizer-menus -s;; + *):;; + esac +} +conky () { + #set random saved colorscheme + COLORIZERDIR="$HOME/.config/colorizer" + CONKYTHEMEDIR="$COLORIZERDIR/conky/themes" + if [ ! -d "$CONKYTHEMEDIR" ];then + mkdir -p "$CONKYTHEMEDIR" + rsync -a /usr/share/mabox-colorizer/themes/conky/* ${CONKYTHEMEDIR}/ + fi + RAND_FILENAME=$(ls ~/.config/colorizer/conky/themes/*.colors|shuf -n 1) + RAND_THEME=${RAND_FILENAME##*/} + #notify-send.sh "$RAND_THEME" + + conkyctl settheme_all ${RAND_THEME} +} +wp () { + : # Może niepotrzebne tu +} +all () { + ob + conky + menu colorizer-menus +} +resetall () { + conkyctl resetcolorsall + obtctl resetMBcolors + jgctl resetMBcolors show + +} +pipemenu () { + me="" + [[ "$1" == "l" ]] && me="mb-jgtools places" + [[ "$1" == "c" ]] && me="colorizer -s" + #notify-send.sh "Me $me" + + case "$LANG" in + pl*) + SETRANDOM="Ustaw losowy motyw dla..." + MENUS="Menu i Panele boczne" + OBWD="Dekoracja okien Openbox" + ALL="Wszystko" + RESET_TO_DEFAULT="Resetuj do ustawień domyślnych..." + HELP="Okno Główne i Pomoc" + ;; + es*) + SETRANDOM="Set random colorscheme for..." + MENUS="Menus n Panels" + OBWD="OpenBox Window Decoration" + ALL="All" + RESET_TO_DEFAULT="Reset to default settings..." + HELP="Main Window and Help" + ;; + en*) + SETRANDOM="Set random colorscheme for..." + MENUS="Menus n Panels" + OBWD="OpenBox Window Decoration" + ALL="All" + RESET_TO_DEFAULT="Reset to default settings..." + HELP="Main Window and Help" + ;; + esac + out+=("^sep($SETRANDOM)") + out+=("$MENUS,randomizer menu;$me") + out+=("$OBWD,randomizer ob;$me") + out+=("Conky,randomizer conky;$me") + out+=("^sep()") + out+=("$ALL,randomizer all;$me") + out+=("^sep($RESET_TO_DEFAULT)") + out+=("$MENUS,jgctl resetMBcolors;$me") + out+=("$OBWD,obtctl resetMBcolors;$me") + out+=("Conky,conkyctl resetcolorsall;$me") + out+=("^sep()") + out+=("$ALL,randomizer resetall;$me") + out+=("^sep(Colorizer)") + out+=("Colorizer - $HELP,ycolorizer") + + printf '%s\n' "${out[@]}" +} + + + + +case "$1" in + ob) ob;; + menu) menu "${2}";; + conky) conky;; + wp) wp;; + all) all;; + resetall)resetall;; + l|c|*) pipemenu "$1";; +esac diff --git a/bin/ycolorizer b/bin/ycolorizer new file mode 100755 index 0000000..4f63d1a --- /dev/null +++ b/bin/ycolorizer @@ -0,0 +1,10 @@ +#!/bin/bash +# ycolorizer - launch Colorizer main window and Help + + +LNG=${LANG:0:2} +if [[ -f "/usr/share/mabox-colorizer/help/$LNG.html" ]];then +yhtml /usr/share/mabox-colorizer/help/$LNG.html 'Mabox Colorizer' +else +yhtml /usr/share/mabox-colorizer/help/en.html 'Mabox Colorizer' +fi diff --git a/share/applications/colorizer.desktop b/share/applications/colorizer.desktop index 8451c42..59c98e4 100644 --- a/share/applications/colorizer.desktop +++ b/share/applications/colorizer.desktop @@ -6,7 +6,7 @@ Comment=Mabox Colorizer Keywords= StartupNotify=false Icon=colorizer -TryExec=colorizer -s -Exec=colorizer -s +TryExec=ycolorizer +Exec=ycolorizer Categories=Settings; #NoDisplay=true diff --git a/share/mabox-colorizer/help/en.html b/share/mabox-colorizer/help/en.html index f850a5f..1909693 100644 --- a/share/mabox-colorizer/help/en.html +++ b/share/mabox-colorizer/help/en.html @@ -12,7 +12,7 @@ div.fixed { position: fixed; top: 0; right: 0; - width: 200px; + width: 400px; } div.fixeddown { position: fixed; @@ -33,10 +33,10 @@ p a.w3-tag:hover {text-decoration:none; border:none;}
- + @@ -47,19 +47,45 @@ p a.w3-tag:hover {text-decoration:none; border:none;}
-
- -

Mabox Colorizer beta

- (Colorizer is in rapid development ... this help may be incomplete prior to 1.0 release) -

a set of tools to easily customize your Mabox Linux Desktop

+
+ +
+

Mabox Colorizer beta

+

a set of tools to easily customize
your Mabox Linux Desktop

+

Easily change look and feel of:

    -
  • Openbox theme (windows decorations)
  • +
  • Openbox theme (window decorations)
  • Menu/Sidepanels and other jgmenu-based Mabox tools
  • Conkies
  • -
  • PyRadio - Internet Radio Player
  • +

- Automatically generate themes for all above from Wallpaper colors New! + +
+

New!  Randomizer - set color themes quickly and securely

+
+
+

Quickly randomize
colorschemes for...

+ +
+
+
+

Reset to defaults...
(restore fresh install settings)

+ +
+
+
+ + +
@@ -71,22 +97,14 @@ p a.w3-tag:hover {text-decoration:none; border:none;}
- - +

-

For much more options, fine-tunning and colors choices launch  OBtheme menu

+

Potrzebujesz więcej opcji, tuningu i kolorów? Uruchom  OBtheme menu