Show Us Your Conky

Good work, glad you got it working.

Messing around with conky. Borrowed bits from archlabs conky, Dobbie03 and KoO

6 Likes

That looks great @wickedlester

1 Like


My little β€œTest Conky” where I try some fun stuff.

I’m interested in the little arrows that rotate ↑ β†’ ↓ ← every second.

I’m wondering if there is a more efficient way to do this.
How I have it now is pure conky:

${alignc}${color5}${swapbar 0,30}${color} ↓ test code ↓ ${color5}${swapbar 0,30}${color}
${color9}${alignc}------------------------------------${color}
 ${time %T} seconds or ${time %H:%M }${if_match ${time %S} == 00}↑${else}${endif}\
${if_match ${time %S} == 01}β†’${else}${endif}\
${if_match ${time %S} == 02}↓${else}${endif}\
${if_match ${time %S} == 03}←${else}${endif}\
${if_match ${time %S} == 04}↑${else}${endif}\
${if_match ${time %S} == 05}β†’${else}${endif}\
${if_match ${time %S} == 06}↓${else}${endif}\
${if_match ${time %S} == 07}←${else}${endif}\
${if_match ${time %S} == 08}↑${else}${endif}\
${if_match ${time %S} == 09}β†’${else}${endif}\
${if_match ${time %S} == 10}↓${else}${endif}\
${if_match ${time %S} == 11}←${else}${endif}\
${if_match ${time %S} == 12}↑${else}${endif}\
${if_match ${time %S} == 13}β†’${else}${endif}\
${if_match ${time %S} == 14}↓${else}${endif}\
${if_match ${time %S} == 15}←${else}${endif}\
${if_match ${time %S} == 16}↑${else}${endif}\
${if_match ${time %S} == 17}β†’${else}${endif}\
${if_match ${time %S} == 18}↓${else}${endif}\
${if_match ${time %S} == 19}←${else}${endif}\
${if_match ${time %S} == 20}↑${else}${endif}\
${if_match ${time %S} == 21}β†’${else}${endif}\
${if_match ${time %S} == 22}↓${else}${endif}\
${if_match ${time %S} == 23}←${else}${endif}\
${if_match ${time %S} == 24}↑${else}${endif}\
${if_match ${time %S} == 25}β†’${else}${endif}\
${if_match ${time %S} == 26}↓${else}${endif}\
${if_match ${time %S} == 27}←${else}${endif}\
${if_match ${time %S} == 28}↑${else}${endif}\
${if_match ${time %S} == 29}β†’${else}${endif}\
${if_match ${time %S} == 30}↓${else}${endif}\
${if_match ${time %S} == 31}←${else}${endif}\
${if_match ${time %S} == 32}↑${else}${endif}\
${if_match ${time %S} == 33}β†’${else}${endif}\
${if_match ${time %S} == 34}↓${else}${endif}\
${if_match ${time %S} == 35}←${else}${endif}\
${if_match ${time %S} == 36}↑${else}${endif}\
${if_match ${time %S} == 37}β†’${else}${endif}\
${if_match ${time %S} == 38}↓${else}${endif}\
${if_match ${time %S} == 39}←${else}${endif}\
${if_match ${time %S} == 40}↑${else}${endif}\
${if_match ${time %S} == 41}β†’${else}${endif}\
${if_match ${time %S} == 42}↓${else}${endif}\
${if_match ${time %S} == 43}←${else}${endif}\
${if_match ${time %S} == 44}↑${else}${endif}\
${if_match ${time %S} == 45}β†’${else}${endif}\
${if_match ${time %S} == 46}↓${else}${endif}\
${if_match ${time %S} == 47}←${else}${endif}\
${if_match ${time %S} == 48}↑${else}${endif}\
${if_match ${time %S} == 49}β†’${else}${endif}\
${if_match ${time %S} == 50}↓${else}${endif}\
${if_match ${time %S} == 51}←${else}${endif}\
${if_match ${time %S} == 52}↑${else}${endif}\
${if_match ${time %S} == 53}β†’${else}${endif}\
${if_match ${time %S} == 54}↓${else}${endif}\
${if_match ${time %S} == 55}←${else}${endif}\
${if_match ${time %S} == 56}↑${else}${endif}\
${if_match ${time %S} == 57}β†’${else}${endif}\
${if_match ${time %S} == 58}↓${else}${endif}\
${if_match ${time %S} == 59}←${else}${endif}

