Eclipse PDT and MySQL - SQL Explorer Plugin The Secrets of SEO and Higer Search Engine Rankings
Mar 27
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

OK, this is a bit of a cheeky post, since I’m merely extending a previous post “Conky on Ubuntu 64 Bit - .conkyrc” - or elaborating on it - to clarify setting up .conkyrc for Dual Core Processors - specifically for my AMD Turion 64 X2. I’ve had a few requests specifically about this, so here goes…

Now, the part of my .conkyrc file that deals with my Dual Core looks like this:

${color #42AE4A}Usage (Avg):${color #42AE4A} ${freq_dyn_g}Ghz ${color lightgrey}${cpu cpu0}% ${alignr}${color #42AE4A}${cpubar cpu0 5,80}
${color #42AE4A}Usage (Core 1):${color #42AE4A} ${freq_dyn_g cpu1}Ghz ${color lightgrey}${cpu cpu1}% ${alignr}${color #42AE4A}${cpubar cpu1 5,80}
${color #42AE4A}Usage (Core 2):${color #42AE4A} ${freq_dyn_g cpu2}Ghz ${color lightgrey}${cpu cpu2}% ${alignr}${color #42AE4A}${cpubar cpu2 5,80}
${color #42AE4A}Average
${cpugraph cpu0 42AE4A eeeeee}
${color #42AE4A}Core 1 $alignr Core 2
${color #42AE4A}${cpugraph cpu1 25,120 42AE4A eeeeee} ${color #42AE4A} $alignr${color #42AE4A}${cpugraph cpu2 25,120 42AE4A eeeeee}
${color #42AE4A}Processes:${color lightgrey} $processes ${color #42AE4A}Run:${color lightgrey} $running_processes ${color #42AE4A}CPU Temp:${color lightgrey} ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o “[0-9]* C”}
${color #42AE4A}Core 1 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 ‘Core0′ | cut -c13-16 | sed ‘/^$/d’} C ${color #42AE4A}Core 2 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 ‘Core1′ | cut -c13-16 | sed ‘/^$/d’} C

This outputs the following to Conky:

Conky Dual Core CPU Output

Stripping out all the formatting, and colouring gives this:

Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80}
Usage (Core 1): ${freq_dyn_g cpu1}Ghz ${cpu cpu1}% ${alignr}${cpubar cpu1 5,80}
Usage (Core 2): ${freq_dyn_g cpu2}Ghz ${cpu cpu2}% ${alignr}${cpubar cpu2 5,80}
Average
${cpugraph cpu0 42AE4A eeeeee}
Core 1 $alignr Core 2
${cpugraph cpu1 25,120 42AE4A eeeeee} $alignr${cpugraph cpu2 25,120 42AE4A eeeeee}
Processes: $processes Run: $running_processes CPU Temp: ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o “[0-9]* C”}
Core 1 Temp: ${execi 8 sensors | grep -A 1 ‘Core0′ | cut -c13-16 | sed ‘/^$/d’} C Core 2 Temp: ${execi 8 sensors | grep -A 1 ‘Core1′ | cut -c13-16 | sed ‘/^$/d’} C

Now the walk through. The first line, Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80} gives the Average clock speed usage for both cores - ${freq_dyn_g} with no parameters, will output the current clock speed usage for the CPU as a whole. Passing cpu0 as a parameter to ${cpu} will output the overall CPU % used, and similarly, passing cpu0 to ${cpubar} will draw the overall % used graph (the parameters 5,80 are just for the height and width.

Now, by passing cpu1 or cpu2 to ${freq_dny_g}, ${cpu} and ${cpubar} Conky will output the same data but for each individual core. This can be extended by passing cpuN where N is the core number, for quad core etc. this could be cpu3 cpu4. So, the first three lines:

Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80}
Usage (Core 1): ${freq_dyn_g cpu1}Ghz ${cpu cpu1}% ${alignr}${cpubar cpu1 5,80}
Usage (Core 2): ${freq_dyn_g cpu2}Ghz ${cpu cpu2}% ${alignr}${cpubar cpu2 5,80}

Outputs:

Conky Dual Core CPU Usage

The next lines of the file deal with throughput/usage graphs, ${cpugraph cpu0 42AE4A eeeeee} being the average for the CPU as a whole, since cpu0 is passed as a parameter. 42AE4A and eeeeee are just colour parameters to create a gradient overlay on the graph. As before, passing cpu1 and cpu2 will draw the graphs for the individual cores. The additional parameters, 25,120 are again just height and width parameters.

So, the lines

Average
${cpugraph cpu0 42AE4A eeeeee}
Core 1 $alignr Core 2
${cpugraph cpu1 25,120 42AE4A eeeeee} $alignr${cpugraph cpu2 25,120 42AE4A eeeeee}

Will output:

Conky Dual Core CPU Throughput Graphs

Finally, I have a bunch of other data output, such as total processes, processes running, and CPU temperature. The first line outputs general information about the CPU as a whole:

Processes: $processes Run: $running_processes CPU Temp: ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C”}

$processes outputs the total number of processes, while $running_processes outputs the number of currently running processes on the CPU. To output the overall temperature, I had to call the execi function, and do some tweaking of the output to get the number, so ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o “[0-9]* C”} basically outputs /proc/acpi/thermal_zone/THRM/temperature, pipes the output through grep which searches for the regular expression ‘[0-9]* C’ (which matches a string of numbers followed by a space followed by an upper-case C), and thus outputs just the temperature value - e.g. “45 C”.

To output the temperature of each Core, I once again run the execi function on a couple of piped shell commands, and pipe the output through other shell commands to get the number I want:

Core 1 Temp: ${execi 8 sensors | grep -A 1 'Core0' | cut -c13-16 | sed '/^$/d'} C Core 2 Temp: ${execi 8 sensors | grep -A 1 'Core1' | cut -c13-16 | sed '/^$/d'} C

Basically what is happening here is I’m running the shell command sensors, piping to grep to search for the string “Core0“, piing this output to cut to trim it, and finally editing out some of the crap I don’t want by piping to sed. This is just repeated for Core1. You may need to customise the output from sensors, by greping, cutting and seding different stuff - experiment by opening a terminal, and running sensors, then just pipe it through the grep, cut, and sed commands until you get the data you want.

So, the final lines together:

Processes: $processes Run: $running_processes CPU Temp: ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C”}
Core 1 Temp: ${execi 8 sensors | grep -A 1 ‘Core0′ | cut -c13-16 | sed ‘/^$/d’} C Core 2 Temp: ${execi 8 sensors | grep -A 1 ‘Core1′ | cut -c13-16 | sed ‘/^$/d’} C

Output:

Conky Dual Core CPU Misc Info

Of course, this should work on any Linux distro with Conky installed.

Hope that helps someone.



Refurbished DELL XPS M1330 13.3" Laptop/Notebook PC
US $655.00 (30 Bids)
End Date: Thursday Dec-04-2008 11:33:41 PST
Bid now | Add to watch list
HP tx2000z 2.4Ghz CPU 3GB 250GB HDD Laptop Notebook
US $705.00 (37 Bids)
End Date: Thursday Dec-04-2008 12:00:00 PST
Bid now | Add to watch list
Dell LATITUDE D820 Dual Core Duo Laptop Notebook Win XP
US $435.50 (17 Bids)
End Date: Thursday Dec-04-2008 12:10:00 PST
Bid now | Add to watch list
Dell LATITUDE D820 Dual Core Duo Laptop Notebook Win XP
US $457.00 (41 Bids)
End Date: Thursday Dec-04-2008 12:20:00 PST
Bid now | Add to watch list
Dell LATITUDE D820 Dual Core Duo Laptop Notebook Win XP
US $466.00 (31 Bids)
End Date: Thursday Dec-04-2008 12:30:00 PST
Bid now | Add to watch list
New Compaq Presario CQ50-139WM Notebook 15.4" Laptop
US $405.00 (28 Bids)
End Date: Thursday Dec-04-2008 12:30:26 PST
Bid now | Add to watch list
Dell LATITUDE D820 Dual Core Duo Laptop Notebook Win XP
US $410.25 (29 Bids)
End Date: Thursday Dec-04-2008 12:40:00 PST
Bid now | Add to watch list
Dell LATITUDE D820 Dual Core Duo Laptop Notebook Win XP
US $660.00 (38 Bids)
End Date: Thursday Dec-04-2008 12:50:00 PST
Bid now | Add to watch list


  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Reddit
  • StumbleUpon
  • Technorati
  • Slashdot
  • TwitThis
  • Yahoo! Buzz

Related posts:

  1. Conky on Ubuntu 64 Bit - .conkyrc
  2. BOINC and SETI@Home Data Output with Conky
  3. Search file contents in multiple directories with Recursive grep
  4. Broadcom 43xx (4318) Wireless on 64 Bit Ubuntu
  5. IEs4Linux - Internet Explorer 5.0, 5.5, 6 & 7 on Ubuntu Linux

Related posts brought to you by Yet Another Related Posts Plugin.

written by Hodge \\ tags: , , , , ,

4 Responses to “Conky: Dual Core Processors in .conkyrc”

  1. Conky on Ubuntu 64 Bit - .conkyrc | 64 Bit Jungle Says:

    [...] I’ve also recently written a post which deals specifically with setting up Dual Core processors - Conky: Dual Core Processors in .conkyrc [...]

  2. Util PC Blog » Blog Archive » Configuración de Conky para Core 2 Duo o doble núcleo. Says:

    [...] ser exactos estas 2: Conky-gon (sacado del repositorio de configuraciones oficiales de conky) y Conky: Dual Core Processors in .conkyrc Tomé lo que me agradó más de cada una y lo uní o modifiqué a mi archivo de [...]

  3. simon Says:

    “…pipes the output through grep searching for the string ‘temperature’, and finally pipes this output through sed to edit it and strip out the string “temperature: ” (including lots of space characters, for me anyway - I probably should write a regex for this, but just can’t be arsed at the moment).”

    ?? why do you need the grep AND the sed?

    ‘cat /proc/acpi/thermal_zone/THRM/temperature’ for me just outputs ‘temperature: 43 C’

    so this will do:

    cat /proc/acpi/thermal_zone/THRM/temperature | grep -o “[0-9]* C”

  4. Hodge Says:

    Simon: no idea mate, lol. Seemed like a good idea at the time.
    Tutorial update, cheers :)

Leave a Reply

Webloogle Blog Directory