PDA

View Full Version : display cpu model in conky



sectshun8
July 16th, 2011, 01:51 PM
Been messing around quite a bit with my conky this morning but am having an issue regarding the CPU.

I'm running an Intel Atom N270 CPU... well when i use this line in conky:

${execi 1000 cat /proc/cpuinfo | grep 'model name' | cut -c 13-40}

It works sure, but it shows it twice. In conky, so it says:

Intel(TM) Atom(TM) CPU N270
Intel(TM) Atom(TM) CPU N270

I do notice there is a CPU 0 and a CPU 1... but how can I adjust the above code so that the processor model is only displayed once?

mips
July 16th, 2011, 02:14 PM
Try


${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq}


or


${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 1-26}

to cut off the clock speed.

Bandit
July 16th, 2011, 02:21 PM
Easiest way is to just manually put it in conky like text or if you really want to display it without pulling multiple lines out is just use concatenate to number the lines then just pull that one line our and adjust your character selection to get what you need. Like this for me.


cat -n /proc/cpuinfo | grep '57' | cut -c 20-40


Edit: MIPS has the correct way just posted.. I have the incorrect lazy way.. :D

sectshun8
July 16th, 2011, 02:29 PM
Thanks to both of you... both ways work. :)

Bandit
July 16th, 2011, 02:38 PM
Thanks to both of you... both ways work. :)

Not a problem :)
I forgot all about using uniq to keep from having multiple lines of the same info displaying. Havent had my morning coffee yet.. hehe

cat /proc/cpuinfo | grep 'model name' | cut -c 14-42 | uniq