CPU Temperature Panel on Linpus

Discussion in 'Modding and Customization' started by pcderic, Nov 7, 2008.

  1. pcderic

    pcderic

    Joined:
    Nov 2, 2008
    Messages:
    4
    Likes Received:
    0
    I was looking for a tool to complement acerfand to display the temperature of the CPU on the XCFE desktop (panel/taskbar). I couldn't find one for Linpus (there's one for XP). So I decided to try adding one myself and it works great. Here's how I did it:

    * sudo yum install xfce4-genmon-plugin
    * Create a script /home/user/bin/cputemp.sh that will be called by the plugin. In this case, we get the temperature by using the acer_ec.pl script:

    Code:
    #!/bin/bash
    text="`echo $[$(sudo /usr/sbin/acer_ec.pl ?= 58 | cut -f 3 -d\ )]`"
    echo "<txt>${text}C</txt>"
    echo "<img>/usr/share/icons/Bluecurve/16x16/apps/gnome-monitor.png</img>"
    echo "<tool>CPU Temperature is $text Celsius</tool>"
    echo "<click>/usr/bin/gnome-system-monitor</click>"
    
    * Edit the parameters for the genmon panel by creating a new file /home/user/.config/xfce4/panel/genmon-1.rc:

    Code:
    Command=/home/user/bin/cputemp.sh
    UseLabel=1
    Text=
    UpdatePeriod=5000
    Font=(default)
    
    * Activate the panel manually by editing the /home/user/.config/xfce4/panel/panels.xml file. Add a genmon line below the tasklist line:
    Code:
                 <items>
                            <item name="xfce4-menu" id="12260407200"/>
                            <item name="gohome" id="1"/>
                            <item name="tasklist" id="1"/>
                            <item name="genmon" id="1"/>
                            <item name="systray" id="1"/>
                            <item name="xfce4-mixer" id="1"/>
                            <item name="clock" id="1"/>
                            <item name="actions" id="1"/>
                    </items>
    * Reboot

    [attachment=0:1y60w4gw]panel1.png[/attachment:1y60w4gw]

    Comments/improvements welcomed :)
     
    pcderic, Nov 7, 2008
    #1
  2. pcderic

    gwrogde

    Joined:
    Nov 10, 2008
    Messages:
    1
    Likes Received:
    0
    Hi, this was excellent piece of work! Thanx

    Combining the noise control from this link https://help.ubuntu.com/community/AspireOne
    and your work here has given me a quiet little box.

    But I had to modify the /home/user/bin/cputemp.sh slightly to point to location of acer_ec.pl.
    (/usr/local/bin/acer_ec.pl instead of /usr/sbin/acer_ec.pl)

    Also after changing the panels.xml I noticed it got overwritten on reboot.
    but from this link http://blog.lynxworks.eu/?p=281
    after saving panels.xml, kill xfce4-panel process, and run xfce4-panelnew
     
    gwrogde, Nov 12, 2008
    #2
  3. pcderic

    pcderic

    Joined:
    Nov 2, 2008
    Messages:
    4
    Likes Received:
    0
    Thanks for the tip. I also find that not using an icon with the genmon plugin gives a better display. The other icons in the panel are not overstretched.

    BTW, it appears that most plugins at the xfce4 goodies site (http://goodies.xfce.org/projects/panel-plugins/start) are installable with yum (repository: updates-newkey).

    Here's the list of the ones I like:
    Code:
    sudo yum install xfce4-genmon-plugin
    sudo yum install xfce4-cpugraph-plugin
    sudo yum install xfce4-weather-plugin
    
    Then, to activate them, just run the following command
    Code:
    xfce4-panel -a
    and drag-and-drop the selected plugin into the XFCE4 panel.

    BTW, to remove a panel you don't like, the best way I found (thanks to the previous tip) was to stop the panel with xfce4-panel -x, remove the appropriate "item" lines in the file /home/user/.config/xfce4/panel/panels.xml and then run xfce4-panelnew.
     
    pcderic, Nov 23, 2008
    #3
  4. pcderic

    hpfx

    Joined:
    Oct 30, 2008
    Messages:
    35
    Likes Received:
    0
    how to do that ?
    I've installed the systemload plugin -> http://goodies.xfce.org/projects/panel- ... oad-plugin
    it works fine (btw I unflag "text" in plugin setting to save space)

    This plusing is very interesting because it show you memory usage (512MB/8SSDthen I would like to avoid swapping.)

    but it's uggly with acer taskbar.
    how do you tell to use or not icon/default background ?
     
    hpfx, Dec 8, 2008
    #4
  5. pcderic

    Therket

    Joined:
    Nov 22, 2008
    Messages:
    7
    Likes Received:
    0
    Just edit cputemp.sh to exclude the img-Tag. The plugin will automatically detect the change and display only the text.

    Anyway, the genmon-plugin still draws a white box around the text, that doesn't look very nice...
     
    Therket, Dec 8, 2008
    #5
  6. pcderic

    hpfx

    Joined:
    Oct 30, 2008
    Messages:
    35
    Likes Received:
    0
    I'm lost, I don't know where to find such file !?
    I searched for systemload plugin, the file I finally found is /usr/libexec/xcfe4/panel-plugins/xfce4-systemload-plugin
    but it's not a shell file, it an ELF ! :|
     
    hpfx, Dec 8, 2008
    #6
  7. pcderic

    Therket

    Joined:
    Nov 22, 2008
    Messages:
    7
    Likes Received:
    0
    Take a look at the very first post in this thread, where pcderic explained in detailed steps how to setup the panel addin.
     
    Therket, Dec 8, 2008
    #7
  8. pcderic

    hpfx

    Joined:
    Oct 30, 2008
    Messages:
    35
    Likes Received:
    0
    yes, I don't use the same plugin as him !.. take a look at what I wrote too :roll:
    Regards.
     
    hpfx, Dec 8, 2008
    #8
  9. pcderic

    sandydoull

    Joined:
    Dec 23, 2008
    Messages:
    28
    Likes Received:
    0
    I can't this to work, have an icon on the panel but it show's XXX instead of a temperature (see screenshot). I get a screen tip that says this:

    ------------
    /home/user/bin/cputemp.sh
    Period (s): 5


    Any ideas where I could have gone wrong? I added the acerfand control and would like to see the cpu temp for peace of mind;)
    [attachment=0:1rykozb7]Skärmbild.png[/attachment:1rykozb7]
     
    sandydoull, Jan 9, 2009
    #9
  10. pcderic

    Therket

    Joined:
    Nov 22, 2008
    Messages:
    7
    Likes Received:
    0
    It seems, your script isn't executable.

    Try the following:
    - Open Terminal
    - /home/user/bin/cputemp.sh

    The output should be similar to
    Code:
    <txt>60C</txt>
    <img>/usr/share/icons/Bluecurve/16x16/apps/gnome-monitor.png</img>
    <tool>CPU Temperature is 60 Celsius</tool>
    <click>/usr/bin/gnome-system-monitor</click>
    
    If you're receiving something like
    Code:
    bash: /home/user/bin/cputemp.sh: Permission denied
    
    ...you can fix it using
    Code:
    chmod 755 /home/user/bin/cputemp.sh
    
     
    Therket, Jan 10, 2009
    #10
  11. pcderic

    sandydoull

    Joined:
    Dec 23, 2008
    Messages:
    28
    Likes Received:
    0
    Thanks for the tip, I got a friend of mine to help, I had two issues, like you said the script wasnt executible and also my acer_ec.pl file was located in a different place so i had to change that too, what does everyone's temp read, mine is around 60 and can be up to almost 70 but never more, is that ok? How reliable is the reading?
     
    sandydoull, Jan 10, 2009
    #11
  12. pcderic

    speekergeek

    Joined:
    Jul 17, 2008
    Messages:
    76
    Likes Received:
    0
    mine keeps reading 0C and i cannot for the life of me figure out why.

    I run the acer file directly and I get a temp, when i run it through the cputemp program it returns 0C.

    cluesless here.
     
    speekergeek, Jan 11, 2009
    #12
  13. pcderic

    sandydoull

    Joined:
    Dec 23, 2008
    Messages:
    28
    Likes Received:
    0
    have you tired running cputemp in the terminal to see if any errors occur?

     
    sandydoull, Jan 11, 2009
    #13
  14. pcderic

    speekergeek

    Joined:
    Jul 17, 2008
    Messages:
    76
    Likes Received:
    0
    The following is what the computer terminal returns:

    [user@localhost ~]$ /home/user/bin/cputemp.sh
    sudo: /usr/sbin/perl: command not found
    audit_log_user_command(): Connection refused
    <txt>0C</txt>
    <tool>CPU Temperature is 0 Celsius</tool>
    <click>/usr/bin/gnome-system-monitor</click>
    [user@localhost ~]$


    I even moved the files into the same directory (and editing them accordingly of course).

    as far as permissions, I have set user to root on all, I have tried setting cputemp to user but it did not make any difference.

    I have rebooted a few times too.

    I am picking this linux thing up pretty well but am stumped (still a newb, but I am learning pretty quick).

    I guess it doesn't matter that much, I can just leave a terminal open and enter the command to show the temp when I want to check.

    I did some major heatsink work and am curious how well it holds up under stress, it gets hottest when the ac line is plugged in, I got it up to 60C playing zelda on zsnes. good 'nuff maybe?

    Maybe I am just being too anal about things, temp is probly good anyways

    Mike
     
    speekergeek, Jan 11, 2009
    #14
  15. pcderic

    Therket

    Joined:
    Nov 22, 2008
    Messages:
    7
    Likes Received:
    0
    This is your problem..

    Try
    Code:
    which perl
    in a terminal, which should return a path. This path has to be in "cputemp.sh".

    If it doesn't return a path, try
    Code:
    sudo yum install perl
     
    Therket, Jan 11, 2009
    #15
  16. pcderic

    speekergeek

    Joined:
    Jul 17, 2008
    Messages:
    76
    Likes Received:
    0
    YAY! it's fixed!

    kudos and cheers! Thank you!

    Mike
     
    speekergeek, Jan 11, 2009
    #16
  17. pcderic

    sandydoull

    Joined:
    Dec 23, 2008
    Messages:
    28
    Likes Received:
    0
    I'm having problems installing cputemp after installing a new version of linux (fedora 10 XFCE spin).

    IF I run cputemp.sh in the terminal it displays the temperature but on the panel OC is shown,

    [attachment=0:3pnitkh9]scrnsht.jpg[/attachment:3pnitkh9]

    Here's my terminal output

    Code:
    [AA1@AA1 ~]$ sh cputemp.sh
    <txt>56C</txt>
    <tool>CPU Temperature is 56 Celsius</tool>
    [AA1@AA1 ~]$ 
    
    Any ideas what is cauing this behaviour?
     
    sandydoull, Jan 12, 2009
    #17
  18. pcderic

    Neva

    Joined:
    Nov 3, 2009
    Messages:
    13
    Likes Received:
    0
    Neva, Jun 12, 2010
    #18
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.