mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-14 00:14:14 +09:00
checked if hddtemp can be run
This commit is contained in:
committed by
Dipesh Acharya
parent
d31e541f83
commit
2232c864ff
@@ -59,11 +59,15 @@ CpuTemperature.prototype = {
|
||||
|
||||
_detectHDDTemp: function(){
|
||||
//detect if hddtemp is installed
|
||||
let hddtempPath = null;
|
||||
let ret = GLib.spawn_command_line_sync("which hddtemp");
|
||||
if ( (ret[0]) && (ret[3] == 0) ) {//if yes
|
||||
return ret[1].toString().split("\n", 1)[0];//find the path of hddtemp
|
||||
hddtempPath =ret[1].toString().split("\n", 1)[0];
|
||||
// for any reason it is not possible to run hddtemp directly.
|
||||
if(GLib.spawn_command_line_sync(hddtempPath)[3])
|
||||
hddtempPath = null;
|
||||
}
|
||||
return null;
|
||||
return hddtempPath;
|
||||
},
|
||||
|
||||
_update_temp: function() {
|
||||
|
||||
Reference in New Issue
Block a user