diff --git a/main.js b/main.js index db9ce14..45e6118 100644 --- a/main.js +++ b/main.js @@ -41,26 +41,31 @@ function windows(brightness,callback){ // powercfg -q gives information about power settings, but can only give accurate brightness info for laptops or other portable windows devices - exec('powercfg -q', function(error,stdout,stderr){ - if(!error){ - var regExp = /([a-z\-0-9]+)\s\D+$/ - var splitOutput = stdout.split('\r\n'); - GUID = regExp.exec(splitOutput[0])[1]; + // Get the current power scheme GUID + exec("powercfg /getactivescheme", function (error, stdout, stderr) { + if (error) throw error; - for(var i = 0;i