OK so someone asked if it was possible to have:

—– text here —–

in conky. Where the —– was a solid line similar to the ${hr} command.

People started by saying, “No, not possible.” I thought about it for a bit and said to myself, “Yea I can do that!” With another trick in conky that I have already showed you in T&T-4: BARS with Text.

So I set out and experimented and came up with the solution.

So here we go:

Default text for this conky is: font Zekton:size=15. I’m actually using my “conkyemail” which is alignment tm so that is where the width comes from.

conky-1 You have a title you want to use: System, Temperatures, Music, Weather, whatever. You used ${alignc} or a ${goto xx} command to get it where you want it. We’ll use CONKY for this example, as seen above.

${hr}
${goto 95}${font woodbadge:size=20}${color2}Conky${color}${font}
${hr}

Now you want to “spruce” it up a bit, by adding lines before and after it. It’s easy with the same method used in T&T-4: BARS with Text by using a CPUBAR for a CPU you do not have. Easy for me, I don’t have a duel core so anything 1 and above is fine, remember it starts at 0.

conky-2 Now we need to add the code for those “lines” to appear. using a CPUBAR command. You’ll need two of them. You can use the same non-existant CPU#, but if memory serves correct conky got confused when it’s used too many times. I may be wrong but just to be sure we’ll use CPU 3 & 4 for this example:

${hr}
${goto 93}${font woodbadge:size=20}${color2}Conky${color}${font}
${cpubar cpu3 1,70}${alignr 2}${cpubar cpu4 1,70}
${hr}

Set the “height” to 1 to create the “bar” and 70 for the length. Yours will vary (40, 60 100) depending of the width of your conky display, the text you use and the font. Seems like “spacing” is everywhere in conky. :) I also use (always) ${alignr 2) to bring the output 2 pixels back from the right edge. If it’s a calculated output that changes values it can cause flickering, if it’s “on the edge” and nobody likes a flickering conky, well, nobody I know.

conky-3 OK, there’s the bars, now to add ${voffset -xx}, negative xx to move up, until it’s right where you want it.

${hr}
${goto 93}${font woodbadge:size=20}${color2}Conky${color}${font}
${voffset -25}${cpubar cpu3 1,70}${alignr 2}${cpubar cpu4 1,70}
${hr}

See, just like I said, “I can do that.” Now lets go a bit further. Personalize it a bit. “Use the colour, Luke”

conky-4 I chose yellow, to match close to the colour of CONKY. “NOT close.” you say. AHHH, but I’m not finished. We are going to “outline” those lines with RED

To do that copy the line you have producing the “lines” and change the color to “red”, and a ${voffset} to -0 for the moment and change the CPU numbers, I’m using 5 & 6.

${hr}
${goto 93}${font woodbadge:size=20}${color2}Conky${color}${font}
${color yellow}${voffset -25}${cpubar cpu3 1,70}${alignr 2}${cpubar cpu4 1,70}${color}
${color red}${voffset -0}${cpubar cpu5 1,70}${alignr 2}${cpubar cpu6 1,70}${color}
${hr}

conky-5 If you’ve done everything right it should look like the image in the left. Now we have to give RED lines height to outline the YELLOW lines. So change the height to: 4. If you think about it, the top of the CPUBAR is 1 and the bottom is 2, so to have something “around” it you need 2 empty spaces between the top and bottom and x-2=2 is 4-2=2. Simple math.

${hr}
${goto 93}${font woodbadge:size=20}${color2}Conky${color}${font}
${color yellow}${voffset -25}${cpubar cpu3 1,70}${alignr 2}${cpubar cpu4 1,70}${color}
${color red}${voffset -0}${cpubar cpu5 4,70}${alignr 2}${cpubar cpu6 4,70}${color}
${hr}

conky-6 So you now have something like this. It’s time to play with that ${voffset -0} value, your will vary obviously, mine comes it at ${voffset -27}

${hr}
${goto 93}${font woodbadge:size=20}${color2}Conky${color}${font}
${color yellow}${voffset -25}${cpubar cpu3 1,70}${alignr 2}${cpubar cpu4 1,70}${color}
${color red}${voffset -27}${cpubar cpu5 4,70}${alignr 2}${cpubar cpu6 4,70}${color}
${hr}

And that final code produces the broken ${hr} effect that the user asked about.

Something conky can not do!

conky-7

Happy conkying
Bruce