From b13031b9d997eeeed5f26bb3bba1e29bc24e3f39 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Thu, 26 May 2022 22:39:07 +0200 Subject: [PATCH] logo conky --- bin/colorizer-conky | 7 ++++++- bin/conkyctl | 18 ++++++++++++++++++ .../mabox-colorizer/conky/logo_mbcolor.conkyrc | 7 +++---- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/bin/colorizer-conky b/bin/colorizer-conky index f2a9294..ab2612f 100755 --- a/bin/colorizer-conky +++ b/bin/colorizer-conky @@ -3,8 +3,13 @@ me="colorizer-conky -s" CONKYDIR="$HOME/.config/conky" BASECONKY="$CONKYDIR/sysinfo_mbcolor.conkyrc" +LNG=${LANG:0:2} if [ ! -f "${BASECONKY}" ]; then -rsync -a /usr/share/mabox-colorizer/conky/* ${CONKYDIR}/ +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" diff --git a/bin/conkyctl b/bin/conkyctl index 31e23a7..fd524ce 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -125,6 +125,12 @@ shades () { ;; esac } +logosize () { + sd "minimum_height.*$" "minimum_height = ${1}," ${CONKYDIR}/logo_mbcolor.conkyrc + sd "minimum_width.*$" "minimum_width = ${1}," ${CONKYDIR}/logo_mbcolor.conkyrc + sd "\{image ~.*$" "{image ~/.config/conky/images/mabox_3d.png -s ${1}x${1}}" ${CONKYDIR}/logo_mbcolor.conkyrc +} + pos () { def_x=${conky_gap_x:-30} def_y=${conky_gap_y:-60} @@ -228,6 +234,17 @@ single () { out2+=("${i},conkyctl gap_y ${i} ${1};$me") done + if [[ "$1" =~ "logo_mbcolor" ]]; then + read LSIZE <<< "$(grep minimum_height ${1} | cut -d'=' -f2 | cut -d"," -f1)" + out+=("^sep(Size)") + out+=("Logo size [ $LSIZE ],^checkout(logosize)") + out2+=("^tag(logosize)") + out2+=("^sep(Logo size)") + out2+=("Small 64px,conkyctl logosize 64;$me") + out2+=("Normal 128px,conkyctl logosize 128;$me") + out2+=("Big 256px,conkyctl logosize 256;$me") + fi + out+=("^sep(COLORS)") [[ "$CLR" != "#" ]] && out+=(" AbCd Default color,^pipe(mbclr '$CLR' conkyctl default_color DEFAULT_COLOR '$me' ${1})") [[ "$CLR0" != "#" ]] && out+=(" AbCd Color 0,^pipe(mbclr '$CLR0' conkyctl color0 COLOR_0 '$me' ${1})") @@ -310,6 +327,7 @@ case "$1" in serfont) setfont;; shades_all) shades_all "$2";; shades) shades "$2" "$3";; + logosize) logosize "$2";; single) single "$2";; pos) pos "$2" "$3";; gap_x) gap_x "$2" "$3";; diff --git a/share/mabox-colorizer/conky/logo_mbcolor.conkyrc b/share/mabox-colorizer/conky/logo_mbcolor.conkyrc index 2b80e70..6775467 100644 --- a/share/mabox-colorizer/conky/logo_mbcolor.conkyrc +++ b/share/mabox-colorizer/conky/logo_mbcolor.conkyrc @@ -11,8 +11,8 @@ conky.config = { alignment = 'middle_middle', gap_x = 0, gap_y = 0, - minimum_height = 220, - minimum_width = 220, + minimum_height = 128, + minimum_width = 128, -- FONTS use_xft = true, @@ -63,8 +63,7 @@ conky.config = { }; conky.text = [[ -${image $HOME/.config/conky/images/mabox_3d.png -s 220x220} -${voffset 200}${color0}${alignc}M A B O X L I N U X +${image ~/.config/conky/images/mabox_3d.png -s 128x128} ]];