Conky: proper column alignment

conky

Say I want something like the following in my .conkyrc

NAME                PID       CPU%      MEM%
${top name 1} ${top pid 1}   ${top cpu 1}    ${top mem 1}
${top name 2} ${top pid 2}   ${top cpu 2}    ${top mem 2}
${top name 3} ${top pid 3}   ${top cpu 3}    ${top mem 3}
${top name 4} ${top pid 4}   ${top cpu 4}    ${top mem 4}

Do I have to align the columns manually by adding space, or is there a way to tell conky to align things in columns. With fewer columns, I could just use $alignc and $alignr but I can't do that here…

Best Answer

As long as you stick to left-aligned columns or a non-proportional font, ${goto N} works.

NAME${goto 100}PID${goto 200}  CPU%${goto 300}MEM%
${top name 1}${goto 100}${top pid 1}${goto 200}${top cpu 1}${goto 300}${top mem 1}

For right alignment, you can try playing with alignr and offset.

Related Question