10

I have conky the record:

${color lightblue} Down: ${downspeed wlan0} Up: ${upspeed wlan0}

Conky prints link speed, but the text moves:

Down: OB  Up: OB 
Down: 60B  Up: 60B
Down: 148B  Up: 148B
Down: 1KiB  Up: 1KiB
Down: 1.8KiB  Up: 1.8KiB
Down: 1.08KiB  Up: 1.08KiB
Down: 31.8KiB  Up: 31.8KiB

Based on this topic Creating Conky text variables with zero padding? I tried to format the output, but the text still moves.

${color lightblue} Down: ${lua_parse format %7s ${downspeed wlan0}} Up: ${lua_parse format %7s ${upspeed wlan0}}

I want the printed output conky:

Down:      0B  Up:      0B
Down:     60B  Up:     60B
Down:    148B  Up:    148B
Down:    1KiB  Up:    1KiB
Down:  1.8KiB  Up:  1.8KiB
Down: 1.08KiB  Up: 1.08KiB
Down: 31.8KiB  Up: 31.8KiB
nowy1
  • 621
  • 2
  • 7
  • 15

2 Answers2

4

Have you tried using goto as referenced here : http://conky.sourceforge.net/variables.html

You could do something like:

${color lightblue} Down: ${lua_parse format %7s ${downspeed wlan0}}${goto 100} Up: ${lua_parse format %7s ${upspeed wlan0}}

and just change the ${goto 100} to a number that better matches your formatting.

cesar
  • 577
1

Conky places a space between the number and the unit. Hence the longest possible string is 8, not 7, characters long.

Hence, using the conky_format function from Creating Conky text variables with zero padding?, the following code should work:

${color lightblue} Down: ${lua format %8s ${downspeed wlan0}} Up: ${lua format %8s ${upspeed wlan0}}

Note, you do not need the lua_parse variable, since the conky_format function already uses the conky_parse function.