${time %H:%M} ${if_match ${time %S} == 00}↑${else}${endif}\
${if_match ${time %S} == 01}β†’${else}${endif}\
${if_match ${time %S} == 02}↓${else}${endif}\
${if_match ${time %S} == 03}←${else}${endif}\
${if_match ${time %S} == 04}↑${else}${endif}\
${if_match ${time %S} == 05}β†’${else}${endif}\
${if_match ${time %S} == 06}↓${else}${endif}\
${if_match ${time %S} == 07}←${else}${endif}\
${if_match ${time %S} == 08}↑${else}${endif}\
${if_match ${time %S} == 09}β†’${else}${endif}\
${if_match ${time %S} == 10}↓${else}${endif}\
${if_match ${time %S} == 11}←${else}${endif}\
${if_match ${time %S} == 12}↑${else}${endif}\
${if_match ${time %S} == 13}β†’${else}${endif}\
${if_match ${time %S} == 14}↓${else}${endif}\
${if_match ${time %S} == 15}←${else}${endif}\
${if_match ${time %S} == 16}↑${else}${endif}\
${if_match ${time %S} == 17}β†’${else}${endif}\
${if_match ${time %S} == 18}↓${else}${endif}\
${if_match ${time %S} == 19}←${else}${endif}\
${if_match ${time %S} == 20}↑${else}${endif}\
${if_match ${time %S} == 21}β†’${else}${endif}\
${if_match ${time %S} == 22}↓${else}${endif}\
${if_match ${time %S} == 23}←${else}${endif}\
${if_match ${time %S} == 24}↑${else}${endif}\
${if_match ${time %S} == 25}β†’${else}${endif}\
${if_match ${time %S} == 26}↓${else}${endif}\
${if_match ${time %S} == 27}←${else}${endif}\
${if_match ${time %S} == 28}↑${else}${endif}\
${if_match ${time %S} == 29}β†’${else}${endif}\
${if_match ${time %S} == 30}↓${else}${endif}\
${if_match ${time %S} == 31}←${else}${endif}\
${if_match ${time %S} == 32}↑${else}${endif}\
${if_match ${time %S} == 33}β†’${else}${endif}\
${if_match ${time %S} == 34}↓${else}${endif}\
${if_match ${time %S} == 35}←${else}${endif}\
${if_match ${time %S} == 36}↑${else}${endif}\
${if_match ${time %S} == 37}β†’${else}${endif}\
${if_match ${time %S} == 38}↓${else}${endif}\
${if_match ${time %S} == 39}←${else}${endif}\
${if_match ${time %S} == 40}↑${else}${endif}\
${if_match ${time %S} == 41}β†’${else}${endif}\
${if_match ${time %S} == 42}↓${else}${endif}\
${if_match ${time %S} == 43}←${else}${endif}\
${if_match ${time %S} == 44}↑${else}${endif}\
${if_match ${time %S} == 45}β†’${else}${endif}\
${if_match ${time %S} == 46}↓${else}${endif}\
${if_match ${time %S} == 47}←${else}${endif}\
${if_match ${time %S} == 48}↑${else}${endif}\
${if_match ${time %S} == 49}β†’${else}${endif}\
${if_match ${time %S} == 50}↓${else}${endif}\
${if_match ${time %S} == 51}←${else}${endif}\
${if_match ${time %S} == 52}↑${else}${endif}\
${if_match ${time %S} == 53}β†’${else}${endif}\
${if_match ${time %S} == 54}↓${else}${endif}\
${if_match ${time %S} == 55}←${else}${endif}\
${if_match ${time %S} == 56}↑${else}${endif}\
${if_match ${time %S} == 57}β†’${else}${endif}\
${if_match ${time %S} == 58}↓${else}${endif}\
${if_match ${time %S} == 59}←${else}${endif}

