I have the exact same issue as Creating Conky text variables with zero padding? for displaying network speed. Except that I'm piping conky to dzen2. It seems lua_parse is not working within that setup.
I've tried :
- Formatting the string directly :
${lua_parse format %2s ${downspeed re0}} - Using
goto:${downspeed re0}${goto 100} - Setting a custom function in
~/.xmonad/conky_lua_script.lua:
function conky_format( format, number )
return string.format( format, conky_parse( number ) )
end
Then in conkyrc:
lua_load = "~/.xmonad/conky_lua_script.lua"
conky.text = [[
${lua_parse format %5.0f ${downspeed re0}}%
]];
Minimal working example :
conky.config = {
background = true,
out_to_console = true,
out_to_x = false,
update_interval = 1.0,
use_spacer = 'none',
use_xft = true
};
conky.text = [[
${downspeed re0}
]];
Run it with conky | dzen2 .
Edit The following works :
conky.config = {
lua_load = "~/.xmonad/conky_lua_script.lua"
....
};
conky.text = [[
${lua format %7s ${downspeed re0}}
]];