From d2214decdcd73aaab6fe0b470243e23def332c26 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sat, 17 Dec 2022 12:12:52 +0100 Subject: [PATCH] upd --- bin/colorizer | 63 ++-- bin/conkyctl | 199 ++++++++--- bin/obtctl | 65 +++- share/mabox-colorizer/help/en.html | 260 +++++++------- .../help/img/crossdiagonal.png | Bin 6579 -> 8212 bytes share/mabox-colorizer/help/img/diagonal.png | Bin 5673 -> 6321 bytes share/mabox-colorizer/help/img/horizontal.png | Bin 4389 -> 2822 bytes .../help/img/mirrorhorizontal.png | Bin 4483 -> 3664 bytes share/mabox-colorizer/help/img/pyramid.png | Bin 6525 -> 7900 bytes share/mabox-colorizer/help/img/raised.png | Bin 3619 -> 0 bytes share/mabox-colorizer/help/img/solid.png | Bin 3328 -> 2926 bytes .../help/img/splitvertical.png | Bin 3650 -> 2641 bytes share/mabox-colorizer/help/img/vertical.png | Bin 3619 -> 2134 bytes share/mabox-colorizer/help/pl.html | 321 +++++++++++------- 14 files changed, 562 insertions(+), 346 deletions(-) delete mode 100644 share/mabox-colorizer/help/img/raised.png diff --git a/bin/colorizer b/bin/colorizer index 933fc74..f57125c 100755 --- a/bin/colorizer +++ b/bin/colorizer @@ -139,6 +139,13 @@ case "$LANG" in SELECT="select - wybierz akcję..." DIFF_CONKY_COLORS="Różne kolory dla Conky" HELP="Pomoc" + RESET_COLORS="Resetuj kolory" + RESET_CHOOSE="Resetuj..." + RESET_SEP="Resetuj kolory dla" + RES_OB_WD="Dekoracje okien OpenBox" + RES_CONKY="Conky" + RES_MENU="Menu i Paneli" + RES_ALL="Wszystko (OB, menu, conky)" ;; *) REGENERATE="(Re)Generate from wallpaper colors..." @@ -223,6 +230,13 @@ case "$LANG" in SELECT="select - select action" DIFF_CONKY_COLORS="Different colors for each Conky" HELP="About and Help" + RESET_COLORS="Reset Colors" + RESET_CHOOSE="Reset..." + RESET_SEP="Resey Colors of ..." + RES_OB_WD="OpenBox Window Decorations" + RES_CONKY="Conkies" + RES_MENU="Menus / Panels" + RES_ALL="All (OB, menus, conky)" ;; esac @@ -257,19 +271,19 @@ mint+=("#6cabcd" "#5b73c4" "#aa876a" "#9d9d9d" "#db9d61" "#c76199" "#8c6ec9" "#c out+=("^sep(Mabox Colorizer)") -out+=(" $SETTINGS,^checkout(settings)") +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 Help - 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 Help - Colorizer'") fi out+=("^sep()") -out+=(" $REGENERATE,^checkout(regen)") +out+=("北 $REGENERATE,^checkout(regen)") out2+=("^tag(regen)") out2+=("^sep($REGENERATEALL)") - out2+=(" $ASCONFIGURED,w2theme colorize;colorizer -s") - out2+=(" $REVERSE,w2theme reverse;colorizer -s") + 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)") @@ -484,10 +498,10 @@ done #if [[ "$wall2themes" == "yes" ]];then out+=("^sep($RANDWALL)") syswallp=$(shopt -s nullglob ; set -- /usr/share/backgrounds/*.{jpg,JPG,jpeg,JPEG,png,PNG} ; echo $#) -out+=(" $SYSWALLPAPER (${syswallp}),nitrogen --random /usr/share/backgrounds --set-scaled --save;colorizer -s") +out+=(" $SYSWALLPAPER (${syswallp}),nitrogen --random /usr/share/backgrounds --set-scaled --save;colorizer -s") if [[ -d "${user_wallpapers_dir}" ]]; then userwallp=$(shopt -s nullglob ; set -- $user_wallpapers_dir/*.{jpg,JPG,jpeg,JPEG,png,PNG} ; echo $#) -out+=(" $USERWALLPAPER (${userwallp}),nitrogen --random ${user_wallpapers_dir} --set-scaled --save;colorizer -s") +out+=(" $USERWALLPAPER (${userwallp}),nitrogen --random ${user_wallpapers_dir} --set-scaled --save;colorizer -s") fi out+=("^sep()") out+=("$WALLPAPERS,^checkout(wallpapersettings)") @@ -498,6 +512,15 @@ 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") if [[ "$related_tools" == "show" ]];then out+=(". $CUSTOM_COMMANDS_FILE") @@ -509,7 +532,7 @@ fi out2+=("^tag(settings)") out2+=("^sep($AUTOGEN_THEMES)") -out2+=(" $AUTOGEN_THEMES [ ${wall2themes} ],^checkout(autogen)") +out2+=(" $AUTOGEN_THEMES [ ${wall2themes} ],^checkout(autogen)") out3+=("^tag(autogen") out3+=("^sep($GENERATETHEMES)") out3+=("$YES,mb-setvar wall2themes=yes $CNF_FILE;colorizer -s") @@ -551,23 +574,23 @@ out2+=("$WALLPAPERS,^checkout(wallpapersettings)") out3+=("^tag(wallpapersettings)") out3+=("^sep($SYSWALLPAPER ($syswallp))") out3+=("^sep(/usr/share/backgrounds)") -out3+=(" $OPENDIR,xdg-open /usr/share/backgrounds") -out3+=(" $OPENDIR_VIEWNIOR,viewnior /usr/share/backgrounds") -out3+=(" $SETRANDOM,nitrogen --random /usr/share/backgrounds --set-scaled --save;colorizer -s") +out3+=(" $OPENDIR,xdg-open /usr/share/backgrounds") +out3+=(" $OPENDIR_VIEWNIOR,viewnior /usr/share/backgrounds") +out3+=(" $SETRANDOM,nitrogen --random /usr/share/backgrounds --set-scaled --save;colorizer -s") out3+=("^sep($USERWALLPAPER ($userwallp))") if [[ -d "${user_wallpapers_dir}" ]]; then # dir exist out3+=("^sep(${user_wallpapers_dir})") -out3+=(" $OPENDIR ,xdg-open ${user_wallpapers_dir}") -out3+=(" $OPENDIR_VIEWNIOR ,viewnior ${user_wallpapers_dir}") -out3+=(" $SETRANDOM,nitrogen --random ${user_wallpapers_dir} --set-scaled --save;colorizer -s") +out3+=(" $OPENDIR ,xdg-open ${user_wallpapers_dir}") +out3+=(" $OPENDIR_VIEWNIOR ,viewnior ${user_wallpapers_dir}") +out3+=(" $SETRANDOM,nitrogen --random ${user_wallpapers_dir} --set-scaled --save;colorizer -s") out3+=("^sep()") -out3+=(" $CHANGE ($EDITCONF),xdg-open $CNF_FILE") +out3+=(" $CHANGE ($EDITCONF),xdg-open $CNF_FILE") else # dir not exist out3+=("^sep(${user_wallpapers_dir} - $USERDIR_NOT_EXIST") -out3+=(" $CREATE_USERDIR,mkdir -p ${user_wallpapers_dir};colorizer -s") -out3+=(" $CHANGE ($EDITCONF),xdg-open $CNF_FILE") +out3+=(" $CREATE_USERDIR,mkdir -p ${user_wallpapers_dir};colorizer -s") +out3+=(" $CHANGE ($EDITCONF),xdg-open $CNF_FILE") fi out2+=("^sep($GRADIENTS)") out2+=("$GRAD_OB [ ${gradient_obtheme} ],^checkout(grad_ob)") @@ -610,10 +633,10 @@ out3+=("^sep($SHOW_RELATED)") out3+=("$SHOW,mb-setvar related_tools=show $CNF_FILE;colorizer -s") out3+=("$HIDE,mb-setvar related_tools=hide $CNF_FILE;colorizer -s") out3+=("^sep()") -out3+=(" $EDIT_RELATED,xdg-open $CUSTOM_COMMANDS_FILE") +out3+=(" $EDIT_RELATED,xdg-open $CUSTOM_COMMANDS_FILE") out3+=(" $RESET_RELATED,rm $CUSTOM_COMMANDS_FILE;colorizer -s") out2+=("^sep()") -out2+=(" $EDITCONF,xdg-open $CNF_FILE") +out2+=(" $EDITCONF,xdg-open $CNF_FILE") out2+=(" $RESET,rm $CNF_FILE;colorizer -s") diff --git a/bin/conkyctl b/bin/conkyctl index 86314de..ed3f79a 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -263,26 +263,33 @@ makemoveableall () { pl*) TITLE="Przenieś Conky dokąd chcesz" DESC="Możesz teraz przesuwać wszystkie Conky.\nPrzytrzymaj wciśnięty klawisz Alt i przesuń każde Conky gdzie chcesz\n " + VB="To prawdopodobnie nie zadziała w środowiskach wirtualnych" CANCEL="Anuluj" SAVE="Zapisz nowe pozycje" ;; es*) TITLE="Move Conkies where you want" DESC="Move Conkies to desired locations now...\n Hold Alt and drag Conkies one by one.\n" + VB="It will probably not work in Virtual environments" CANCEL="Cancel" SAVE="Save new positions" ;; *) TITLE="Move Conkies where you want" DESC="Move Conkies to desired locations now...\n Hold Alt and drag Conkies one by one.\n" + VB="It will probably not work in Virtual environments" CANCEL="Cancel" SAVE="Save new positions" ;; esac + TYPE=$(cat /sys/class/dmi/id/chassis_type) + if [ "$TYPE" != "1" ];then + VB="" + fi cmd=( yad --center --borders=20 --title="$TITLE" - --text="$DESC" + --text="$DESC\n\n${VB}" --button="$CANCEL":1 --button="$SAVE":0 ) @@ -553,10 +560,10 @@ single () { out+=("$NOT_WORKING,conkyctl netdevice") fi #out+=("^sep($POSITION)") - out+=(" $POSITION,^checkout(position)") + out+=(" $POSITION,^checkout(position)") out2+=("^tag(position)") out2+=("^sep($POSITION)") - out2+=(" $MARKNEWPOS,conkyctl setpos ${1};$me") + out2+=(" $MARKNEWPOS,conkyctl setpos ${1};$me") out2+=("^sep()") out2+=("$ALIGNMENT [ $POS ],^checkout(posi)") out3+=("^tag(posi)") @@ -583,7 +590,7 @@ single () { out3+=("${i},conkyctl gap_y ${i} ${1};$me") done out2+=("^sep()") - out2+=(" $MAKEMOVEABLE,conkyctl makemoveableall") + out2+=(" $MAKEMOVEABLE,conkyctl makemoveableall") if [[ "$1" =~ "logo_mbcolor" ]]; then read LSIZE <<< "$(grep minimum_height ${1} | cut -d'=' -f2 | cut -d"," -f1)" @@ -728,10 +735,10 @@ single () { out2+=("4,conkyctl stippled_borders 4 ${1};$me") out+=("^sep()") - out+=(" $EDIT ${title^},xdg-open ${1}") - out+=(" $RELOAD ${title^},conkyctl restartone ${1}") + out+=(" $EDIT ${title^},xdg-open ${1}") + out+=("北 $RELOAD ${title^},conkyctl restartone ${1}") out+=("^sep()") - out+=(" $KILL ${title^},conkyctl kill ${1##*/};${me}") + out+=(" $KILL ${title^},conkyctl kill ${1##*/};${me}") } pipemenu () { single "$1" @@ -787,12 +794,12 @@ 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 $HOME/.config/mabox/${name}.csv ]; then + #if [ ! -f ${CONKYDIR}/menuscripts/${name}.csv ]; then #touch $HOME/.config/mabox/${name}.csv - CUSTOMCOMMANDS="" - else - CUSTOMCOMMANDS=". $HOME/.config/mabox/${name}.csv" - fi + #CUSTOMCOMMANDS="" + #else + #CUSTOMCOMMANDS=". ${CONKYDIR}/menuscripts/${name}.csv" + #fi . /usr/share/mb-jgtools/pipemenu-standalone.cfg . $HOME/.config/mabox/mabox.conf @@ -811,6 +818,13 @@ contextmenu () { single "${CONKYCFG}" "s" + case "$LANG" in + pl*)EDIT_CUSTOMCOMMANDS=" Edytuj menu komend (lewy klik menu)";; + es*)EDIT_CUSTOMCOMMANDS=" Edit cmd menu (left clik menu)";; + *) EDIT_CUSTOMCOMMANDS=" Edit cmd menu (left clik menu)";; + esac + out+=("^sep()") + out+=("$EDIT_CUSTOMCOMMANDS,touch ${CONKYDIR}/menuscripts/${name}.csv;sleep 1;xdg-open ${CONKYDIR}/menuscripts/${name}.csv") out+=("^sep()") out+=(" ⮜⮜⮜ Colorizer Conky,colorizer-conky -s") @@ -859,57 +873,132 @@ contextmenu () { echo "color_sep_fg=${CLR} 10" >> ${CONFIG_FILE} echo "font=${FONT} 10" >> ${CONFIG_FILE} - case "$LANG" in - pl*) - CUSTOM_COMMANDS_SEP="Własne polecenia" - EDIT_CUSTOMCOMMANDS=" Edytuj własne polecenia" - ;; - es*) - CUSTOM_COMMANDS_SEP="Custom commands" - EDIT_CUSTOMCOMMANDS=" Edit custom commands" - ;; - *) - CUSTOM_COMMANDS_SEP="Custom commands" - EDIT_CUSTOMCOMMANDS=" Edit custom commands" - ;; - esac -if [ -f $HOME/.config/mabox/${name}.csv ]; then -LINES=$(cat $HOME/.config/mabox/${name}.csv|wc -l) -if [ "$LINES" -gt "0" ]; then cat < ${MENU_ITEMS} - $(printf '%s\n' "${out[@]}") -^sep($CUSTOM_COMMANDS_SEP) -$EDIT_CUSTOMCOMMANDS,touch ~/.config/mabox/${name}.csv;sleep 1;xdg-open ~/.config/mabox/${name}.csv -^sep() -${CUSTOMCOMMANDS} $(printf '%s\n' "${out2[@]}") $(printf '%s\n' "${out3[@]}") EOF -else -cat < ${MENU_ITEMS} -$(printf '%s\n' "${out[@]}") -^sep($CUSTOM_COMMANDS_SEP) -${CUSTOMCOMMANDS} -$EDIT_CUSTOMCOMMANDS,touch ~/.config/mabox/${name}.csv;sleep 1;xdg-open ~/.config/mabox/${name}.csv -$(printf '%s\n' "${out2[@]}") -$(printf '%s\n' "${out3[@]}") -EOF -fi -else -cat < ${MENU_ITEMS} -$(printf '%s\n' "${out[@]}") -^sep($CUSTOM_COMMANDS_SEP) -$EDIT_CUSTOMCOMMANDS,touch ~/.config/mabox/${name}.csv;sleep 1;xdg-open ~/.config/mabox/${name}.csv -${CUSTOMCOMMANDS} -$(printf '%s\n' "${out2[@]}") -$(printf '%s\n' "${out3[@]}") -EOF -fi jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null } + +cmdmenu () { + mkdir -p "${CONKYDIR}"/menuscripts + # get conky config path from clicked "conky window" + eval $(xdotool getmouselocation --shell) + eval $(xdotool getwindowgeometry --shell ${WINDOW}) + hexid=$(wmctrl -lpG | grep ${X} |grep ${Y}|grep ${WIDTH}|grep ${HEIGHT} |cut -d' ' -f1) + CONKYCFG=$(xprop -id ${hexid}|grep WM_COMMAND|cut -d'"' -f6) + filename=${CONKYCFG##*/} + name=${filename%%_mb*} + title=${name//_/ } + #notify-send.sh "${X} ${Y}" "${WIDTH} ${HEIGHT}" + # if script exist run it and exit + if [ -f "${CONKYDIR}/menuscripts/${name}" ];then + bash "${CONKYDIR}/menuscripts/${name}" + exit 0 + fi + + if [ -f ${CONKYDIR}/menuscripts/${name}.csv ]; then + LINES=$(grep -Ev "^#|^$" ${CONKYDIR}/menuscripts/${name}.csv|wc -l) + notify-send.sh "$LINES" + if [ ${LINES} != 0 ]; then + CUSTOMCOMMANDS=". ${CONKYDIR}/menuscripts/${name}.csv" + else + contextmenu + fi + else + contextmenu + fi + + #notify-send.sh "Conky cmdmenu" "${filename}\n${name}\n${title}" + # otherwise build and show standalone menu with custom commands + + sleep .2 + read WINTRANS <<< "$(grep own_window_transparent ${CONKYCFG} | cut -d'=' -f2 | cut -d"," -f1)" + read FONTDEF <<< "$(grep "font .*=.*,$" ${CONKYCFG} | cut -d'=' -f2,3 |cut -d"'" -f2)" + FONT=${FONTDEF%:*} + FONTSIZE=${FONTDEF#*=} + read WINCLR <<< "$(grep own_window_colour ${CONKYCFG} | cut -d'=' -f2 | cut -d"'" -f2)" + [[ $WINCLR =~ ^#.* ]] && : || WINCLR="#${WINCLR}" + read CLR <<< "$(grep default_color ${CONKYCFG} | cut -d'=' -f2 | cut -d"'" -f2)" + [[ $CLR =~ ^#.* ]] && : || CLR="#${CLR}" + + + + . /usr/share/mb-jgtools/pipemenu-standalone.cfg + . $HOME/.config/mabox/mabox.conf + CONFIG_FILE=$(mktemp) + MENU_ITEMS=$(mktemp) + trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT + POSITION_MODE=${1:-pointer} + #POSITION_MODE=fixed + HIDE_BACK_ITEMS=1 + menu_gradient_pos=none + jgtools_padding=4 + MENU_PADDING_TOP=${jgtools_padding:-0} + JGWIDTH=270 + TABS="90" + jgmenu_icon_size=0 + + mkconfigfile + + echo "color_menu_bg_to=${WINCLR} 100" >> ${CONFIG_FILE} + TXTCOLOR=$(pastel textcolor ${WINCLR}|pastel format hex) + #notify-send.sh "TXTCOLOR" "${TXTCOLOR} ${menu_gradient_pos}" + if [ "$TXTCOLOR" == "#ffffff" ];then #bg is dark + TXTCOLOR_NORM="#cccccc" + WINCLR=$(pastel lighten 0.03 ${WINCLR}|pastel format hex) + echo "color_norm_fg=${TXTCOLOR_NORM} 100" >> ${CONFIG_FILE} + echo "color_sel_fg=${TXTCOLOR} 100" >> ${CONFIG_FILE} + echo "color_title_fg=${TXTCOLOR} 60" >> ${CONFIG_FILE} + SELBG=$(pastel darken 0.1 ${WINCLR}|pastel format hex) + echo "color_sel_bg=${SELBG} 80" >> ${CONFIG_FILE} + echo "color_title_bg=${SELBG} 30" >> ${CONFIG_FILE} + echo "color_title_border=${SELBG} 60" >> ${CONFIG_FILE} + else #bg is light + TXTCOLOR_NORM="#333333" + echo "color_norm_fg=${TXTCOLOR_NORM} 100" >> ${CONFIG_FILE} + echo "color_sel_fg=${TXTCOLOR} 100" >> ${CONFIG_FILE} + echo "color_title_fg=${TXTCOLOR} 90" >> ${CONFIG_FILE} + SELBG=$(pastel darken 0.1 ${WINCLR}|pastel format hex) + echo "color_sel_bg=${SELBG} 80" >> ${CONFIG_FILE} + echo "color_title_bg=${SELBG} 90" >> ${CONFIG_FILE} + echo "color_title_border=${SELBG} 90" >> ${CONFIG_FILE} + fi + echo "color_menu_bg=${WINCLR} 90" >> ${CONFIG_FILE} + echo "color_menu_border=${CLR} 60" >> ${CONFIG_FILE} + echo "menu_border=1" >> ${CONFIG_FILE} + echo "menu_radius=0" >> ${CONFIG_FILE} + + echo "color_sep_fg=${CLR} 10" >> ${CONFIG_FILE} + echo "font=${FONT} 10" >> ${CONFIG_FILE} + echo "sub_spacing=3" >> ${CONFIG_FILE} + echo "menu_margin_x=3" >> ${CONFIG_FILE} + echo "menu_margin_y=3" >> ${CONFIG_FILE} + #notify-send.sh "CFG" "$(cat $CONFIG_FILE)" + case "$LANG" in + pl*) + CUSTOM_COMMANDS_SEP="Własne polecenia" + EDIT_CUSTOMCOMMANDS=" Edytuj menu" + ;; + es*) + CUSTOM_COMMANDS_SEP="Custom commands" + EDIT_CUSTOMCOMMANDS=" Edit menu" + ;; + *) + CUSTOM_COMMANDS_SEP="Custom commands" + EDIT_CUSTOMCOMMANDS=" Edit menu" + ;; + esac +cat < ${MENU_ITEMS} +${CUSTOMCOMMANDS} +EOF + +jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null +} + netdevice () { CFGFILE="$HOME/.config/conky/Network_mbcolor.conkyrc" rm /tmp/xx* @@ -918,6 +1007,7 @@ cd /tmp csplit -s ${CFGFILE} /conky.text/ #IFACE=$(ip route get 8.8.8.8 | awk -- '{printf $5}') +# thanks @sng :) IFACE=$(ip route get 8.8.8.8 | awk '{for(i=1; i/ {while (getline n) {if (match(n, //)) THEMEDIR="$HOME/.themes/$OBTHEME/openbox-3" THEMERC="$HOME/.themes/$OBTHEME/openbox-3/themerc" +MBCOLORSDIR="$HOME"/.themes/MBcolors/openbox-3/ +if [ ! -d "$MBCOLORSDIR" ]; then +mkdir -p ${MBCOLORSDIR} +rsync -a /usr/share/mabox-colorizer/themes/MBcolors/openbox-3/* ${MBCOLORSDIR}/ +fi + if [ ! -f "${THEMERC}.bak" ]; then cp ${THEMERC} ${THEMERC}.bak fi @@ -17,9 +23,29 @@ reset () { rm ${THEMERC} mv ${THEMERC}.bak ${THEMERC} } - +resetMBcolors() { + theme MBcolors + rsync -a /usr/share/mabox-colorizer/themes/MBcolors/openbox-3/* ${MBCOLORSDIR}/ +} + borderWidth () { - sd "^border.width:.*$" "border.width: $1" ${THEMERC} + case "$1" in + increase) + read BWIDTH <<< "$(grep border.width: ${THEMERC} | cut -d':' -f2)" + BWIDTH=$((BWIDTH+1)) + sd "^border.width:.*$" "border.width: ${BWIDTH}" ${THEMERC} + ;; + decrease) + read BWIDTH <<< "$(grep border.width: ${THEMERC} | cut -d':' -f2)" + if [ "$BWIDTH" -gt "0" ];then + BWIDTH=$((BWIDTH-1)) + 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 } activeborderColor () { sd "\.active.border.color:.*$" ".active.border.color: $1" ${THEMERC} @@ -28,8 +54,27 @@ inactiveborderColor () { sd "\.inactive.border.color:.*$" ".inactive.border.color: $1" ${THEMERC} } paddingHeight () { - sd "^padding.height:.*$" "padding.height: $1" ${THEMERC} - sd "^padding.width:.*$" "padding.width: $1" ${THEMERC} + case "$1" in + increase) + read PHEIGHT <<< "$(grep ^padding.height: ${THEMERC} | cut -d':' -f2)" + PHEIGHT=$((PHEIGHT+1)) + sd "^padding.height:.*$" "padding.height: ${PHEIGHT}" ${THEMERC} + sd "^padding.width:.*$" "padding.width: ${PHEIGHT}" ${THEMERC} + ;; + decrease) + read PHEIGHT <<< "$(grep ^padding.height: ${THEMERC} | cut -d':' -f2)" + if [ "$PHEIGHT" -gt "0" ];then + PHEIGHT=$((PHEIGHT-1)) + sd "^padding.height:.*$" "padding.height: ${PHEIGHT}" ${THEMERC} + sd "^padding.width:.*$" "padding.width: ${PHEIGHT}" ${THEMERC} + fi + ;; + 0|1|2|3|4|6|8|10|12|16|20) + sd "^padding.height:.*$" "padding.height: $1" ${THEMERC} + sd "^padding.width:.*$" "padding.width: $1" ${THEMERC} + ;; + esac + } paddingWidth () { sd "^padding.width:.*$" "padding.width: $1" ${THEMERC} @@ -253,16 +298,23 @@ fontsize () { case "$1" in 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 ;; decrease) SIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$cfg") - ((SIZE=SIZE-1)) - xmlstarlet ed -L -N a="$nspace" -u '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' -v "$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 } @@ -290,6 +342,7 @@ fontslanttoggle (){ case "$1" in theme) theme "$2";; reset) reset;; + resetMBcolors) resetMBcolors;; borderWidth) borderWidth "$2";; activeborderColor) activeborderColor "$2";; inactiveborderColor) inactiveborderColor "$2";; diff --git a/share/mabox-colorizer/help/en.html b/share/mabox-colorizer/help/en.html index c511e0f..f850a5f 100644 --- a/share/mabox-colorizer/help/en.html +++ b/share/mabox-colorizer/help/en.html @@ -23,22 +23,24 @@ div.fixeddown { .w3-bar-block .w3-btn {width: 100px;text-align:center;} .w3-bar-block .w3-btn:hover {background-color:white;color:gray;} .w3-dropdown-content {min-width: 20px;} +a.w3-tag {color: transparent; border:1px solid #666666; margin-bottom:4px;} +a.w3-tag:hover {color: transparent; border:1px solid #EEEEEE;margin-bottom:4px;} +p a.w3-tag {text-decoration:none; border:none;} +p a.w3-tag:hover {text-decoration:none; border:none;}
- + - - -  Colorizer +  Colorizer
@@ -57,8 +59,7 @@ div.fixeddown {
  • Conkies
  • PyRadio - Internet Radio Player
  • -

    Automatically generate themes for all above from Wallpaper colors New!

    -  Colorizer + Automatically generate themes for all above from Wallpaper colors New!
    @@ -71,23 +72,31 @@ div.fixeddown {
     
    - - - + + +
    -
    +  
    -
    -
    - +
    +
    +
    no shadow dark @@ -183,104 +220,75 @@ div.fixeddown {
    -
    +
    -
    Active window titlebar color
    -

    -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   +

    Title bar color
    +

    for active window

    +
    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +
    +

    Note!
    + Changing the background color will also set:
    + - border color to the same color
    + - BGCOLOR_TO color for a subtle gradient

    -
    -
    -
    Gradients
    +
     
    +
    +
    Gradient type
    +

    + + + + + + + + +

    +

    More than 300 beautifull pre-defined gradients are available from Colorizer OBtheme menu.

    -Note!
    - Changing the background color will also set: -
      -
    • border color to the same color
    • -
    • computed BGCOLOR_TO color for a subtle gradient
    • -
    - You can change them to you liking afterwards. -
    +

    +

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

    -

    Gradients

    -

    Openbox title bar can use various types of gradients...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Gradient typeImage (click to apply)
    Solid color (no gradient)
    Vertical
    Horizontal
    MirrorHorizontal
    SplitVertical
    Diagonal
    CrossDiagonal
    Pyramid
    @@ -247,18 +322,6 @@ Później możesz je zmienić według własnych upodobań.

    Dodaj/Usuń Programy do launchera

    - -