upload
This commit is contained in:
591
bin/colorizer-conky
Executable file
591
bin/colorizer-conky
Executable file
@@ -0,0 +1,591 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# colorizer - set of tools for Mabox (auto)theming
|
||||
# Copyright (C) 2022-2025 Daniel Napora <danieln@maboxlinux.org>
|
||||
#
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
SYSSCHEMES="/usr/share/mabox-colorizer/colorschemes/conky.csv"
|
||||
#USERSCHEMES="$HOME/.config/colorizer/conky/c_userschemes.csv"
|
||||
USERSCHEMES="$HOME/.config/colorizer/conky/colorschemes.csv"
|
||||
|
||||
|
||||
me="colorizer-conky -s"
|
||||
CONKYDIR="$HOME/.config/conky"
|
||||
BASECONKY="$CONKYDIR/sysinfo_mbcolor.conkyrc"
|
||||
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
|
||||
|
||||
LNG=${LANG:0:2}
|
||||
if [ ! -f "${BASECONKY}" ]; then
|
||||
if [ -d "/usr/share/mabox/lang/$LNG/.config/conky" ]; then
|
||||
rsync -a /usr/share/mabox/lang/$LNG/.config/conky/* ${CONKYDIR}/
|
||||
else
|
||||
rsync -a /usr/share/mabox/lang/en/.config/conky/* ${CONKYDIR}/
|
||||
fi
|
||||
fi
|
||||
CNF_DIR="$HOME/.config/colorizer/conky"
|
||||
CNF_FILE="$CNF_DIR/conky.cfg"
|
||||
[ ! -d "$CNF_DIR" ] && mkdir -p "$CNF_DIR"
|
||||
if [ ! -f $CNF_FILE ]; then
|
||||
cat <<EOF > ${CNF_FILE}
|
||||
update_notifications=true
|
||||
EOF
|
||||
fi
|
||||
|
||||
### Wallpaper colors
|
||||
WALLPALDIR="$HOME/.cache/colorizer/palettes"
|
||||
mkdir -p "$WALLPALDIR"
|
||||
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | cut -d'=' -f2)
|
||||
NAME=${WALLPATH////_}
|
||||
if [[ "${NAME}" =~ ^_home_.* ]]; then
|
||||
n=${#HOME}
|
||||
((n++))
|
||||
NAME=${NAME:${n}}
|
||||
fi
|
||||
if [ ! -f "$WALLPALDIR/$NAME.clr" ]; then
|
||||
if [ "$ext" == "avif" ];then
|
||||
magick ${WALLPATH} -resize 25% /tmp/out.jpg
|
||||
magick /tmp/out.jpg -colors 12 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr"
|
||||
else
|
||||
magick ${WALLPATH} -resize 25% -colors 12 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr"
|
||||
fi
|
||||
fi
|
||||
|
||||
mapfile -t w < "$WALLPALDIR/$NAME.clr"
|
||||
|
||||
|
||||
case "$LANG" in
|
||||
pl*)
|
||||
COLORIZECONKY="<b>Menadżer</b> widżetów <b>Conky</b>"
|
||||
NO_CONKY_RUNNING="Brak uruchomionych Conky"
|
||||
RUN_CONKY_SESSION="Uruchom zapisaną sesję"
|
||||
MOVEABLEALL="Ustaw wszystkie (<i>przeciągaj</i>)..."
|
||||
NOT_FULLY_SUPPORTED="Częściowo wspierane..."
|
||||
UNSUPPORTED="Conky - częściowo wspierane"
|
||||
UNSUPPORTED_START="kliknij aby uruchomić"
|
||||
_OPEN_CONKYDIR="Otwórz katalog z Conky"
|
||||
SCHEMES="Motywy kolorystycznie"
|
||||
SYSTEM_SCHEMES="Systemowe"
|
||||
YOUR_SCHEMES="Moje motywy"
|
||||
SAVE_CURRSCHEME="Zapisz aktualną kolorystykę jako..."
|
||||
OPEN_SCHEMEFILE="Odwórz plik ze schematami w edytorze"
|
||||
COLORSCHEME="Schemat kolorów"
|
||||
APPLY_SCHEME="Zastosuj"
|
||||
DELETE="Usuń"
|
||||
DELETE_SCHEME="Usuń schemat kolorów"
|
||||
MONOCHROMATIC="Monochromatyczny"
|
||||
CHOOSE_AND_PICK="Wybierz wariant i pobierz kolor..."
|
||||
GENERATEFROMWP="Generuj z kolorów tapety"
|
||||
LIGHTBG="Jasne tło"
|
||||
DARKBG="Ciemne tło"
|
||||
GLOBALSETTINGS="Ustawienia globalne <small>(dla wszystkich)</small>"
|
||||
REGENERATE="Motywy kolorów"
|
||||
OPENTHEMEDIR="Otwórz katalog motywów"
|
||||
_COLORS="kolory"
|
||||
DEFCOLOR="Kolor obramowania"
|
||||
COLOR_0="Kolor 0 <small>(tekst)</small>"
|
||||
COLOR_1="Kolor 1 <small>(tekst alt)</small>"
|
||||
COLOR_2="Kolor 2 <small>(pasek/graf)</small>"
|
||||
COLOR_3="Kolor 3 <small>(większy tekst)</small>"
|
||||
BACKGROUND="Kolor tła"
|
||||
TRANSPARENT="Przezroczyste tło?"
|
||||
YES="Tak"
|
||||
NO="Nie"
|
||||
FONTS="Czcionka"
|
||||
SELECTFONT="Wybierz czcionkę..."
|
||||
FONTFAMILY_LBL="czcionka"
|
||||
_EDIT_FAVFONTS="Edytuj ulubione czcionki"
|
||||
FONTSIZE_LBL="rozmiar czcionki"
|
||||
INCREASE="Powiększ do"
|
||||
DECREASE="Pomniejsz do"
|
||||
OLINE="Obrys"
|
||||
SHADOW="Cień"
|
||||
DRAW="Rysuj"
|
||||
BORDERS="Obramowanie"
|
||||
_BORDER_WIDTH="Szerokość obramowania"
|
||||
_OLD_STYLE="(dawny styl)"
|
||||
STIPPLED_BORDERS="Nakrapiane"
|
||||
SOLID_LINE="linia ciągła"
|
||||
RUNNING_CONKIES="Uruchomione Conky"
|
||||
STOP_ALL="Zatrzymaj wszystkie"
|
||||
MORECONKIES="Więcej Conky..."
|
||||
CLICKTOSTART="<b>Uruchom</b> więcej Conky..."
|
||||
STARTALL="Uruchom wszystkie"
|
||||
RESET="Resetuj"
|
||||
RESETALL="Resetuj wszystkie"
|
||||
RESETCOLORS="Przywróć domyślne kolory"
|
||||
AREYOUSURE="Czy aby napewno?"
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> - menu główne"
|
||||
_LEFTSIDEPANEL="Lewy panel boczny"
|
||||
;;
|
||||
*)
|
||||
COLORIZECONKY="<b>Conky</b> Widget <b>Manager</b>"
|
||||
NO_CONKY_RUNNING="No Conky running"
|
||||
RUN_CONKY_SESSION="Run Conky session"
|
||||
MOVEABLEALL="Make moveable all..."
|
||||
NOT_FULLY_SUPPORTED="Partially supported"
|
||||
UNSUPPORTED="partially supported Conkies"
|
||||
UNSUPPORTED_START="click to start"
|
||||
_OPEN_CONKYDIR="Open Conky config dir"
|
||||
SCHEMES="Color Schemes"
|
||||
SYSTEM_SCHEMES="System colorschemes"
|
||||
YOUR_SCHEMES="My colorschemes"
|
||||
SAVE_CURRSCHEME="Save current colors as..."
|
||||
OPEN_SCHEMEFILE="Open schemes file in editor"
|
||||
COLORSCHEME="Color Scheme"
|
||||
APPLY_SCHEME="Apply colorscheme"
|
||||
DELETE="Delete"
|
||||
DELETE_SCHEME="Delete colorscheme"
|
||||
MONOCHROMATIC="Monochromatic"
|
||||
CHOOSE_AND_PICK="Choose variant and pick color..."
|
||||
GENERATEFROMWP="Generate from wallpaper colors"
|
||||
LIGHTBG="Light Background"
|
||||
DARKBG="Dark Background"
|
||||
GLOBALSETTINGS="Global settings <small>(apply to all)</small>"
|
||||
REGENERATE="Color schemes"
|
||||
OPENTHEMEDIR="Open schemes dir"
|
||||
_COLORS="colors"
|
||||
DEFCOLOR="Border color"
|
||||
COLOR_0="<small>(color0)</small> Text"
|
||||
COLOR_1="<small>(color1)</small> Text alt"
|
||||
COLOR_2="<small>(color2)</small> Bars/graphs"
|
||||
COLOR_3="<small>(color3)</small> <big>Bigger text</big>"
|
||||
BACKGROUND="Background color"
|
||||
TRANSPARENT="Transparent background?"
|
||||
YES="Yes"
|
||||
NO="No"
|
||||
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"
|
||||
OLINE="Outline"
|
||||
SHADOW="Shadow"
|
||||
DRAW="Draw"
|
||||
BORDERS="Borders"
|
||||
_BORDER_WIDTH="Border width"
|
||||
_OLD_STYLE="(old style)"
|
||||
STIPPLED_BORDERS="Stippled borders"
|
||||
SOLID_LINE="solid line"
|
||||
RUNNING_CONKIES="Running Conkys"
|
||||
STOP_ALL="Stop All"
|
||||
MORECONKIES="More Conkies Available"
|
||||
CLICKTOSTART="<b>Start</b> more Conkies..."
|
||||
STARTALL="Start all"
|
||||
RESET="Reset"
|
||||
RESETALL="Reset all to defaults"
|
||||
RESETCOLORS="Restore default colors"
|
||||
AREYOUSURE="Are you sure?"
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> rootmenu"
|
||||
_LEFTSIDEPANEL="Left Sidepanel"
|
||||
;;
|
||||
esac
|
||||
|
||||
getvalues () {
|
||||
read WINTRANS <<< "$(grep own_window_transparent ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)"
|
||||
read FONTDEF <<< "$(grep "font .*=.*,$" ${BASECONKY} | cut -d'=' -f2,3 |cut -d"'" -f2)"
|
||||
FONT=${FONTDEF%:*}
|
||||
FONTSIZE=${FONTDEF#*=}
|
||||
read WINCLR <<< "$(grep own_window_colour ${BASECONKY} | cut -d'=' -f2 | cut -d"'" -f2)"
|
||||
[[ $WINCLR =~ ^#.* ]] && : || WINCLR="#${WINCLR}"
|
||||
|
||||
read CLR <<< "$(grep default_color ${BASECONKY} | cut -d'=' -f2 | cut -d"'" -f2)"
|
||||
[[ $CLR =~ ^#.* ]] && : || CLR="#${CLR}"
|
||||
read CLR0 <<< "$(grep color0 ${BASECONKY} | cut -d'=' -f2 | cut -d"'" -f2)"
|
||||
[[ $CLR0 =~ ^#.* ]] && : || CLR0="#${CLR0}"
|
||||
read CLR1 <<< "$(grep color1 ${BASECONKY} | cut -d'=' -f2 | cut -d"'" -f2)"
|
||||
[[ $CLR1 =~ ^#.* ]] && : || CLR1="#${CLR1}"
|
||||
read CLR2 <<< "$(grep color2 ${BASECONKY} | cut -d'=' -f2 | cut -d"'" -f2)"
|
||||
[[ $CLR2 =~ ^#.* ]] && : || CLR2="#${CLR2}"
|
||||
read CLR3 <<< "$(grep color3 ${BASECONKY} | cut -d'=' -f2 | cut -d"'" -f2)"
|
||||
[[ $CLR3 =~ ^#.* ]] && : || CLR3="#${CLR3}"
|
||||
read OUTLINE <<< "$(grep draw_outline ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)"
|
||||
read SHADES <<< "$(grep draw_shades ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)"
|
||||
SHADOWS="no"
|
||||
[[ "$OUTLINE" == "true" ]] && SHADOWS="outline"
|
||||
[[ "$SHADES" == "true" ]] && SHADOWS="shadow"
|
||||
|
||||
read BORD <<< "$(grep draw_borders ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)"
|
||||
read BWIDTH <<< "$(grep border_width ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)"
|
||||
read STIP <<< "$(grep stippled_borders ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)"
|
||||
|
||||
#currcolors="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|"
|
||||
cursettings="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|${CLR3}|${WINTRANS}|${OUTLINE}|${SHADES}|${BORD}|${BWIDTH}|${STIP}|"
|
||||
}
|
||||
|
||||
if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then
|
||||
|
||||
getvalues
|
||||
if [ ! -f "$USERSCHEMES" ]; then
|
||||
mkdir -p "$HOME/.config/colorizer/conky/"
|
||||
echo "WINCLR | CLR | CLR0 | CLR1 | CLR2 | CLR3 |WINTRANS|OUTLINE|SHADES | BORD |BWIDTH| STIP |scheme_name" > "$USERSCHEMES"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
[[ "$WINTRANS" == false ]] && BG="bgcolor='$WINCLR'" || BG=""
|
||||
|
||||
#out+=("^sep($COLORIZECONKY)")
|
||||
|
||||
|
||||
#while read -r pid b c confpath
|
||||
#do
|
||||
# filename=${confpath##*/}
|
||||
# name=${filename%%_mb*}
|
||||
# out+=("${name^},^pipe(conkyctl single ${confpath})")
|
||||
#done < <(pgrep -af "conky.*mbcolor")
|
||||
|
||||
# array with running conkies - only filenames with full path
|
||||
readarray -t running < <(pgrep -u $USER -af "conky -c " | cut -d' ' -f4)
|
||||
|
||||
#array with all conkies found
|
||||
#for i in "$CONKYDIR"/*.con* "$CONKYDIR"/**/*.con*; do
|
||||
for i in "$CONKYDIR"/*.conkyrc "$CONKYDIR"/*.conf "$CONKYDIR"/**/*.conkyrc "$CONKYDIR"/**/*.conf; do
|
||||
if [[ "$i" == *mbcolor* ]];then
|
||||
supported+=("$i")
|
||||
else
|
||||
if [[ "$i" != *"/*"* ]];then
|
||||
unsupported+=("$i")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
#array with not started conkies
|
||||
notstarted=($(echo ${running[@]} ${supported[@]} ${unsupported[@]} ${unsupported[@]}| tr ' ' '\n' | sort | uniq -u))
|
||||
notstarted_unsupported=($(echo ${running[@]} ${supported[@]} ${supported[@]} ${unsupported[@]} | tr ' ' '\n' | sort | uniq -u))
|
||||
|
||||
RCONKIES="${#running[@]}"
|
||||
NSCONKIES="${#notstarted[@]}"
|
||||
ALLSUPP=$(($RCONKIES+$NSCONKIES))
|
||||
#notify-send.sh "$ALLSUPP" "$RCONKIES $NSCONKIES"
|
||||
if [[ ${#running[@]} > 0 ]];then
|
||||
out+=("^sep($RUNNING_CONKIES)")
|
||||
for c in ${running[@]};do
|
||||
filename=${c##*/}
|
||||
name=${filename%%_mb*}
|
||||
name2=${name%%.con*}
|
||||
title=${name2//_/ }
|
||||
out+=("${title^},^pipe(conkyctl single ${c})")
|
||||
done
|
||||
out+=("^sep()")
|
||||
out+=("$STOP_ALL (${#running[@]}),conky_toggle;sleep .5;$me")
|
||||
fi
|
||||
if [[ ${#notstarted[@]} > 0 ]];then
|
||||
out+=("^sep($MORECONKIES)")
|
||||
if [[ "$ALLSUPP" < 12 ]];then
|
||||
out+=("^sep(<small><i>$CLICKTOSTART</i></small>)")
|
||||
for c in ${notstarted[@]};do
|
||||
filename=${c##*/}
|
||||
name=${filename%%_mb*}
|
||||
title=${name//_/ }
|
||||
out+=("${title^},conkyctl startone ${c};$me")
|
||||
done
|
||||
if [[ ${#notstarted[@]} > 1 ]];then
|
||||
out+=("^sep()")
|
||||
out+=("$STARTALL (${#notstarted[@]}),conkyctl startall;$me")
|
||||
fi
|
||||
else # too many conkies not started -> show them in submenu
|
||||
out+=("$CLICKTOSTART [ <b>${#notstarted[@]}</b> ],^checkout(nstarted)")
|
||||
out2+=("^tag(nstarted)")
|
||||
out2+=("^sep($CLICKTOSTART)")
|
||||
|
||||
for c in ${notstarted[@]};do
|
||||
filename=${c##*/}
|
||||
name=${filename%%_mb*}
|
||||
title=${name//_/ }
|
||||
out2+=("${title^},conkyctl startone ${c};$me")
|
||||
done
|
||||
if [[ ${#notstarted[@]} > 1 ]];then
|
||||
out2+=("^sep()")
|
||||
out2+=("$STARTALL (${#notstarted[@]}),conkyctl startall;$me")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ ${#notstarted_unsupported[@]} > 0 ]];then
|
||||
out+=("^sep()")
|
||||
out+=("$NOT_FULLY_SUPPORTED (${#notstarted_unsupported[@]}),^checkout(unsup)")
|
||||
out2+=("^tag(unsup)")
|
||||
out2+=("^sep($UNSUPPORTED)")
|
||||
out2+=("^sep($UNSUPPORTED_START)")
|
||||
for c in ${notstarted_unsupported[@]};do
|
||||
filename=${c##*/}
|
||||
name=${filename%%.con*}
|
||||
title=${name//_/ }
|
||||
out2+=("${title^},conkyctl startone ${c};$me")
|
||||
done
|
||||
fi
|
||||
out+=("^sep()")
|
||||
out+=("<big></big> $_OPEN_CONKYDIR,xdg-open ${CONKYDIR}")
|
||||
|
||||
#GLOBAL START
|
||||
out+=("^sep($GLOBALSETTINGS)")
|
||||
out+=(" $MOVEABLEALL,conkyctl makemoveableall")
|
||||
out+=("^sep()")
|
||||
[[ "$WINTRANS" = true ]] && bga=1 || bga=100
|
||||
if [[ "${CLR3}" == "#" ]];then
|
||||
case "$LANG" in
|
||||
pl*)_UPD_NEEDED="Dostępna aktualizacja konfigów Conky!!!"
|
||||
_UPD_NOW="Aktualizuj teraz!"
|
||||
;;
|
||||
*)_UPD_NEEDED="Conky configs update needed !!!"
|
||||
_UPD_NOW="Update now!"
|
||||
;;
|
||||
esac
|
||||
out+=("<span fgcolor='white' bgcolor='red'> $_UPD_NEEDED </span>,^checkout(conkyupdglob)")
|
||||
out3+=("^tag(conkyupdglob)")
|
||||
out3+=("^sep($_UPD_NEEDED)")
|
||||
out3+=("$_UPD_NOW <small>(mb-reset conky)</small>,mb-reset conky")
|
||||
CLR3=${CLR}
|
||||
recolor3=1
|
||||
fi
|
||||
|
||||
out+=("<big><span bgcolor='$WINCLR' bgalpha='${bga}%'><span bgcolor='$CLR'> </span> <span fgcolor='$CLR0'></span> <span fgcolor='$CLR1'></span> <span fgcolor='$CLR2'></span> <span bgcolor='$CLR'> </span></span></big> $REGENERATE,^checkout(regenconky)")
|
||||
out2+=("^tag(regenconky)")
|
||||
out2+=("^sep($REGENERATE)")
|
||||
out2+=("^sep($MONOCHROMATIC)")
|
||||
out2+=("^sep(<i>$CHOOSE_AND_PICK</i>)")
|
||||
out2+=("<big></big> $DARKBG...,conkyctl mono pick dark")
|
||||
out2+=("<big></big> $LIGHTBG...,conkyctl mono pick light")
|
||||
|
||||
out2+=("^sep($GENERATEFROMWP)")
|
||||
out2+=("<big><span bgcolor='${w[-1]}' fgcolor='${w[0]}'> $LIGHTBG <span fgcolor='${w[4]}'></span> <span fgcolor='${w[5]}'></span> </span></big>,w2theme conky light;$me")
|
||||
out2+=("<big><span bgcolor='${w[0]}' fgcolor='${w[-1]}'> $DARKBG <span fgcolor='${w[-4]}'></span> <span fgcolor='${w[-5]}'></span> </span></big>,w2theme conky dark;$me")
|
||||
|
||||
out2+=("^sep($SYSTEM_SCHEMES)")
|
||||
n=1
|
||||
while IFS="|" read -r winclr clr clr0 clr1 clr2 clr3 wintrans outline shades bord bwidth stip scheme_name
|
||||
do
|
||||
((n=n+1))
|
||||
[[ "$wintrans" = true ]] && bga=1 || bga=100
|
||||
out2+=("<tt>$(printf '%-20s' "${scheme_name}")</tt><big><span bgcolor='$winclr' bgalpha='${bga}%'><span bgcolor='$clr'> </span> <span fgcolor='$clr0'></span> <span fgcolor='$clr1'></span> <span fgcolor='$clr2'></span> <span fgcolor='$clr3'></span> <span bgcolor='$clr'> </span></span></big>,conkyctl applyscheme_all sys ${n};$me")
|
||||
done < <(tail -n +2 "$SYSSCHEMES")
|
||||
|
||||
out2+=("^sep($YOUR_SCHEMES)")
|
||||
out2+=("<big></big> $SAVE_CURRSCHEME,conkyctl savescheme '${cursettings}';$me")
|
||||
out2+=("<big></big> $OPEN_SCHEMEFILE,xdg-open $USERSCHEMES")
|
||||
out2+=("^sep()")
|
||||
|
||||
n=1
|
||||
while IFS="|" read -r winclr clr clr0 clr1 clr2 clr3 wintrans outline shades bord bwidth stip scheme_name
|
||||
do
|
||||
((n=n+1))
|
||||
[[ "$wintrans" = true ]] && bga=1 || bga=100
|
||||
out2+=("<tt>$(printf '%-20s' "${scheme_name}")</tt><big><span bgcolor='$winclr' bgalpha='${bga}%'><span bgcolor='$clr'> </span> <span fgcolor='$clr0'></span> <span fgcolor='$clr1'></span> <span fgcolor='$clr2'></span> <span fgcolor='$clr3'></span> <span bgcolor='$clr'> </span></span></big>,^checkout(sch${n})")
|
||||
#echo "${own_window_colour}|${default_color}|${color0}|${color1}|${color2}|${themename}" >> "$USERSCHEMES"
|
||||
out3+=("^tag(sch${n}")
|
||||
out3+=("^sep($COLORSCHEME: ${scheme_name})")
|
||||
out3+=("<big></big> $APPLY_SCHEME <big><span bgcolor='$winclr' bgalpha='${bga}%'><span bgcolor='$clr'> </span> <span fgcolor='$clr0'></span> <span fgcolor='$clr1'></span> <span fgcolor='$clr2'></span> <span fgcolor='$clr3'></span> <span bgcolor='$clr'> </span></span></big>,conkyctl applyscheme_all usr ${n};$me")
|
||||
out3+=("^sep($DELETE)")
|
||||
out3+=("<big></big> $DELETE_SCHEME ${scheme_name},conkyctl delscheme ${n};$me")
|
||||
done < <(tail -n +2 "$USERSCHEMES")
|
||||
|
||||
|
||||
|
||||
|
||||
out+=("^sep()")
|
||||
|
||||
|
||||
out+=("<big></big> $FONTS [ <b><span font_family=\"${FONT}\">$FONT</span> $FONTSIZE</b> ],^checkout(font)")
|
||||
out2+=("^tag(font)")
|
||||
out2+=("^sep($FONTS)")
|
||||
out2+=("<big></big> $SELECTFONT [ <b><span font_family=\"${FONT}\">$FONT</span> $FONTSIZE</b> ],mb-setfont conky_all;$me")
|
||||
out2+=("^sep($FONTSIZE_LBL)")
|
||||
out2+=("<big></big> $INCREASE <b>$((FONTSIZE+1)) px</b>,conkyctl basefont_inc_all;$me")
|
||||
out2+=("<big></big> $DECREASE <b>$((FONTSIZE-1)) px</b>,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+=("<big>綠</big> <b>$i px</b>,conkyctl basefont_size_all $i;$me") || out2+=("<big>祿</big> $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
|
||||
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+=("<big>綠</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>祿</big> <span font_family=\"${fon}\">${fon}</span>,conkyctl basefont_family_all \"${fon}\";$me")
|
||||
done
|
||||
fi
|
||||
out2+=("^sep()")
|
||||
out2+=("<small> $_EDIT_FAVFONTS</small>,geany ~/.config/mabox/fonts.list")
|
||||
|
||||
|
||||
[[ "$SHADOWS" == "shadow" ]] && out+=("<big></big> $SHADOW,conkyctl shades_all no;$me") || out+=("<big></big> $SHADOW,conkyctl shades_all shadow;$me")
|
||||
[[ "$SHADOWS" == "outline" ]] && out+=("<big></big> $OLINE,conkyctl shades_all no;$me") || out+=("<big></big> $OLINE,conkyctl shades_all outline;$me")
|
||||
out+=("^sep()")
|
||||
|
||||
[[ "$BORD" == false ]] && out+=("<big></big> $BORDERS [ <b>$BWIDTH px</b> ],^checkout(border)") || out+=("<big></big> $BORDERS [ <b>$BWIDTH px</b> ],^checkout(border)")
|
||||
|
||||
out2+=("^tag(border)")
|
||||
out2+=("^sep($DRAW $BORDERS?)")
|
||||
[[ "$BORD" == false ]] && out2+=("<big>祿</big> $YES,conkyctl draw_borders_all true;$me") || out2+=("<big>綠</big> $YES,conkyctl draw_borders_all false;$me")
|
||||
[[ "$BORD" == false ]] && out2+=("<big>綠</big> $NO,conkyctl draw_borders_all true;$me") || out2+=("<big>祿</big> $NO,conkyctl draw_borders_all false;$me")
|
||||
|
||||
out2+=("^sep($_BORDER_WIDTH)")
|
||||
[[ "${BWIDTH}" == "1" ]] && out2+=("<big>綠</big> <b>1 px</b> ${_OLD_STYLE}") || out2+=("<big>祿</big> 1 px ${_OLD_STYLE},conkyctl border_width_all 1")
|
||||
for i in 2 4 6 8 10 12;do
|
||||
[[ "${BWIDTH}" == "${i}" ]] && out2+=("<big>綠</big> <b>${i} px</b>") || out2+=("<big>祿</big> ${i} px,conkyctl border_width_all ${i}")
|
||||
done
|
||||
|
||||
out2+=("^sep($STIPPLED_BORDERS?)")
|
||||
[[ "$STIP" == 0 ]] && out2+=("<big>綠</big> 0 ($SOLID_LINE),conkyctl stippled_borders_all 0;$me") || out2+=("<big>祿</big> 0 ($SOLID_LINE),conkyctl stippled_borders_all 0;$me")
|
||||
out2+=("^sep()")
|
||||
[[ "$STIP" == 1 ]] && out2+=("<big>綠</big> 1 px,conkyctl stippled_borders_all 1;$me") || out2+=("<big>祿</big> 1 px,conkyctl stippled_borders_all 1;$me")
|
||||
[[ "$STIP" == 2 ]] && out2+=("<big>綠</big> 2 px,conkyctl stippled_borders_all 2;$me") || out2+=("<big>祿</big> 2 px,conkyctl stippled_borders_all 2;$me")
|
||||
[[ "$STIP" == 3 ]] && out2+=("<big>綠</big> 3 px,conkyctl stippled_borders_all 3;$me") || out2+=("<big>祿</big> 3 px,conkyctl stippled_borders_all 3;$me")
|
||||
[[ "$STIP" == 4 ]] && out2+=("<big>綠</big> 4 px,conkyctl stippled_borders_all 4;$me") || out2+=("<big>祿</big> 4 px,conkyctl stippled_borders_all 4;$me")
|
||||
|
||||
out+=("^sep($_COLORS)")
|
||||
pgrep -af "conky/sysinfo_mbcolor" > /dev/null || out+=("<big><span bgcolor='red' fgcolor='white'> README <small>(important info)</small> </span></big>,conkyctl baseconky_info")
|
||||
if [ "$WINTRANS" == false ];then
|
||||
out+=("$BACKGROUND <span bgcolor='$WINCLR'> </span><span weight='bold' ${BG} fgcolor='$WINCLR'> AbCd </span>,^pipe(mbclr '$WINCLR' conkyctl win_bgcolor_all '${BACKGROUND}' '$me')")
|
||||
else
|
||||
out+=("$BACKGROUND <span> transparent </span> ,^pipe(mbclr '$WINCLR' conkyctl win_bgcolor_all '${BACKGROUND}' '$me')")
|
||||
fi
|
||||
[[ "$WINTRANS" == false ]] && out+=("<big></big> $TRANSPARENT,conkyctl transparent_all true;$me") || out+=("<big></big> $TRANSPARENT,conkyctl transparent_all false;$me")
|
||||
out+=("^sep()")
|
||||
|
||||
if [[ "${recolor3}" == "1" ]];then
|
||||
CLR3="#"
|
||||
recolor3=0
|
||||
fi
|
||||
out+=("$DEFCOLOR <span bgcolor='$CLR'> </span><span weight='normal' ${BG} fgcolor='$CLR'> border </span><span bgcolor='$CLR'> </span>,^pipe(mbclr '$CLR' conkyctl default_color_all '${DEFCOLOR}' '$me')")
|
||||
out+=("$COLOR_0 <span weight='normal' ${BG} fgcolor='$CLR0'> AbCd </span><span bgcolor='$CLR0'> </span>,^pipe(mbclr '$CLR0' conkyctl color0_all '${COLOR_0}' '$me')")
|
||||
out+=("$COLOR_1 <span weight='normal' ${BG} fgcolor='$CLR1'> AbCd </span><span bgcolor='$CLR1'> </span>,^pipe(mbclr '$CLR1' conkyctl color1_all '${COLOR_1}' '$me')")
|
||||
out+=("$COLOR_2 <span weight='bold' ${BG} fgcolor='$CLR2'> </span><span bgcolor='$CLR2'> </span>,^pipe(mbclr '$CLR2' conkyctl color2_all '${COLOR_2}' '$me')")
|
||||
[[ "$CLR3" != "#" ]] && out+=("$COLOR_3 <span weight='bold' ${BG} fgcolor='$CLR3'> AbCd </span><span bgcolor='$CLR3'> </span>,^pipe(mbclr '$CLR3' conkyctl color3_all '${COLOR_3}' '$me')")
|
||||
#out+=("^sep()")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#out+=("^sep($RESET)")
|
||||
#out+=(" $RESETCOLORS,^checkout(resetcolors)")
|
||||
#out2+=("^tag(resetcolors)")
|
||||
#out2+=("^sep($AREYOUSURE)")
|
||||
#out2+=("$YES,conkyctl resetcolorsall;$me")
|
||||
#out+=(" $RESETALL,^checkout(resetall)") NOT SAFE!!!
|
||||
#out2+=("^tag(resetall)")
|
||||
#out2+=("^sep($AREYOUSURE)")
|
||||
#out2+=("$YES,rm $BASECONKY;$me")
|
||||
|
||||
else
|
||||
out+=("^sep($NO_CONKY_RUNNING)")
|
||||
SESSIONFILE=$HOME/.config/conky/conky-sessionfile
|
||||
if [ -f "$SESSIONFILE" ];then
|
||||
read N REST <<< $(wc -l "${SESSIONFILE}")
|
||||
if [[ "$N" -gt "0" ]];then
|
||||
out+=("$RUN_CONKY_SESSION ($N Conky),conky_toggle;$me")
|
||||
fi
|
||||
fi
|
||||
|
||||
out+=("^sep(<small><i>$CLICKTOSTART</i></small>)")
|
||||
for confpath in "$CONKYDIR"/*_mb*;
|
||||
do
|
||||
filename=${confpath##*/}
|
||||
name=${filename%%_mb*}
|
||||
title=${name//_/ }
|
||||
out+=("${title^},conkyctl startone ${confpath};$me")
|
||||
done
|
||||
out+=("^sep()")
|
||||
out+=("$STARTALL,conkyctl startall;$me")
|
||||
fi
|
||||
|
||||
### RUN
|
||||
if [[ "$1" == "-s" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
source $HOME/.config/colorizer/colorizer.conf
|
||||
|
||||
out+=("^sep()")
|
||||
out+=(" ${arrow_string_left} $_COLORIZER_ROOT,colorizer -s")
|
||||
out+=(" ${arrow_string_left} ${arrow_string_left} $_LEFTSIDEPANEL,mb-jgtools places")
|
||||
|
||||
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
|
||||
TABS=160
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
||||
MENU_PADDING_TOP=$((jgtools_padding + 152))
|
||||
|
||||
#WALLPAPER
|
||||
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | 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
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
||||
@icon,,$((jgtools_padding+8)),$((jgtools_padding+8)),32,32,4,left,top,,,${HOME}/.icons/mabox-logo-square.svg
|
||||
@rect,,$((jgtools_padding+4)),$((jgtools_padding + 116)),262,28,0,left,top,#222222 20,#222222 70,
|
||||
#@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-conky.png
|
||||
@text,,$((jgtools_padding + 80)),$((jgtools_padding + 116)),190,30,0,left,top,#FFFFFF ,${WINCLR},<span size='10400' font_family='Ubuntu'>${COLORIZECONKY}</span>
|
||||
@rect,,$((jgtools_padding + 235)),$((jgtools_padding + 6)),29,60,0,left,top,#FFFFFF 30,${WINCLR} 60,
|
||||
@rect,,$((jgtools_padding + 6)),$((jgtools_padding + 84)),29,60,0,left,top,#FFFFFF 30,${WINCLR} 60,
|
||||
@rect,,$((jgtools_padding + 38)),$((jgtools_padding + 104)),29,40,0,left,top,#FFFFFF 30,${WINCLR} 60,
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf '%s\n' "${out[@]}"
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
|
||||
Reference in New Issue
Block a user