1

I wanted to have two horizontal green lines on either side of the label for the sections of my conky, but when I try and do that, I get the green line taking up the entire horizontal space and no space for the text. Here's what I'm talking about:

enter image description here

The conky is in very early stages of development, and I just ran into this problem, so there isn't much there. Here's the .conkyrc:

alignment tr
use_xft true
xftfont Droid Serif Bold:size=9
double_buffer true
gap_x 10
gap_y 10

color1 afafaf
color2 00ff00
color3 0a0a0a

TEXT
${color2}${hr}${color1}.: INFO :.${color2}${hr}
${color2}${kernel} ${color1}${machine}

Also, just while we're at it, i've been getting a syntax error from conky at the alignment tr line. It says this:

conky: Syntax error (/home/ricky/.conkyrc:1: syntax error near 'tr') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.

It doesn't seem to make a difference, but it's odd that it would do that.

  • 1
    you can't do that , because the hr meant to have one parametr 'height' ${hr height} ! you can control only the offset where the hr begins like ${offset 200} INFO ${hr 2}` – Jonah Nov 12 '15 at 14:53
  • @clearkimura The version is 1.10.0. – MintyChipp Nov 12 '15 at 14:54
1

You can pull off something close to what you want like this...

${alignc}Some Text
${color green}${voffset -25}____________${alignr}____________

...which results in something like this...

enter image description here

0

We have two issues here: using two ${hr} and syntax error near 'tr'.

Using two ${hr}

Insert a text between two horizontal lines? You can't do that using ${hr} object. You can only control the height of line in pixels (as pointed out in the comment above).

I'd suggest to use underscore '_' to draw the two lines instead, like below.

TEXT
${color2}__________${color1}.: INFO :.${color2}__________
${color2}${kernel} ${color1}${machine}

In above code, I have used 10 underscores for each line. Using this many of underscores could fit the first line of TEXT within a width of 200 pixels.

Syntax error near 'tr'

As Conky version 1.9, the alignment variable still can accept two-letter positioning i.e. tr by default. However, from version 1.10 and onwards, it seems that the default rule has been restricted to using only the full variable i.e. top_right instead of tr.

This forum thread reveals that Manjaro users had the same issue recently.

After some confusion and searching I finally found out about the new syntax Conky expects from version 1.10 Unfortunately 'man conky' points you to a non-existent directory . The example file you will find here: /usr/share/doc/conky-1.10.0/conky.conf

conky.config = {
   alignment = 'top_left',
   background = false,
...
}
conky.text = [[
${scroll 16 $nodename - $sysname $kernel on $machine | }
...
]]

Syntax error itself

Besides the full variable, using old syntax with Conky 1.10 is likely the reason to throw the error. As such, consider rewriting your conkyrc file using new syntax like below.

conky.config = {
   alignment = 'top_right',
   use_xft = true,
   xftfont = 'Droid Serif Bold:size=9',
   double_buffer = true,
   gap_x = 10,
   gap_y = 10,
   color1 = 'afafaf',
   color2 = '00ff00',
   color3 = '0a0a0a'
}
conky.text = [[
${color2}__________${color1}.: INFO :.${color2}__________
${color2}${kernel} ${color1}${machine}
]]

This post on different forum thread had mentioned some clues on how to rewrite old syntax into new syntax for Conky 1.10 or newer.

  • Sadly, the syntax error doesn't go away when i substitute tr for top_right. The only thing that changes is that is says syntax error near 'top_right', as apposed to tr. Not that big of a problem anyways. Thanks. I'll try the underscore thing. – MintyChipp Nov 12 '15 at 20:29
  • @MintyChipp Updated my answer. I just realized that it is not just the full variable issue. Conky 1.10 is using new syntax for its configuration file. – clearkimura Nov 13 '15 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.