From 5e9786786dc2a03f0b21505e05eba775634adb9e Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Wed, 4 Sep 2024 12:58:53 +0200 Subject: [PATCH] folder-colors, colorschemes OB --- bin/colorizer-ob | 11 +- bin/conkyctl | 8 +- bin/gtkctl | 70 +++++++++ bin/mbclr | 9 +- bin/obtctl | 73 ++++++++- share/mabox-colorizer/colorschemes/ob.csv | 2 + share/mabox-colorizer/help/en.html | 144 ++++++++++++++++- share/mabox-colorizer/help/pl.html | 145 +++++++++++++++++- .../themes/MBcolors/openbox-3/themerc | 22 ++- 9 files changed, 444 insertions(+), 40 deletions(-) create mode 100755 bin/gtkctl diff --git a/bin/colorizer-ob b/bin/colorizer-ob index a30e557..9234197 100755 --- a/bin/colorizer-ob +++ b/bin/colorizer-ob @@ -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 @@ -212,7 +212,7 @@ case "$LANG" in BORDER="Window Border" BORDER_PX="Border (px)" ACTIVE_BORDER="Active Border" - INACTIVE_BORDER="Inactiva Border" + INACTIVE_BORDER="Inactive Border" HANDLEWIDTH="Handle Width" ACTIVEHANDLE="Active Handle" YES="Yes" @@ -387,7 +387,7 @@ out+=(" $SAVE_CURRTHEME,obtctl savetheme '${currvalues}';$me") - out2+=(" $OPEN_THEMEFILE,xdg-open $USERSCHEMES") + out2+=(" $OPEN_THEMEFILE,xdg-open $USERTHEMES") out2+=("^sep()") n=1 while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel buttons fsize fname ndslimc weight slant scheme_name @@ -428,8 +428,8 @@ out+=("  $GRADIENT_REVERSE,obtctl activegradient '${ABGTO}' '${ABG}';$me") out+=("^sep($BORDER)") -out+=(" $ACTIVE_BORDER,^pipe(mbclr '$ALINE' obtctl activeborderColor '${ACTIVE_BORDER_COLOR}' '$me')") -out+=(" $INACTIVE_BORDER,^pipe(mbclr '$NLINE' obtctl inactiveborderColor '${INACTIVE_BORDER_COLOR}' '$me')") +out+=(" $ACTIVE_BORDER,^pipe(mbclr '$ALINE' obtctl activeborderColor '${ACTIVE_BORDER}' '$me')") +out+=(" $INACTIVE_BORDER,^pipe(mbclr '$NLINE' obtctl inactiveborderColor '${INACTIVE_BORDER}' '$me')") out+=("󰝣 $BORDER [ $BORD ],^checkout(border)") out+=("$HANDLEWIDTH [ $HANDLE ],^checkout(handlewidth)") #out+=("$ACTIVEHANDLE? [ $AHANDLE ],^checkout(handle)") @@ -471,6 +471,7 @@ out2+=("^sep($TEXTALIGN)") out2+=("^sep($BUTTONS_LAYOUT)") [[ "$NDSLIMC" == NDSLIMC ]] && out2+=(" full NDSLIMC (default),obtctl ndslimc NDSLIMC;$me") || out2+=(" full NDSLIMC (default),obtctl ndslimc NDSLIMC;$me") +[[ "$NDSLIMC" == DSLIMC ]] && out2+=(" full (no icon) DSLIMC,obtctl ndslimc DSLIMC;$me") || out2+=(" full (no icon) DSLIMC,obtctl ndslimc DSLIMC;$me") [[ "$NDSLIMC" == NLIMC ]] && out2+=(" mini NLIMC,obtctl ndslimc NLIMC;$me") || out2+=(" mini NLIMC,obtctl ndslimc NLIMC;$me") [[ "$NDSLIMC" == LIMC ]] && out2+=(" mini (no icon) LIMC,obtctl ndslimc LIMC;$me") || out2+=(" mini (no icon) LIMC,obtctl ndslimc LIMC;$me") [[ "$NDSLIMC" == CMIL ]] && out2+=(" crazy CMIL,obtctl ndslimc CMIL;$me") || out2+=(" crazy CMIL,obtctl ndslimc CMIL;$me") diff --git a/bin/conkyctl b/bin/conkyctl index 7edca6b..ac7f4fe 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -999,10 +999,12 @@ cmdmenu () { 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}" + if [ "$1" != "" ];then + if [ -x "${CONKYDIR}/menuscripts/${name}" ];then + bash -c "${CONKYDIR}/menuscripts/${name} ${1}" exit 0 fi + fi # if CSV for menu exist show it if [ -f ${CONKYDIR}/menuscripts/${name}.csv ]; then LINES=$(grep -Ev "^#|^$" ${CONKYDIR}/menuscripts/${name}.csv|wc -l) @@ -1046,7 +1048,7 @@ cmdmenu () { CONFIG_FILE=$(mktemp) MENU_ITEMS=$(mktemp) trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT - POSITION_MODE=${1:-pointer} + POSITION_MODE=pointer #POSITION_MODE=fixed HIDE_BACK_ITEMS=1 menu_gradient_pos=none diff --git a/bin/gtkctl b/bin/gtkctl new file mode 100755 index 0000000..91f77d2 --- /dev/null +++ b/bin/gtkctl @@ -0,0 +1,70 @@ +#!/bin/bash + +# gtkctl - GTK widget (theme), Icons settings for Mabox + +GTK2RC="$HOME"/.gtkrc-2.0 +GTK3RC="$HOME"/.config/gtk-3.0/settings.ini + + +get_theme(){ + GTK_THEME=( $(grep "gtk-theme-name" ${GTK2RC} | cut -d'"' -f2) ) + echo ${GTK_THEME} +} + +get_icons(){ + GTK_ICON=( $(grep "gtk-icon-theme-name" ${GTK2RC} | cut -d'"' -f2) ) + echo ${GTK_ICON} +} + + + +theme(){ + # set GTK theme + : +} + +icons(){ + # set icon theme + sd "^gtk-icon-theme-name=.*" "gtk-icon-theme-name=\"${1}\"" ${GTK2RC} + sd "^gtk-icon-theme-name=.*" "gtk-icon-theme-name=${1}" ${GTK3RC} + reload-gtk +} + +papcolor(){ +ICON_DIR="$HOME/.local/share/icons" +case "$1" in +adwaita|black|blue|bluegrey|breeze|brown|carmine|cyan|darkcyan|deeporange|green|grey|indigo|magenta|nordic|orange|palebrown|paleorange|pink|red|teal|violet|white|yaru|yellow) +;; +*) +exit 1 +esac + +if [ -f "${ICON_DIR}/Papirus-Mabox-$1/index.theme" ];then +TITLE="Icons theme changed!" +TEXT="Papirus folders color: ${1^}" +icons Papirus-Mabox-$1 +notify-send.sh -u normal -i "${ICON_DIR}/Papirus-Mabox-$1/64x64/places/folder-linux.svg" "$TITLE" "$TEXT" + +else +TITLE="Please wait..." +TEXT="Preparing ${1} folder color icons" +TITLE2="Success!" +TEXT2="${1^} icons color variant generated successfully" +notify-send.sh -u critical -i /usr/share/icons/Papirus/64x64/places/folder-${1}.svg -R /tmp/papicon "$TITLE" "$TEXT" +papirus-folder-color.sh -c ${1} +notify-send.sh -u normal -i "${ICON_DIR}/Papirus-Mabox-$1/64x64/places/folder-linux.svg" -R /tmp/papicon "$TITLE2" "$TEXT2" +icons Papirus-Mabox-$1 + +fi +} + + + +case "$1" in + get_theme)get_theme;; + get_icons)get_icons "$2";; + theme)theme "$2";; + icons)icons "$2";; + papcolor)papcolor "$2";; + *):;; +esac diff --git a/bin/mbclr b/bin/mbclr index fa6c462..c9e5eb9 100755 --- a/bin/mbclr +++ b/bin/mbclr @@ -84,6 +84,12 @@ grays=("#000000" "#0d0d0d" "#1b1b1b" "#282828" "#363636" "#434343" "#515151" "#5 accents=("#e93d57" "#c7162b" "#e9633a" "#e95620" "#f4a300" "#e8cc2d" "#3cd425" "#0e8420" "#00d3b7" "#18b0b0" "#3dade9" "#686b6f" "#3584e4" "#916ee4" "#b875dc" "#77216e" "#c748ba" "#e93a9a") out+=("^sep($4)") +#TU +out+=(" $PICK_FROM_SCREEN,mbclr pixelcolor $2 $3 ${5} ${6}") +out+=(" $SELECT_OR_PICK,mbclr pick $2 $3 ${5} ${6}") + + + if [[ "$2" == "jgctl" ]]; then . $HOME/.config/mabox/mabox.conf case "$jgmenu_theme" in @@ -144,9 +150,6 @@ out+=("󰑧 $ROTATE_HSL_HUE,^checkout(rotate_hsl)") #out+=("$SHADES_OF_CURRENT ($1),^checkout(curshades)") out+=("^sep($CHANGE_COLOR)") #Current -out+=(" $PICK_FROM_SCREEN,mbclr pixelcolor $2 $3 ${5} ${6}") -out+=(" $SELECT_OR_PICK,mbclr pick $2 $3 ${5} ${6}") -out+=("^sep()") out+=(" $ACCENT_COLORS,^checkout(accents)") out2+=("^tag(accents)") out2+=("^sep($ACCENT_COLORS)") diff --git a/bin/obtctl b/bin/obtctl index a94f395..8fe64b7 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -57,6 +57,7 @@ resetMBcolors() { 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" + rm ${THEMERC}.bak } borderWidth () { @@ -80,9 +81,13 @@ borderWidth () { } activeborderColor () { sd "\.active.border.color:.*$" ".active.border.color: $1" ${THEMERC} + read BORD <<< "$(grep border.width ${THEMERC} | cut -d':' -f2)" + [[ "$BORD" == 0 ]] && borderWidth 1 } inactiveborderColor () { sd "\.inactive.border.color:.*$" ".inactive.border.color: $1" ${THEMERC} + read BORD <<< "$(grep border.width ${THEMERC} | cut -d':' -f2)" + [[ "$BORD" == 0 ]] && borderWidth 1 } paddingHeight () { case "$1" in @@ -200,6 +205,18 @@ activegradient () { #sd "\.active.handle.bg.color:.*$" ".active.handle.bg.color: ${1}" ${THEMERC} sd "^window.active.title.bg.color:.*$" "window.active.title.bg.color: ${1}" ${THEMERC} sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${2}" ${THEMERC} + + ## split.To - only used if gradient = splitvertical + splitTo=$(pastel lighten 0.275 "${1}"|pastel format hex) + ## 1 color (top one) + sd "window.active.title.bg.color.splitTo:.*$" "window.active.title.bg.color.splitTo: ${splitTo}" ${THEMERC} + + splitTo2=$(pastel lighten 0.12 "${2}"|pastel format hex) + #splitTo2=$(pastel lighten 0.09 "${1}"|pastel format hex) + ## 4 color (bottom one) + sd "window.active.title.bg.colorTo.splitTo:.*$" "window.active.title.bg.colorTo.splitTo: ${splitTo2}" ${THEMERC} + + # Border color = active.title.bg.color (gradient start color) sd "\.active.border.color:.*$" ".active.border.color: $1" ${THEMERC} @@ -256,6 +273,17 @@ activegradient () { gradient () { sd "^window.active.title.bg.color:.*$" "window.active.title.bg.color: ${1}" ${THEMERC} sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${2}" ${THEMERC} + + ## split.To - only used if gradient = splitvertical + splitTo=$(pastel lighten 0.275 "${1}"|pastel format hex) + ## 1 color (top one) + sd "window.active.title.bg.color.splitTo:.*$" "window.active.title.bg.color.splitTo: ${splitTo}" ${THEMERC} + + splitTo2=$(pastel lighten 0.12 "${2}"|pastel format hex) + #splitTo2=$(pastel lighten 0.09 "${1}"|pastel format hex) + ## 4 color (bottom one) + sd "window.active.title.bg.colorTo.splitTo:.*$" "window.active.title.bg.colorTo.splitTo: ${splitTo2}" ${THEMERC} + # Border color = active.title.bg.color (gradient start color) sd "\.active.border.color:.*$" ".active.border.color: $1" ${THEMERC} @@ -346,7 +374,7 @@ clractivebg_only () { activebuttonscolors "${TITLE_FG}" } clractivebg () { - colorTo=$(pastel darken 0.1 "${1}"|pastel format hex) + colorTo=$(pastel darken 0.14 "${1}"|pastel format hex) #activehandle? read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)" read AHBG <<< "$(grep .active.handle.bg.color: ${THEMERC} | cut -d':' -f2)" @@ -360,6 +388,17 @@ clractivebg () { sd "\.active.border.color:.*$" ".active.border.color: ${1}" ${THEMERC} sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${colorTo}" ${THEMERC} + + ## split.To - only used if gradient = splitvertical + splitTo=$(pastel lighten 0.275 "${1}"|pastel format hex) + ## 1 color (top one) + sd "window.active.title.bg.color.splitTo:.*$" "window.active.title.bg.color.splitTo: ${splitTo}" ${THEMERC} + + splitTo2=$(pastel lighten 0.12 "${colorTo}"|pastel format hex) + #splitTo2=$(pastel lighten 0.09 "${1}"|pastel format hex) + ## 4 color (bottom one) + sd "window.active.title.bg.colorTo.splitTo:.*$" "window.active.title.bg.colorTo.splitTo: ${splitTo2}" ${THEMERC} + #menu (Openbox menu - not really used in Mabox) sd "menu.title.bg.color:.*$" "menu.title.bg.color: ${1}" ${THEMERC} sd "menu.title.bg.colorTo:.*$" "menu.title.bg.colorTo: ${colorTo}" ${THEMERC} @@ -397,11 +436,30 @@ clrnormalbg () { sd "\.inactive.grip.bg.colorTo:.*$" ".inactive.grip.bg.colorTo: ${colorTo}" ${THEMERC} sd "^window.inactive.title.bg.color:.*$" "window.inactive.title.bg.color: ${1}" ${THEMERC} sd "^window.inactive.title.bg.colorTo:.*$" "window.inactive.title.bg.colorTo: ${colorTo}" ${THEMERC} + + ## split.To - only used if gradient = splitvertical + splitTo=$(pastel lighten 0.275 "${1}"|pastel format hex) + ## 1 color (top one) + sd "window.inactive.title.bg.color.splitTo:.*$" "window.inactive.title.bg.color.splitTo: ${splitTo}" ${THEMERC} + + splitTo2=$(pastel lighten 0.12 "${colorTo}"|pastel format hex) + #splitTo2=$(pastel lighten 0.09 "${1}"|pastel format hex) + ## 4 color (bottom one) + sd "window.inactive.title.bg.colorTo.splitTo:.*$" "window.inactive.title.bg.colorTo.splitTo: ${splitTo2}" ${THEMERC} + + + sd "\.inactive.border.color:.*$" ".inactive.border.color: ${1}" ${THEMERC} } clractivebgto () { sd "^window.active.title.bg.colorTo:.*$" "window.active.title.bg.colorTo: ${1}" ${THEMERC} + + splitTo2=$(pastel lighten 0.12 "${1}"|pastel format hex) + #splitTo2=$(pastel lighten 0.09 "${1}"|pastel format hex) + ## 4 color (bottom one) + sd "window.active.title.bg.colorTo.splitTo:.*$" "window.active.title.bg.colorTo.splitTo: ${splitTo2}" ${THEMERC} + #activehandle? ###read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)" ###read AHBG <<< "$(grep .active.handle.bg.color: ${THEMERC} | cut -d':' -f2)" @@ -413,6 +471,11 @@ clractivebgto () { clrnormalbgto () { sd "^window.inactive.title.bg.colorTo:.*$" "window.inactive.title.bg.colorTo: ${1}" ${THEMERC} + splitTo2=$(pastel lighten 0.12 "${1}"|pastel format hex) + #splitTo2=$(pastel lighten 0.09 "${1}"|pastel format hex) + ## 4 color (bottom one) + sd "window.active.title.bg.colorTo.splitTo:.*$" "window.active.title.bg.colorTo.splitTo: ${splitTo2}" ${THEMERC} + sd "\.inactive.handle.bg.colorTo:.*$" ".inactive.handle.bg.colorTo: ${1}" ${THEMERC} sd "\.inactive.grip.bg.colorTo:.*$" ".inactive.grip.bg.colorTo: ${1}" ${THEMERC} } @@ -803,8 +866,8 @@ fi #colorize OB if [ "$2" == "dark" ];then - clractivebg "${pal[4]}" - clractivebgto "${pal[6]}" + clractivebg "${pal[5]}" + #clractivebgto "${pal[6]}" activeborderColor "${pal[2]}" activetextcolor "${pal[1]}" clrnormalbg "${pal[9]}" @@ -812,8 +875,8 @@ if [ "$2" == "dark" ];then inactiveborderColor "${pal[8]}" inactivetextcolor "${pal[4]}" else #light - clractivebg "${pal[2]}" - clractivebgto "${pal[4]}" + clractivebg "${pal[4]}" + #clractivebgto "${pal[4]}" activeborderColor "${pal[0]}" activetextcolor "${pal[9]}" clrnormalbg "${pal[9]}" diff --git a/share/mabox-colorizer/colorschemes/ob.csv b/share/mabox-colorizer/colorschemes/ob.csv index 2bb14b3..81a7b0a 100644 --- a/share/mabox-colorizer/colorschemes/ob.csv +++ b/share/mabox-colorizer/colorschemes/ob.csv @@ -5,3 +5,5 @@ #D9D9D9|#B6B6B6|#0F0F0F|#BDBBB9|#D9D9D9|#B4B4B4|#656565|#BFBCBB|vertical|left|2|2|1|0|raised|bold|11|Ubuntu Bold|NLIMC|Bold|Normal|Light Grey #CE5C00|#9b4600|#E5E5E5|#CE5C00|#D3D7CF|#B4B4B4|#656565|#BFBCBB|mirrorhorizontal|center|2|2|1|0|raised|dots|11|Noto Sans|NLIMC|Normal|Normal|Orange #F7941E|#004E8F|#E5E5E5|#F7941E|#4a2c09|#00172b|#656565|#4a2c09|mirrorhorizontal|center|4|4|1|0|raised|big-14|13|Ubuntu|NLIMC|Normal|Normal|Sky and Sea +#bda9a9|#D3C6C6|#222222|#EBDCDD|#D2C6C5|#D2C6C5|#837B7C|#D2C6C5|mirrorhorizontal|center|4|4|0|6|flat|bold|11|Ubuntu|LIMC|Bold|Normal|BL Boron Light +#765BAB|#5e478c|#FFFFFF|#242424|#373737|#1e1e1e|#9A9A9A|#373737|solid|center|2|2|4|1|flat|tiny|10|Cantarell|NDSLIMC|Normal|Normal|Lean diff --git a/share/mabox-colorizer/help/en.html b/share/mabox-colorizer/help/en.html index 2ab704a..47398ca 100644 --- a/share/mabox-colorizer/help/en.html +++ b/share/mabox-colorizer/help/en.html @@ -95,6 +95,8 @@ h5 {font-size: 2vw !important;border-bottom: 1px solid;padding-left: 1em;} flex-direction: column;**/ justify-content: center; } +.grid div.i{background-color:#191919;} +.grid div.i a{text-decoration:none;display:block;border-radius: 4px;margin: -1em;padding:1em;} .gi2 {grid-column: span 2;} .gi3 {grid-column: span 3;} .gi4 {grid-column: span 4;} @@ -122,12 +124,12 @@ h5 {font-size: 2vw !important;border-bottom: 1px solid;padding-left: 1em;} @@ -673,16 +675,142 @@ If you add more commands, a menu will be shown.

 Configure directories