Conky Line Spacing

I have too much space between the lines in conky. :worried: Can somebody help to make it better :grinning:
Thank you very much for your help

In a basic conky such as this, AFAIK, things like interline spacing are set by the font you choose. Whether it is worth finding a ‘tighter’ font with similar looks… IDK. You may NOT know, however, that fonts can be specified with their sizes in increments - one conky I used to run used a font with 8.2, 8.8 and 9.2 sizes for particular placements (as well as some full sizes elsewhere).

Another alternative, but much more ‘complicated’ is to use a lua based library to render text instead. The conkywx library, as well as many (!) widgets, includes a textformat statements that places and aligns entire blocks of text as desired. Here is an example using conkywx - ALL the text is placed and rendered (colours included as well as leading) with a few textformat statements. See a couple of them below…

Example of conkywx calls

${lua main -n textformat -p 25,1430 -o 25:12 -h 200 -w 450 -l Temp:[D1T],Flike:[FL],Will be:[FCTTYS],Dew:[DP],CoR|Hum:[D1PH],Rain:[RF];Press:[BR],Wind:[WS],From:[WD] - [WDD]°,Gust:[WG],Visi:[VI],Clouds:[CLH1] -c 0xffffff:1 -d 0xffaa00:1 -f DejaVu Sans:20 }#

${lua main -n textformat -p 25,1625 -g d -h 60 -l Last Fetch:[LF] LT on [TD] -q ! -c 0xffffff:1 -d 0xffaa00:1 -f DejaVu Sans:18 }


You can see that commas and semicolons set lines and tabs, h for height and w for width, and so on. Doesn’t take long to learn the basics though!

There may be other ways of handling it - but those are the ones I generally use.


Here is some code it helps to post it.

Memory in use: ${color}${memperc}%
${color 0001ff}Free/Easy Memory ${color}${memeasyfree}
${membar 12,255}
${color 0001ff}${goto 4}cpu @ ${color}${cpu cpu0} % ${goto 110}${cpugraph cpu0 12,150 scale -l}${color 0001ff}
${goto 4}core0:${color}${goto 60}${execi 60 sensors | grep 'Core 0:' | cut -c15-23} ${goto 145}${cpubar cpu1 12,115}${color 0001ff}
${goto 4}core1:${color}${goto 60}${execi 60 sensors | grep 'Core 1:' | cut -c15-23} ${goto 145}${cpubar cpu2 12,115}${color 0001ff}
${goto 4}core2:${color}${goto 60}${execi 60 sensors | grep 'Core 2:' | cut -c15-23} ${goto 145}${cpubar cpu3 12,115}${color 0001ff}
${goto 4}core3:${color}${goto 60}${execi 60 sensors | grep 'Core 3:' | cut -c15-23} ${goto 145}${cpubar cpu4 12,115}

This is what it generates.

Maybe shorten cpubar to start?

I don’t think the bars affect the line spacing - but if they do I expect it would be their height setting that does, not the length. I hope the OP has tried fractional font sizing - it might do the trick (especially as the ‘default font’).

Eventually, you can make conky do whatever you want - if not always directly! For instance, you can call a $voffset with a negative pixel count to tighten things up…every line! A bit work intensive, but possible…

I know OP is artistic, so positioning is bound to be important! :grin:

1 Like

The question is not clear. I read it as Op wanting a more compact conky overall with fewer lines? Thus shorten the bars, place code on the same line …

How much closer can the lines be and be readable??? I needed another translation, or read between the lines. :slight_smile:
let’s see…

Sorry for the late answer. Thank you for your help.

I have found a solution for me, the font i have doesn´t fit in my conky. Now i have another one and everything is good. :grinning:

That’s exactly what @freebird54 told you, so you should mark his reply as the solution, not your own.

1 Like

Oh no, i don´t have read this carefully. I make it right now. Thank you, @Kresimir. :wink:

Just adding information here: If you want to reduce line spacing, insert a ${voffset - some number} any number between 1 to whatever. The number is the number of pixels up or down you want to change. If you wanted to reduce spacing by 5 pixels, add this code everyplace it is needed: ${voffset -5} (voffset is vertical offset up or down–offset is right or left of center).

A code example from 1 of my conkys:

${font Technical CE:bold:size=12}SYSTEM: ${hr 3}${font}${voffset 6}
${goto 25}${exec cat /etc/issue | uniq | cut -c 1-18}${voffset -18}
${goto 25}${exec cat /proc/cpuinfo|grep 'model name'|sed -e 's/model name.*: //'| uniq | cut -c 18-48}
${goto 25}Kernel:  $kernel
${goto 25}CPU Speed: ${freq_g 1}${goto 118}GHz
${goto 25}Processes:  $processes  (${running_processes} Running)${voffset 6}
${hr 3}
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.