${font}${color9}${alignc}------------------------------------${color}
${color3}${alignc}${color5}${swapbar 0,30}${color} ↑ between lines ↑ ${color5}${swapbar 0,30}${color}
3 Likes

Top again @Sector11

A lua script would be my first guess. Anyone on the BL thread tried that? The code might be similar to the second hand for a clock.

1 Like

I don’t know if it’s more efficient but you could certainly reduce the code complexity and if statements by using modulus. You only really have 4 true cases and they are the arrow directions, because they always occur a set amount apart.

Using a bit of math N % 4 = X we can reduce the 60 cases down to just the 4 where the value X will always be 0 through 3 and we can output the correct character based on the table

0 = β†’
1 = ↓
2 = ←
3 = ↑

I wrote a small bash script to emulate the logic

#!/bin/bash

while sleep 1; do
	clear
	case $(( $(date +%S) % 4 )) in
		0) echo "β†’" ;;
		1) echo "↓" ;;
		2) echo "←" ;;
		3) echo "↑" ;;
	esac
done

I would try just using it within conky with just a few ifs like (no idea if this is syntactically correct)

${if_match ${time %S} % 4 == 0}↑${else}${endif}\
${if_match ${time %S} % 4 == 1}β†’${else}${endif}\
${if_match ${time %S} % 4 == 2}↓${else}${endif}\
${if_match ${time %S} % 4 == 3}←${else}${endif}
2 Likes

Have not asked on the BL forum yet, came here first.

I don’t do lua scripts.
I can bend fold and mutilate them to get them to do what I want, sometimes, but create new … NOPE!

Nice little bash script, I now have it as: nesw.sh TY.

The conky time command is a close cousin to the β€˜date’ command but not interchangeable with regards to how it can be manipulated., so the " % 4 " part fails.

You may have to escape the % with a backslash or another % I’m not sure, or find a way to wrap the time output before doing the math and comparison.

β€˜tis why I’m askin’ I’m not that bright )

lol, quote of the month if not of the year @Sector11 !

Nice joke mate !

I’ve kinda done it but conky doesn’t allow doing maths like this so it had to be worked around.

Option #1: use exec and doing the calculation for each arrow (self contained but not ideal - does 4 calculations per interval)

${time %H:%M } \
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 0}^${endif}\
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 1}>${endif}\
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 2}v${endif}\
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 3}<${endif}

Option #2: exec an external script (requires a separate file but only does one calculation per interval)

${time %H:%M } ${exec seconds}
#!/bin/bash
# /bin/seconds script
table=("^" ">" "v" "<")
echo "${table[$(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))]}"

Full config using both

conky.config = {
own_window = true,
own_window_type = 'desktop',
own_window_transparent = true,
gap_x = 10,
gap_y = 10,
border_width = 0,
border_inner_margin = 0,
border_outer_margin = 0,
minimum_height = 140,
use_xft = true,
font = 'DejaVu Sans:size=10',
imlib_cache_size = 4096,
double_buffer = true,
update_interval = 1,
};

conky.text = [[
${time %H:%M } \
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 0}^${endif}\
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 1}>${endif}\
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 2}v${endif}\
${if_match ${exec echo $(( $(date +%S | sed 's/^0\([0-9]\)$/\1/') % 4 ))} == 3}<${endif}

${time %H:%M } ${exec seconds}
]];

hahaha I was going to write:

'Tis why I asked, I’m not the brightest bulb in the room.

But decided to shorten it.
I know my strengths and weaknesses.
:cowboy_hat_face:

1 Like

