pmcputemp -temperature monitor

Miscellaneous tools
Message
Author
User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#61 Post by OscarTalks »

OK so I tested the load_module_func code as posted after your edit and if I leave the k8temp and the k10temp commented out then those 2 modules do not get loaded (even though they are mentioned in the first modprobe), but the it87 does (it does also automatically load the hwmon and hwmon_vid deps so that is not a problem). On the old AMD system this is enough and pmcputemp does work.

If I uncomment the k8temp and the k10temp then they do load when the script runs. I end up with all 5 loaded but the k8 and k10 do not seem to be needed in this case by pmcputemp and as you say they are not needed by it87.
Oscar in England
Image

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#62 Post by 01micko »

OscarTalks wrote: If I uncomment the k8temp and the k10temp then they do load when the script runs. I end up with all 5 loaded but the k8 and k10 do not seem to be needed in this case by pmcputemp and as you say they are not needed by it87.

This is the point of having the loop. Sure, I could modprobe everything inline but then we end up with unused loaded modules. No harm I guess apart from using a tiny bit of extra ram.

Thanks for your tests and going on that I'll release the next version soon.
Puppy Linux Blog - contact me for access

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#63 Post by OscarTalks »

I'm afraid I don't really understand how the loop works or what it is intended to do but I thought I would just mention the following:-

My Dell Vostro desktop has a Pentium Dual-Core E6700 at 3.20 GHz and pmcputemp has been working with coretemp loaded and temp2_input as the detected file. I noticed that the it87 module will also load, creating a new directory /sys/devices/platform/it87.2576 which contains a further 3 temp*_input files along with the 2 in coretemp.0

If I swap the code in the script and delete and restart all the pmcputemp stuff I find that the it87 module loads in favour of coretemp and (although pmcputemp still works) I wonder if this is what you would want.
Oscar in England
Image

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#64 Post by Mike Walsh »

Evening, Mick.

Have just discovered your pmcputemp; NICE one..!

I've got two machines in regular use. A 2005 HP/Compaq desktop PC; belonged to my sister...I've had it about 18 months, and have upgraded just about every major component on it in that time.

Been using Tahrpup since late October. I run tempicon on this one, and it works fine. K8 architecture; did run a single-core Athlon 64, now running an X2 dual Athlon 64. No problems with the upgrade...still works fine.

My other machine is an ancient Dell Inspiron 1100 laptop, from 2002. Used to run a 'Netburst'-gen Celeron (2.2 GHz), recently upgraded to a 2.6 GHz P4 (BIG difference!) This also runs Tahrpup; initially, it was the ONLY Linux distro that just 'worked' with the awkward Intel 82845 video chip. I tried running tempicon on the Dell, but it didn't want to know...

Pmcputemp works beautifully. I DO like the background colour change, as the temp rises...very neat! In fact, I'm going to try it out on the Compaq; if it runs (and I've no reason to think it won't), I'll probably adopt it.

