re-align conky object

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Prsman
Level 4
Level 4
Posts: 399
Joined: Tue Nov 17, 2015 3:15 pm

re-align conky object

Post by Prsman »

I am having trouble to line-up an object in my conky. I would like the line to start 5 places to the right, same as the two other. Model name should line up over Freq and Temp. Text from file is here:

Code: Select all

CPU ${hr 2}
${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -8} \
${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 19-26}
${goto 6}${voffset 4}${font}${voffset -5}${goto 32}Frequency: ${alignr}${freq_g (1)} GHz
${goto 6}${voffset 8}${font}${voffset -5}${goto 32}Temperature:${alignr}${color #FCAF3E}\
When I try, it over writes, but does not move to the right. Model name is : Intel(R) i7-9700K. What i get is:

CPU----------------------------------------
Intel(R) i7-9700K

thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
zcot
Level 9
Level 9
Posts: 2838
Joined: Wed Oct 19, 2016 6:08 pm

Re: re-align conky object

Post by zcot »

So, the idea is like?:
CPU--------------
___Model
___Freq
___Temp
What about this (${goto 32} added at the beginning of that line):

Code: Select all

CPU ${hr 2}
${goto 32}${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -8} \
${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 19-26}
${goto 6}${voffset 4}${font}${voffset -5}${goto 32}Frequency: ${alignr}${freq_g (1)} GHz
${goto 6}${voffset 8}${font}${voffset -5}${goto 32}Temperature:${alignr}${color #FCAF3E}\
but what is this?

Code: Select all

${goto 6}${voffset 4}${font}${voffset -5}
${goto 6}${voffset 8}${font}${voffset -5}
maybe that's some remnant from something that was taken out? It makes it hard to read and seems like weird processing for nothing anyway, not sure. But it translates to nothing really. Well it does alter the vertical position but why do that in an inconsistent way. It's like move vertical -1, and on the next line move vertical +3. I can't understand it, at least on my test it misaligns the 3 lines vertically. Anyway...

For this 'model name' which will never change in the course of running, maybe you can implement a solution with the ${no_update} functionality, -this way that processing only happens once. But I don't think you can use that feature with an ${exec} line. But since it doesn't change, and the code is very exactly specific to a certain model output, why not just "hard code" the info?

For me, that processing output looks like: AMD Athl X4 630 P
But, the full info line is actually like this: AMD Athlon(tm) II X4 630 Processor
I figure the processing could come out: AMD Athlon(tm) II X4 630
But, the scripting is not generic at all to properly process everybody's setup.
So, just write it directly: Intel(R) i7-9700K

So in the end:

Code: Select all

CPU ${hr 2}
${goto 32}Intel(R) i7-9700K
${goto 32}Frequency: ${alignr}${freq_g (1)} GHz
${goto 32}Temperature:${alignr}${color #FCAF3E}9001°c
User avatar
Prsman
Level 4
Level 4
Posts: 399
Joined: Tue Nov 17, 2015 3:15 pm

Re: re-align conky object (SOLVED)

Post by Prsman »

thanks for the reply zcot. your final bit of code did it. you are right, no need to keep sampling what the cpu name is. as for the extra code in my conky, i will try to clean it up. thanks again.
Locked

Return to “Compiz, Conky, Docks & Widgets”