WOW!!! You rock.
Thank you so much.
Got a doc visit in 30 minutes (taxi coming) will show results later.

1 Like

Lol, you bet mate !

As promised… the results. Shown in my Test Conky. I’m using the β€œseconds” bash script. Check out UTC time near the top.

I use those arrows as they are easy with a β€˜latam’ keyboard:
[AltGr]+[Shift]+u = ↑
[AltGr]+i = β†’
[AltGr]+u = ↓
[AltGr]+y = ←

You’ll have to convert the code as I’m a Conky 1.9er:

## pkill -xf "conky -c /media/5/Conky/test.conky" &

## pkill -xf "faketime '2525-07-31 13:45:00' conky -c /media/5/Conky/test.conky" &
## pkill -xf "faketime '2525-07-31' conky -c /media/5/Conky/test.conky" &
## pkill -xf "faketime '13:45:00' conky -c /media/5/Conky/test.conky" &
## pkill -xf "faketime '-f 240' conky -c /media/5/Conky/test.conky" &

## ---------- Begin Window Settings
own_window yes
own_window_type normal # normal desktop dock panel override
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager #,sticky #,below,undecorated
own_window_colour 000000
own_window_class Conky
own_window_title Sector11's Test Conky
## ARGB can be used for real transparencyown_window_hints
#own_window_argb_visual yes ## Options: yes or no
## Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 80

gap_x 15 #250	## ←|β†’
gap_y 20	## ↑|↓

minimum_size 380 200
#maximum_width 300


alignment tl
#alignment tm

## ---------- End Window Settings
## ---------- Font Settings
override_utf8_locale yes

use_xft yes
#xftfont Fantasque Sans Mono:bold:size=12
#xftfont Monofur:bold:size=14
#xftfont DejaVu Sans Mono:bold:size=10
xftfont Fira Mono:medium:size=11
## Alpha of Xft font. Must be a value at or between 1 and 0
xftalpha 1.0

## --------- End Font Settings
## --------- Color Settings

draw_shades yes
default_shade_color 000000
draw_outline no
default_outline_color 000000


default_color  FFDEAD #NavajoWhite
color0 C0C0C0 #Silver
color1 33ff00 # see: /media/5/Conky/images/colours.jpg
color2 FAEBD7 #AntiqueWhite
color3 87CEFA #LightSkyBlue
color4 48D1CC #MediumTurquoise
color5 DCDCDC #Gainsboro
color6 66ccff # see: /media/5/Conky/images/colours.jpg
color7 B0E0E6 #PowderBlue
color8 FFD700 #Gold
color9 CD5C5C #IndianRed

## ---------- End Color Settings
## ---------- Begin Borders Section

draw_borders no
stippled_borders 0 #5
border_inner_margin 0
border_outer_margin 0
border_width 0
draw_graph_borders yes ## no
## default_graph_size 15 40

## ---------- End Borders Secton
## ---------- Begin Miscellaneous Section

## Boolean value, if true, Conky will be forked to background when started.
background no ## yes

## Adds spaces around certain objects to stop them from moving other things
## around, this only helps if you are using a mono font
## Options: right, left or none
use_spacer none

## Default and Minimum size is 256 - needs more for single commands that
## "call" a lot of text IE: bash scripts
text_buffer_size 3328

## Subtract (file slystem) buffers from used memory?
no_buffers yes

## change GiB to G and MiB to M
#short_units yes

## Like it says, ot pads the decimals on % values
## doesn't seem to work since v1.7.1
#pad_percents 2

# Imlib2 image cache size, in bytes. Defaults to 4MiB. Increase this value if
# you use $image lots. Set to 0 to disable the image cache.
imlib_cache_size 0

# Interval (in seconds) to flush Imlib2 cache.
#imlib_cache_flush_interval 900

## default_bar_size 0 10

## Use the Xdbe extension? (eliminates flicker)
## It is highly recommended to use own window with this one
## so double buffer won't be so big.
double_buffer yes