( Now realise that I wasn't even aware that tempicon does change colour; the Compaq runs so cool that it rarely gets above 35C; if it does, I get worried...!)

I don't know quite how your initial run script checks on the hardware sensors, but I DO know that the 'Netburst' P4's & Celerons didn't have the standard coretemp sensor that all modern Intel chips have.....they used something called a 'thm' sensor ( not sure what it stands for), which was situated, I believe, in the socket rather than the chip itself.

Whatever, I've now got a working temp readout...all thanks to your good self. I can quite understand your rant back on page 1; if you don't get feedback, whether negative OR positive, then how ARE you to know if it's working for other folks?? You at least know that it works on the P4's now..!

Quoted by 01micko:-
Now, I have 2 problematic laptops that store temperature in :

/sys/devices/virtual/thermal/thermal_zone0/temp

Both intel.
Exact same location for me; I checked.

Code: Select all

 root# find /sys -type f -name 'temp*' 
/sys/devices/virtual/thermal/thermal_zone0/temp
root# 
I can't speak for the later P4's...like Prescotts & Cedar Mills, etc; but it's definitely a peculiarity of the 'Netburst' variants. Thought you'd like to know.

Credit where credit is due. Cheers!

----------------------------------------------------

BTW: What update intervals have you got set on this? Is it possible to change 'em.....and where would I find them?


Regards,

Mike. :D

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#65 Post by Mike Walsh »

@ 01micko:-

I've noticed there seems to be about 7 or 8 degrees difference between the readouts of pmcputemp and tempicon, with the former being the 'cooler' of the two. Any ideas which is which.....and which one might be more accurate? It's a job to know with the AMDs anyway, as they have never used the kind of direct temp readings that Intel use.....everything's calculated as an 'average'.

But 'average' of what?


Regards,

Mike.

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#66 Post by OscarTalks »

HP Compaq d530 Small Form Factor desktop with Pentium 4 with HT at 2.8 GHz
This was one of the machines on which pmcputemp did not work.
I tried installing lm_sensors and ran sensors-detect which flagged-up a module lm85 which needs to be loaded. Doing this creates 3 temp*_input files:-

Code: Select all

# find /sys -type f -name 'temp*_input'
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp3_input
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp1_input
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp2_input
#
Running the sensors command then suggests that temp2 is the M/B temp and I am wondering if the CPU temp is temp3 (which is higher) rather than temp1 in this case but I can edit that manually in the config file of course. The temp1 does vary, but not to the same extent.

Code: Select all

# sensors
adt7463-i2c-6-2e
Adapter: SMBus I801 adapter at fc00
in0:          +0.01 V  (min =  +0.00 V, max =  +3.32 V)  ALARM
Vcore:        +1.49 V  (min =  +0.00 V, max =  +2.99 V)
+3.3V:        +3.27 V  (min =  +0.00 V, max =  +4.38 V)
+5V:          +5.18 V  (min =  +0.00 V, max =  +6.64 V)
+12V:         +3.25 V  (min =  +0.00 V, max = +15.94 V)
fan1:           0 RPM  (min =    0 RPM)
fan2:           0 RPM  (min =    0 RPM)
fan3:           0 RPM  (min =    0 RPM)
fan4:           0 RPM  (min =    0 RPM)
temp1:        +36.5°C  (low  = -127.0°C, high = +127.0°C)
M/B Temp:     +42.8°C  (low  = -127.0°C, high = +127.0°C)
temp3:        +56.2°C  (low  = -127.0°C, high = +127.0°C)
cpu0_vid:    +1.525 V

#
Anyway, with this module loaded pmcputemp is now working on this machine so maybe you should consider adding this module to the loop as well.
Oscar in England
Image

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#67 Post by 01micko »

Hi Oscar, interesting find.
OscarTalks wrote:I tried installing lm_sensors and ran sensors-detect which flagged-up a module lm85 which needs to be loaded. Doing this creates 3 temp*_input files:-
I think I will have to rewrite the script with logic like this:

load_module >if error; load_module_next >if no_error; check_temp_files exist >if no_temp_files; unload_module; load_next_module (check and so on) >if no_modules_work; quit

Make sense?

That way we don't end up with a bunch of modules loaded which do nothing.

My previous logic was:

load_module >if it_doesnt_load; load_next_module >if it_does_load; break >check_temp_files

That way, we can add as many modules that crop up and just tack them on to the list; much more maintainable. Order is of no importance.

Digressing, I have added support back in if lm_sensors is installed. Still experimenting, but when I'm satisfied I'll upload the code to github. I have also added a 'help' option, which depends on jamesbond's new app mdview.

These options will be only available at compile time, as mdview and sensors may not be installed and they are useless without them. However, if those options are enabled and those programs are not installed then pmcputemp will carry on regardless. I know it sounds confusing, but there is a method in the madness.

-----------------------------

Mike Walsh

Thanks for the credit.
Mike Walsh wrote:I've noticed there seems to be about 7 or 8 degrees difference between the readouts of pmcputemp and tempicon, with the former being the 'cooler' of the two. Any ideas which is which.....and which one might be more accurate? It's a job to know with the AMDs anyway, as they have never used the kind of direct temp readings that Intel use.....everything's calculated as an 'average'.
I'd be more inclined to think that pmcputemp is more reliable, for the simple fact that with the help of Oscar, David and others, that we have done a lot more work on the initial script that finds your temperature data. Go back through this thread and have a read, then try some of the commands I have suggested to others.

That said, it could be wrong! That's why it's important for me to get a good cross section of results.
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#68 Post by 01micko »

Here is a rewrite of pmcputemp.sh , give it a dry run first, then if you are happy, comment the echoes and uncomment the writing to file.

I've made it verbose so you can see what went on.

Code: Select all

#!/bin/sh

TMP=~/.config/pmcputemp
arch=`uname -m`

load_module_func() {
	echo "test module" # COMMENT THIS IN REAL LIFE
	for m in coretemp k10temp k8temp it87 lm85 # more can be added
	do 
		lsmod|grep -q $m
		ret=$?
		if [ $ret -ne 0 ];then
			modprobe $m 2>/dev/null # load if not already
		fi
		check_temp_data_exists # returns 0 on success
		dat=$?
		if [ $dat -eq 0 ];then
			return 0 # success, break here
		else
			rmmod $m 2>/dev/null # try to unload as it is useless to us
			continue # module failed, try next module
		fi
	done		
	# if we get here it failed
	echo "Can't load a temperature module"
	return 1
}

find_func() {
	echo "searching" # COMMENT THIS IN REAL LIFE
	FILES="$1"
	for n in `echo $FILES`; do
		read p < $n
		if [ $? = 0 ];then
			FILE=$n # found it
			break
		else
			continue # didn't find, search again
		fi
	done
	# if we get here we didn't find anything useful
}

check_temp_data_exists() {
	echo "checking data" # COMMENT THIS IN REAL LIFE
	# the rough order is Intel, AMD, whatever else
	for a in `find /sys/devices/platform -type f -name 'temp*_input'|sort` \
			`find /sys/devices/pci* -type f -name 'temp*_input'|sort` \
			`find /sys/devices/virtual -type f -name 'temp'|sort`
	do find_func "$a"
		[ -z "$FILE" ] && continue || break # if we found data break
	done
	if [ ! "$FILE" ];then echo "Failed to find file" && return 1 # bail out
	fi
	# if we get here we found it, so we write to file
	[ ! -d $TMP ] && mkdir $TMP
	echo "${FILE} is written to $TMP"
	#echo -n ${FILE} > $TMP/pmcputemprc # UNCOMMENT THIS IN REAL LIFE
	return 0
}

cputempfunc() {
	echo "starting" # COMMENT THIS IN REAL LIFE
	if [ "${arch:0:3}" != "arm" ];then
		load_module_func
		[ $? -ne 0 ] && exit 1
	else
		check_temp_data_exists
	fi
}
cputempfunc # start
Puppy Linux Blog - contact me for access

gcmartin

#69 Post by gcmartin »

testing on a single core 32bit P4 laptop
Copied latest rewrite to /usr/bin/pmcputemp.sh. Opened terminal and

Code: Select all

# uname -a
Linux XSlacko-GWLaptop 3.10.32 #1 SMP Mon Mar 3 16:37:24 EST 2014 i686 Genuine Intel(R) CPU           T2080  @ 1.73GHz GenuineIntel GNU/Linux
# ls -l /usr/bin/pmcputemp.sh
-rwxr-xr-x 1 root root 1964 May  4 18:54 /usr/bin/pmcputemp.sh
# which pmcputemp.sh
/usr/bin/pmcputemp.sh
# pmcputemp.sh
starting
test module
checking data
searching
/sys/devices/platform/coretemp.0/temp2_input is written to /root/.config/pmcputemp
# cat  /root/.config/pmcputemp/pmcputemprc
/sys/devices/platform/coretemp.0/temp2_input
# echo "Using geany, Comment where indicated in script and uncomment as well"
Using geany, Comment where indicated in script and uncomment as well
# pmcputemp.sh
/sys/devices/platform/coretemp.0/temp2_input is written to /root/.config/pmcputemp
(1st day back) Willing to provide any info which you feel would be useful.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#70 Post by Mike Walsh »

@01micko:-

I'm off to bed now, but before I go, i'll just say this;

As of this moment, I've got both tempicon and pmcputemp running on the taskbar. Currently, the readings are approx:-

tempicon: 26C
pmcputemp: 18/19C

I don't know about you, but I can't quite see how a 10-yr old, dual-core CPU, with over 180 million transistors, and pulling nearly 90W TDP, can possibly run that cool.

What d'you think?


Regards,

Mike. :?

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Another (old) HP Compac Small Form tested

#71 Post by davids45 »

G'day,

Set up for the grandkids, I have a couple of HP small form desktops (model dc7600, 'Pentium 4 HT', vintage 2005) which sensors-detect says there are 'no i2c device files found'.

01micko's latest script for pmcputemp.sh reports lots of 'Failed to find file' lines and finally 'Can't load a temperature module'.

Being an optimist, I tried loading the lm85 module (as per OscarTalks' similar HP desktop) but nothing changed.

pmcputemp-0.63 gives the brown screen 'doesn't work' on start up with these.

I also have a couple of newer HP Small Form desktops which do have 'sensors' and which already run pmcputemp-0.63 OK. I have not tried the latest pmcputemp.sh script in these - should I?

David S.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

Re: Another (old) HP Compac Small Form tested

#72 Post by 01micko »

davids45 wrote:should I?

Can't hurt. Just run it from terminal without installing because it needs to be commented/uncommented on all the 'REAL LIFE' lines. :)


---------------

Mike Walsh -

run these commands in order (the ones that I posted earlier in the thread - to which I referred :wink: )

Code: Select all

find /sys -type f -name 'temp' 
find /sys -type f -name 'temp*_input'
find /sys -type f -name 'temp' -exec cat '{}' \;
find /sys -type f -name 'temp*_input' -exec cat '{}' \;
Also, the default update interval is 5 seconds - adjustable thanks to jamesbond's suggestion. On the cli just add an integer from 1 to 10, and that will adjust the update to whatever number you put in. Obviously, the lower the number, the more CPU you will use, but it isn't much.

eg:

Code: Select all

pmcputemp 3
-------------

gcmartin.. looks ok to me. Does it work ok? As in correct temp displayed?
Puppy Linux Blog - contact me for access

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#73 Post by OscarTalks »

I am on the lm85 module machine right now. I copied and pasted the code from your post into the pmcputemp.sh file in /usr/bin then killed and deleted everything, unloaded the modules and tried running the script on its own:-

Code: Select all

# pmcputemp.sh
/usr/bin/pmcputemp.sh: line 48: syntax error near unexpected token ``find /sys/devices/pci* -type f -name 'temp*_input'|sort`'
/usr/bin/pmcputemp.sh: line 48: `         `find /sys/devices/pci* -type f -name 'temp*_input'|sort` \ '
#
I was not sure about this but I deleted the 2 spaces after the backslashes on the ends of line 47 and line 48 ( actually I seem to have a space on the end of every line from the copy and paste ) and then:-

Code: Select all

# pmcputemp.sh
starting
test module
checking data
Failed to find file
checking data
Failed to find file
checking data
Failed to find file
checking data
Failed to find file
checking data
searching
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp1_input is written to /root/.config/pmcputemp
#
Running lsmod shows that lm85 and hwmon_vid have been loaded so that all looks OK.

If I go on to do all the IN REAL LIFE commenting and uncommenting and try reseting everything and running the pmcputemp program then on the first run it does not start. The config file has been created but it says that it hasn't:-

Code: Select all

# pmcputemp
Failed to find file
Failed to find file
Failed to find file
Failed to find file
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp1_input is written to /root/.config/pmcputemp
Unable to create configuration file.
Then on the second attempt it starts but the gdkpixbuf thing happens and then on the third attempt it all runs as it should with the icon present.
Oscar in England
Image

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#74 Post by OscarTalks »

Now I am on the it87 module AMD Duron machine with everything killed, deleted and unloaded so as to simulate a fresh install of the program. Running the new code for the script looks good. I uncommented the line to allow the config file to be created and it was. The 3 modules it87 and hwmon and hwmon_vid get loaded but no superfluous modules get loaded as far as I can see.

Code: Select all

# ./pmcputemp.sh
starting
test module
checking data
Failed to find file
checking data
Failed to find file
checking data
Failed to find file
checking data
searching
/sys/devices/platform/it87.656/temp1_input is written to /root/.config/pmcputemp
#
Again though if i substitute the new script in place of the old the program does not work on first run. Is this some sort of timing or order issue, similar to the gdkpixbuf thing (the config file doesn't get created quickly enough or something)? Anyway I'm sure it just needs a tweak and then it will be working on machines it wasn't working on before.
Oscar in England
Image

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#75 Post by 01micko »

Hi Oscar

Good, results are what I wanted to see, mostly. I suppose the extra spaces after back slashes was from the copy/paste operation. When continuing a line with '\' it is imprtant that there is no space after the '\'.

The failure is just a bad return value.

At line 69, 'fi' add a carriage return and add return 0

It should look like the screen cap.

Cheers!
Attachments
code.jpg
(13.46 KiB) Downloaded 540 times
Puppy Linux Blog - contact me for access

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#76 Post by OscarTalks »

I added the return 0 line and the script seems to be working well now.
Also correctly loading module and creating config file with no unneeded modules loading in:-
Dell Vostro desktop with Intel Pentium Dual-Core E6700 (using coretemp)
Compaq Presario SR1709UK desktop with AMD Sempron 3000+ (using k8temp)

Found another module worth looking at named w83627hf
Mesh Computers desktop, model number not known
AMD Athlon 64 CPU
This machine uses the openchrome video driver in xorg
Will work with k8temp module but sensors-detect also indicated the above driver as an alternative.

Code: Select all

# modprobe w83627hf
# sensors
w83697hf-isa-0290
Adapter: ISA adapter
in0:          +1.46 V  (min =  +0.13 V, max =  +2.14 V)
in2:          +3.34 V  (min =  +0.40 V, max =  +3.90 V)
in3:          +2.98 V  (min =  +2.58 V, max =  +0.03 V)  ALARM
in4:          +3.10 V  (min =  +2.24 V, max =  +3.34 V)
in5:          +0.54 V  (min =  +2.59 V, max =  +1.79 V)  ALARM
in6:          +3.57 V  (min =  +0.32 V, max =  +0.05 V)  ALARM
in7:          +3.23 V  (min =  +0.26 V, max =  +3.34 V)
in8:          +3.57 V  (min =  +1.18 V, max =  +0.26 V)  ALARM
fan1:        2986 RPM  (min = 135000 RPM, div = 2)  ALARM
fan2:        2280 RPM  (min = 1308 RPM, div = 8)
temp1:        +30.0°C  (high = -84.0°C, hyst = +100.0°C)  sensor = CPU diode
temp2:        +28.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
beep_enable: enabled

# find /sys -type f -name 'temp*'
/sys/devices/platform/w83627hf.656/temp1_beep
/sys/devices/platform/w83627hf.656/temp1_type
/sys/devices/platform/w83627hf.656/temp2_beep
/sys/devices/platform/w83627hf.656/temp2_type
/sys/devices/platform/w83627hf.656/temp1_max_hyst
/sys/devices/platform/w83627hf.656/temp2_max_hyst
/sys/devices/platform/w83627hf.656/temp1_alarm
/sys/devices/platform/w83627hf.656/temp1_input
/sys/devices/platform/w83627hf.656/temp1_max
/sys/devices/platform/w83627hf.656/temp2_max
/sys/devices/platform/w83627hf.656/temp2_alarm
/sys/devices/platform/w83627hf.656/temp2_input
#
Oscar in England
Image

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#77 Post by 01micko »

Another interesting find... this could go on.. and on!

So my solution is to add a 'module' parameter to the cli. It only needs to be done on first run. Everything is uploaded to github. Be sure to read the README and also run ./configure -h to get a grasp of some new options. The --enable-sensors might interest you, and also --with-help (requires mdview - get tarball from link)

Code: Select all

# git log
commit ce6965822537b6922f2569bcfd9bdf82bd0935d0
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:48:00 2015 +1000

    pmcputemp.c: fix gtk3 support
    add help menu if configured
    add lm_sensors menu if configured
    bugfix for not loading icon on first run
    add module parameter on first run
    add theme parameters, light and dark

commit 258cd650f20970c83476d2dffd016fd215a8d30a
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:47:11 2015 +1000

    pmcputemp.sh: full rewrite, improved logic, add more modules

commit 2e9245b085d2e1fc7f269769dd8597edbe2eddec
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:45:45 2015 +1000

    about.c: add gtk3 support, bump version

commit 385b7b774bb359b3e51b29cbb632c7064ba5e9b4
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:42:43 2015 +1000

    configure: add lm_sensor support, help support, gtk3 support.
    Fix paths.

commit e4d3bc61523288e4bd6d73b4ca2b4bf7226856a9
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:42:02 2015 +1000

    update readme, add "help"

commit 1e9e416818da96b033fc283db6855cbdb9fb8453
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:41:13 2015 +1000

    new files lm.c, lm.h: add lm_sensor support.

commit 447ab89c7dd04517bc5cce3e533879aaf06804a6
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:40:20 2015 +1000

    update es translation

commit 9f04110c6272604b56a31a118092d7dc56f0fa9b
Author: 01micko <01micko@gmail.com>
Date:   Wed May 6 16:39:14 2015 +1000

    update man page
EDIT: I just discovered one myself :lol: . thermal_sys, for my older celeron dual core laptop (Compaq cq60)

And this works -

Code: Select all

pmcputemp d 3 thermal_sys
First run showed the icon and everything else working as expected (with the new files from github of course).
Puppy Linux Blog - contact me for access

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#78 Post by OscarTalks »

Looking good and working well on a wide selection of machines. Help window looks fine when compiled with jamesbond's mdview.

Compiling with lm-sensors the only thing I note is that I have to enable UTF-8 (in the first-run dialog gui) otherwise when opening the info window to display the sensor information I get some sort of pango shango warning and the "degrees" symbol displays as an upright rectangle with a diagonal cross in it.
Oscar in England
Image

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#79 Post by 01micko »

Hi Oscar

There are 2 ways to handle the UTF-8 issue.
  • 1. I can patch the C code (which I have done and it works)
    2. Kick it off with a script.
I'm thinking 2 is the way to go though, because there are more cases to handle than just UTF-8. For instance, if you run it as LANG=C, you get no degree symbol because it isn't in the charset at all, and it looks perfectly acceptable. There are other obscure encodings that I have no way of knowing how they will react so a script is the best solution.

Something like:

Code: Select all

#!/bin/sh
export OLDLANG=$LANG
case $LANG in
  ??_??) export LANG=${LANG}.UTF-8 ;;
  *.UTF8|C) echo ;; #leave it
  *)echo "I can't handle this one, leaving $LANG alone" ;;
