Giter Club home page Giter Club logo

Comments (4)

android-808 avatar android-808 commented on June 2, 2024

There seems to be an intermittant problem with the temperature readings now. Every now and again the temperature disappears. Happens with --cpu=2 and without.

Posted here as opposed to a new bug as it was likely caused by the recent change. MIght be worth reverting the change and adjusting the cut params.

from conky_colors.

helmuthdu avatar helmuthdu commented on June 2, 2024

I think we gonna wait until monday because i'm not with a linux computer in this weekend...

from conky_colors.

android-808 avatar android-808 commented on June 2, 2024

I've never delved into sed but I read '.' on its own has some special meaning like match one character. I'm wondering if it disappears only when temperature is a multiple of 10. After some experimenting, I tried escaping the '.' in your last sed command and it seems to be working ok. I've also updated my patch so that it applies the same processing on all other modes.

diff -u src/conkyrc_cairo.c mysrc/conkyrc_cairo.c
--- conky_colors.orig/src/conkyrc_cairo.c 2012-03-23 15:03:30.000000000 +0000
+++ conky_colors/src/conkyrc_cairo.c 2012-03-25 17:49:35.421068454 +0100
@@ -195,18 +195,18 @@
fprintf(fp,"${goto 100}${font Ubuntu:style=Bold:size=8}${color2}${freq_g}${color} GHZ${font}\n");
fprintf(fp,"${goto 100}CPU: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu0}%%${color}${font}\n");
if (unit == True)

  •       fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | cut -c15-17}°F${color}${font}\n");
    
  •       fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n");
    else
    
  •       fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | cut -c16-17}°C${color}${font}\n");
    
  •       fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n");
    
    }
    else {
    if (cpu == 1) {
    fprintf(fp,"${goto 100}${font Ubuntu:style=Bold:size=8}${color2}${freq_g}${color} GHZ${font}\n");
    fprintf(fp,"${goto 100}CPU1: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%%${color}${font}\n");
    if (unit == True)
  •               fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | cut -c15-17}°F${color}${font}\n");
    
  •               fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n");
            else
    
  •               fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | cut -c16-17}°C${color}${font}\n");
    
  •               fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n");
    }
    // More then 1 cpu
    else {
    
    @@ -214,9 +214,9 @@
    fprintf(fp,"${goto 100}${font Ubuntu:style=Bold:size=8}${color2}${freq_g %d}${color} GHZ${font}\n", i);
    fprintf(fp,"${goto 100}CPU%d: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu%d}%%${color}${font}\n", i, i);
    if (unit == True)
  •               fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core %d' | cut -c15-17}°F${color}${font}\n", i-1);
    
  •               fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core %d' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n", i-1);
            else
    
  •               fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core %d' | cut -c16-17}°C${color}${font}\n", i-1);
    
  •               fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core %d' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n", i-1);
            if ( i < cpu)
                fprintf(fp,"${voffset 15}\n");
        }
    
    diff -u src/conkyrc_default.c mysrc/conkyrc_default.c
    --- conky_colors.orig/src/conkyrc_default.c 2012-03-23 14:08:16.000000000 +0000
    +++ src/conkyrc_default.c 2012-03-24 13:43:29.000000000 +0000
    @@ -173,9 +173,9 @@
    fprintf(fp,"${offset 2}${color0}${font Poky:size=16}P${color}${font}${voffset -4}");
    if (cputemp == True) {
    if (unit == True)
  •           fprintf(fp,"${goto %d}CPU: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/.0//g'}${color}${font}  ${color2}${cpugraph cpu1 8,50 %s}${color}\n", go2, color4);
    
  •           fprintf(fp,"${goto %d}CPU: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}  ${color2}${cpugraph cpu1 8,50 %s}${color}\n", go2, color4);
        else
    
  •           fprintf(fp,"${goto %d}CPU: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/.0//g'}${color}${font}  ${color2}${cpugraph cpu1 8,50 %s}${color}\n", go2, color4);
    
  •           fprintf(fp,"${goto %d}CPU: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}  ${color2}${cpugraph cpu1 8,50 %s}${color}\n", go2, color4);
    }
    else
        fprintf(fp,"${goto %d}CPU: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%%${color}${font} ${alignr}${color2}${cpugraph cpu1 8,60 %s}${color}\n", go2, color4);
    
    @@ -185,9 +185,9 @@
    for (i = 1; i <= cpu; i++) {
    if (cputemp == True) {
    if (unit == True)
  •               fprintf(fp,"${goto %d}CPU%d: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu%d}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core %d' | awk '{print $3}' | sed 's/+//' | sed 's/.0//g'}${color}${font}  ${color2}${cpugraph cpu%d 8,50 %s}${color}\n", go2, i, i, i-1, i, color4);
    
  •               fprintf(fp,"${goto %d}CPU%d: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu%d}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core %d' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}  ${color2}${cpugraph cpu%d 8,50 %s}${color}\n", go2, i, i, i-1, i, color4);
            else
    
  •               fprintf(fp,"${goto %d}CPU%d: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu%d}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core %d' | awk '{print $3}' | sed 's/+//' | sed 's/.0//g'}${color}${font}  ${color2}${cpugraph cpu%d 8,50 %s}${color}\n", go2, i, i, i-1, i, color4);
    
  •               fprintf(fp,"${goto %d}CPU%d: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu%d}%%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core %d' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}  ${color2}${cpugraph cpu%d 8,50 %s}${color}\n", go2, i, i, i-1, i, color4);
        }
        else
            fprintf(fp,"${goto %d}CPU%d: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu%d}%%${color}${font} ${alignr}${color2}${cpugraph cpu%d 8,60 %s}${color}\n", go2, i, i, i, color4);
    
    diff -u src/conkyrc_ring.c mysrc/conkyrc_ring.c
    --- conky_colors.orig/src/conkyrc_ring.c 2012-03-23 15:03:30.000000000 +0000
    +++ conky_colors/src/conkyrc_ring.c 2012-03-25 17:52:22.798591741 +0100
    @@ -157,9 +157,9 @@
    fprintf(fp,"${goto 100}${font Ubuntu:style=Bold:size=8}${color2}${freq_g}${color} GHZ${font}\n");
    fprintf(fp,"${goto 100}CPU1: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%%${color}${font}\n");
    if (unit == True)
  •       fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | cut -c14-16}°F${color}${font}\n");
    
  •       fprintf(fp,"${goto 100}Tmp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors -f | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n");
    else
    
  •       fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | cut -c15-16}°C${color}${font}\n");
    
  •       fprintf(fp,"${goto 100}Temp: ${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core 0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font}\n");
    
    }
    // More then 1 cpu
    else

from conky_colors.

helmuthdu avatar helmuthdu commented on June 2, 2024

Thx for the patch :)
I think theres a way to summit the patch ready to include it instead of plain text... need to check how to do it.

from conky_colors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.