master 0.9.22
Daniel Napora 2023-01-05 19:28:22 +01:00
parent df900b8961
commit 9ea2e57349
5 changed files with 66 additions and 18 deletions

View File

@ -288,7 +288,7 @@ out+=("^sep()")
out+=(" $COLORIZE,^pipe(randomizer c)")
out+=("^sep($MODULES)")
out+=("$OBTHEME,^pipe(colorizer-ob)")
out+=("Conky,^pipe(colorizer-conky)")
out+=("Conky Manager,^pipe(colorizer-conky)")
out+=("$MENUPANELS,^pipe(colorizer-menus)")
#out+=("TINT2,^pipe(colorizer-tint2)")
#out+=("Systray HW monitor,^pipe(colorizer-phwmon)")

View File

@ -30,7 +30,7 @@ fi
case "$LANG" in
pl*)
COLORIZECONKY="Conky Colorizer"
COLORIZECONKY="Conky Manager"
NO_CONKY_RUNNING="Brak uruchomionych Conky"
RUN_CONKY_SESSION="Uruchom zapisaną sesję"
MOVEABLEALL="Ustaw wszystkie (<i>przeciągaj</i>)..."
@ -70,7 +70,7 @@ case "$LANG" in
AREYOUSURE="Czy aby napewno?"
;;
*)
COLORIZECONKY="Colorize Conky"
COLORIZECONKY="Conky Manager"
NO_CONKY_RUNNING="No Conky running"
RUN_CONKY_SESSION="Run Conky session"
MOVEABLEALL="Make moveable all..."
@ -153,15 +153,21 @@ if pgrep -af "conky.*mbcolor" >/dev/null; then
#done < <(pgrep -af "conky.*mbcolor")
# array with running conkies - only filenames with full path
readarray -t running < <(pgrep -af "conky -c.*mbcolor" | cut -d' ' -f4)
readarray -t running < <(pgrep -af "conky -c " | cut -d' ' -f4)
#array with all supported conkies
for i in "$CONKYDIR"/*_mbcolor*; do
for i in "$CONKYDIR"/*.con* "$CONKYDIR"/**/*.con*; do
if [[ "$i" == *mbcolor* ]];then
supported+=("$i")
else
unsupported+=("$i")
fi
done
#array with not started conkies
notstarted=($(echo ${running[@]} ${supported[@]} | tr ' ' '\n' | sort | uniq -u))
notstarted=($(echo ${running[@]} ${supported[@]} ${unsupported[@]} ${unsupported[@]}| tr ' ' '\n' | sort | uniq -u))
notstarted_unsupported=($(echo ${running[@]} ${supported[@]} ${supported[@]} ${unsupported[@]} | tr ' ' '\n' | sort | uniq -u))
if [[ ${#running[@]} > 0 ]];then
out+=("^sep($RUNNING_CONKIES)")
@ -173,7 +179,8 @@ if pgrep -af "conky.*mbcolor" >/dev/null; then
done
out+=("^sep()")
out+=("$STOP_ALL (${#running[@]}),conky_toggle;sleep .5;$me")
if [[ ${#notstarted[@]} > 0 ]];then
fi
if [[ ${#notstarted[@]} > 0 ]];then
out+=("^sep($MORECONKIES)")
out+=("^sep(<small><i>$CLICKTOSTART</i></small>)")
for c in ${notstarted[@]};do
@ -181,13 +188,25 @@ if pgrep -af "conky.*mbcolor" >/dev/null; then
name=${filename%%_mb*}
title=${name//_/ }
out+=("${title^},conkyctl startone ${c};$me")
done
done
if [[ ${#notstarted[@]} > 1 ]];then
out+=("^sep()")
out+=("$STARTALL (${#notstarted[@]}),conkyctl startall;$me")
fi
fi
fi
fi
if [[ ${#notstarted_unsupported[@]} > 0 ]];then
out+=("^sep()")
out+=("UNSUPPORTED,^checkout(unsup)")
out2+=("^tag(unsup)")
out2+=("^sep(UNSUPPORTED)")
for c in ${notstarted_unsupported[@]};do
filename=${c##*/}
name=${filename%%_mb*}
title=${name//_/ }
out2+=("${title^},conkyctl startone ${c};$me")
done
fi
#GLOBAL START
out+=("^sep($GLOBALSETTINGS)")

View File

@ -193,12 +193,12 @@ out+=("^sep(<i>$GENERATEFROMWP</i>)")
out+=("$LIGHTBG,w2theme ob light;$me")
out+=("$DARKBG,w2theme ob dark;$me")
out+=("^sep($TITLEBAR)")
out+=("<tt><span bgcolor='$ABG'> </span></tt> $ACTIVE_BG,^pipe(mbclr '$ABG' obtctl clractivebg '${ACTIVE_BG}' '$me')")
out+=("<tt><span bgcolor='$ABG'> </span></tt> $ACTIVE_BG,^pipe(mbclr '$ABG' obtctl clractivebg_only '${ACTIVE_BG}' '$me')")
[[ ! -z "$ABGTO" ]] && out+=("<tt><span bgcolor='$ABG'> </span><span bgcolor='$ABGTO'> </span></tt> $ACTIVE_BG_TO,^pipe(mbclr '$ABGTO' obtctl clractivebgto '${ACTIVE_BG_TO}' '$me')")
out+=("<tt><span bgcolor='$ABG' fgcolor='$AFG'> <b>AbCd</b> </span></tt> $TITLEBAR_TEXT,^checkout(titletext)")
out+=("^sep()")
out+=("<tt><span bgcolor='$NBG'> </span></tt> $INACTIVE_BG,^pipe(mbclr '$NBG' obtctl clrnormalbg '${INACTIVE_BG}' '$me')")
out+=("<tt><span bgcolor='$NBG'> </span></tt> $INACTIVE_BG,^pipe(mbclr '$NBG' obtctl clrnormalbg_only '${INACTIVE_BG}' '$me')")
[[ ! -z "$ABGTO" ]] && out+=("<tt><span bgcolor='$NBG'> </span><span bgcolor='$NBGTO'> </span></tt> $INACTIVE_BG_TO,^pipe(mbclr '$NBGTO' obtctl clrnormalbgto '${INACTIVE_BG_TO}' '$me')")
out+=("^sep()")

View File

@ -18,7 +18,9 @@ update_session () {
while read -r pid b c confpath
do
echo "$b $c ${confpath} & sleep .5" >> ${SESSIONFILE}
done < <(pgrep -af "conky .*mbcolor")
done < <(pgrep -af "conky -c ")
# Remove duplicates
awk -i inplace '!seen[$0]++' ${SESSIONFILE}
}
transparent_all () {
@ -35,6 +37,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 "${2}" aaa
}
draw_borders_all () {
@ -234,7 +237,7 @@ fi
}
startone () {
conky -c "${1}"
conky -c "${1}" &
update_session
}
startall () {
@ -242,7 +245,7 @@ startall () {
if pgrep -af "conky .*${i}" >/dev/null; then
:
else
conky -c "${i}"
conky -c "${i}" &
fi
done
update_session
@ -253,7 +256,7 @@ kill () {
}
restartone () {
kill ${1}
startone ${1}
startone ${1}
}
makemoveableall () {
wmctrl -k on
@ -554,7 +557,14 @@ single () {
[[ "$WINTRANS" == false ]] && BG="bgcolor='$WINCLR'" || BG=""
if [[ "$filename" == *"mbcolor"* ]];then
out+=("^sep(Conky: [ ${title^} ])")
else
out+=("^sep(Conky: [ ${title^} ]")
out+=("^sep(<span bgcolor='red'> unsupported!!! </span>)")
fi
out+=(" $POSITION,^checkout(position)")
if [[ "$1" =~ "etwork_mbcolor" ]]; then
out+=("$NOT_WORKING,conkyctl netdevice")
@ -819,7 +829,7 @@ contextmenu () {
out+=("^sep()")
out+=("<small>$EDIT_CUSTOMCOMMANDS</small>,touch ${CONKYDIR}/menuscripts/${name}.csv;sleep 1;xdg-open ${CONKYDIR}/menuscripts/${name}.csv")
out+=("^sep()")
out+=(" ⮜⮜⮜ Colorizer Conky,colorizer-conky -s")
out+=(" ⮜⮜⮜ Conky Manager (Colorizer),colorizer-conky -s")
if [[ "$CONKYCFG" =~ "mount_points" ]]; then
out+=("^sep($MOUNTPOINTS)")

View File

@ -238,7 +238,20 @@ activehandle () {
;;
esac
}
clractivebg_only () {
sd "^window.active.title.bg.color:.*$" "window.active.title.bg.color: ${1}" ${THEMERC}
# calculate color for title.fg and buttons
TITLE_FG=$(pastel textcolor ${1}|pastel format hex)
if [[ "${TITLE_FG}" == *"ffffff"* ]];then
TITLE_FG="#EEEEEE"
else
TITLE_FG="#111111"
fi
sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC}
# Button colors
activebuttonscolors "${TITLE_FG}"
}
clractivebg () {
colorTo=$(pastel darken 0.1 "${1}"|pastel format hex)
#activehandle?
@ -275,6 +288,10 @@ clractivebg () {
}
clrnormalbg_only () {
sd "^window.inactive.title.bg.color:.*$" "window.inactive.title.bg.color: ${1}" ${THEMERC}
}
clrnormalbg () {
colorTo=$(pastel darken 0.1 "${1}"|pastel format hex)
#normalhandle?
@ -532,8 +549,10 @@ case "$1" in
random_gradient) random_gradient;;
activegradient) activegradient "$2" "$3";;
activehandle) activehandle "$2";;
clractivebg_only) clractivebg_only "$2";; #ADVANCED - do not calculate colorTo
clractivebg) clractivebg "$2";;
clractivebgto) clractivebgto "$2";;
clrnormalbg_only) clrnormalbg_only "$2";;
clrnormalbg) clrnormalbg "$2";;
clrnormalbgto) clrnormalbgto "$2";;
activetextcolor) activetextcolor "$2";;