esac 


pmcputemp & #options can be added here

export LANG=$OLDLANG #reset
That code is just off the top of my head so may need work.

Of course it could be more sophisticated or simplified, whatever works for you I guess.
Puppy Linux Blog - contact me for access

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#80 Post by Mike Walsh »

Hi, 01micko.

Sorry to be a little while getting back to you.
Also, the default update interval is 5 seconds - adjustable thanks to jamesbond's suggestion. On the cli just add an integer from 1 to 10, and that will adjust the update to whatever number you put in. Obviously, the lower the number, the more CPU you will use, but it isn't much.

eg:
Code:

pmcputemp 3
I tried your above suggestion. I don't know if this is the intended behaviour or not, but when I enter the above in the terminal (I used 2), what I get is a second icon, beside the first, which updates every 2 seconds.....the first one updating every 5 seconds, which appears to be the default setting, yes?

When I close the terminal, the second icon disappears.....which is probably to be expected. How would I go about adjusting this ( either in the script itself, or wherever), so that the update occurs every 2 seconds in the permanent icon? Where would I make the adjustment? :?

Bear in mind that I'm still a 'noob' as far as Linux, and scripting goes; been using these boxes of tricks for 35 yrs+, but only been using Linux for about a year in total, and early November as far as Puppy is concerned.....shortly after 'Tahrpup' was released.

I'll start learning scripting one of these days..! :lol:


Regards,

Mike.

Post Reply