## Maximum size of user text buffer, i.e. layout below TEXT line in config file
## default is 16384 bytes)
max_user_text 28000 ##16384

## Desired output unit of all objects displaying a temperature. Parameters are
## either "fahrenheit" or "celsius". The default unit is degree Celsius.
## temperature_unit Fahrenheit

short_units yes
#top_name_width 8
## ---------- End Miscellaneous Section

## ---------- Begin draw.bg LUA
## ---------- Above and After TEXT  (requires a composite manager or it blinks!)

## lua_load /media/5/Conky/LUA/draw-bg.lua
## TEXT
## ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}

##OR Both above TEXT (no composite manager required - no blinking!)

lua_load /media/5/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.2
# TEXT

## Note
## ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
##   See below:        1  2 3 4 5 6        7

## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

## covers the whole window and will change if you change the minimum_size setting

## 1 = 20            corner_radius
## 2 = 0             x_position l|r
## 3 = 0             y_position u|d
## 4 = 0             width
## 5 = 0             height
## 6 = 0x000000      color
## 7 = 0.2           alpha

## ---------- End draw.bg LUA

#### UP: ${exec w | awk '/ up /{gsub(/,$/,"",$3);print $3}'}

## ${alignc}${color7}GPU:${color2} ${execpi 3 sensors | grep -n 'edge' | cut -c 18-21}Β°   ${color7}MOBO:${color2} ${execpi 3 sensors k10temp-pci-00c3 | grep 'Tctl' | cut -c 16-19}Β°

#/media/5/Conky/scripts/Astro.sh
#/media/5/Conky/scripts/Astro-MD.sh
#/media/5/Conky/scripts/Astro-neo.sh
#/media/5/Conky/scripts/Astro-neo-Balls.sh

####     33 SHADES OF GREY     #####
#${color 000000}101  ${color 1a1a1a}201  ${color 222222}301
#${color 2F4F4F}102  ${color 333333}202  ${color 444444}302
#${color 4d4d4d}103  ${color 666666}203  ${color 696969}303
#${color 708090}104  ${color 778899}204  ${color 808080}304
#${color 8a8a8a}105  ${color 999999}205  ${color a0a0a0}305
#${color a9a9a9}106  ${color ababab}206  ${color b3b3b3}306
#${color bababa}107  ${color c0c0c0}207  ${color cccccc}307
#${color d3d3d3}108  ${color dcdcdc}208  ${color dddddd}308
#${color dedede}109  ${color dfdfdf}209  ${color e0e0e0}309
#${color e6e6e6}110  ${color ededed}210  ${color F5F5F5}310
#${color FAFAFA}111  ${color FBFBFB}211  ${color FFFFFF}311

#${image /media/5/Conky/images/bk_30_test.png -p -10,-10}\
#${image /media/5/Conky/images/SharpBang_WB.png -s 60x60 -p 15,300}\
#${image /media/5/Conky/images/Conky_v1.9.S11.png -s 60x60 -p 300,300}\

# templateN
#    Define a template for later use inside TEXT segments. Substitute N by a
#    digit between 0 and  9, inclusively.  The value of the variable is being
#    inserted into the stuff below TEXT at the corresponding position, but
#    before some substitutions are applied:
#
#    '\n' -> newline
#    '\\' -> backslash
#    '\ ' -> space
#    '\N' -> template argument N

template0 ${goto 50}A = ${cpu cpu0} %${alignr 15}${cpu cpu1} % = 1\n${goto 50}2 = ${cpu cpu2} %${alignr 15}${cpu cpu3} % = 3
template1 ${time %T}
template2 hello
template3
template4
template4
template6
template7
template8
template9

##



update_interval 1
TEXT
${alignc}conky-legacy-all
${alignc}v 1:1.9.0-6
${alignc}on desktop:${color} ${if_match ${desktop}==1}${color6}${endif}1 ${color}${if_match ${desktop}==2}${color6}${endif}2 ${color}${if_match ${desktop}==3}${color6}${endif}3 ${color}${if_match ${desktop}==4}${color6}${endif}4${color}

${alignc}${color6}UTC:${color} ${utime %H:%M} ${exec seconds}
${alignc}${color6}BsAs:${color} ${time %T on %A}
${alignc}the ${if_match ${time %d} == 01}${time %dst} ${else}\
${if_match ${time %d} == 21}${time %dst} ${else}\
${if_match ${time %d} == 31}${time %dst} ${else}\
${if_match ${time %d} == 02}${time %dnd} ${else}\
${if_match ${time %d} == 22}${time %dnd} ${else}\
${if_match ${time %d} == 03}${time %drd} ${else}\
${if_match ${time %d} == 23}${time %drd} ${else}${time %dth} \
${endif}${endif}${endif}${endif}${endif}${endif}${endif}\
day of ${time %b %Y}
${goto 105}${color6}SKY:${color} ${execpi 120 accuweather.sh "SAM|AR|AR007|BUENOSAIRES"}
${goto 32}${color6}Week Number:${color} ${time %U}
${goto 095}${color6}Boot:${color} ${pre_exec who -b | cut -c23-}
${goto 114}${color6}Up:${color} ${uptime_short}
${goto 33}${color6}Swatch Time: ${color}${execi 60 /media/5/Conky/scripts/swatch.sh}${color}

${alignc}${color6}Core Usage: Avg:${color} ${if_match ${cpu cpu0}<10}Β·Β·${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100}Β·${cpu cpu0}\
${else}${color6}${cpu cpu0}${endif}${endif}${color}% \
${color6}MAX 3.9 GHz
${alignc}${color6}1${color} ${if_match ${cpu cpu1}<10}Β·Β·${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100}Β·${cpu cpu1}\
${else}${color6}${cpu cpu1}${endif}${endif}${color}%\
 | ${color6}2${color} ${if_match ${cpu cpu2}<10}Β·Β·${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100}Β·${cpu cpu2}\
${else}${color6}${cpu cpu2}${endif}${endif}${color}%\
 | ${color6}3${color} ${if_match ${cpu cpu3}<10}Β·Β·${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100}Β·${cpu cpu3}\
${else}${color6}${cpu cpu3}${endif}${endif}${color}%\
 | ${color6}4${color} ${if_match ${cpu cpu4}<10}Β·Β·${cpu cpu4}\
${else}${if_match ${cpu cpu4}<100}Β·${cpu cpu4}\
${else}${color6}${cpu cpu4}${endif}${endif}${color}%
${alignc}${color6}1 ${color}${freq_g 1} |${color6} 2 ${color}${freq_g 2} \
|${color6} 3 ${color}${freq_g 3} |${color6} 4 ${color}${freq_g 3}

${alignc}${color6}OS${color} ${pre_exec lsb_release -is} ${color6}Version ${color}${pre_exec cat /etc/debian_version}
${alignc}${kernel}
${alignc}${color6}Display ${color}${pre_exec xdpyinfo | sed -n -r "s/^\s*dimensions:.*\s([0-9]+x[0-9]+).*/\1/p"}
${alignc}${color6}WD 1TB Temp: ${color}${hddtemp /dev/sda}Β°C
${alignc}${color6}NVIDIA GPU Temp: ${color}${nvidia temp}Β°C ${color6}| Freq: ${color}${nvidia gpufreq} MHz
${alignc}${color6}Memory Freq: ${color}${nvidia memfreq}MHz

${alignc}${color0}${swapbar 0,30} ↓ test code ↓ ${swapbar 0,30}${color}
${color9}${alignc}------------------------------------${color}



${font}${color9}${alignc}------------------------------------${color}
${alignc}${color0}${swapbar 0,30} ↑ between lines ↑ ${swapbar 0,30}${color}

and I left all the dark and dirty stuff in there … it is a test conky after all.

3 Likes

Nice Conky setup @Sector11

1 Like