bugfix graphics info

This commit is contained in:
Sebastian Hildebrandt 2016-09-14 09:52:29 +02:00
parent 9ae9e752f4
commit c1ec48337f
2 changed files with 21 additions and 16 deletions

View File

@ -394,6 +394,7 @@ I am happy to discuss any comments and suggestions. Please feel free to contact
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 3.5.1 | 2016-09-14 | bugfix graphics info |
| 3.5.0 | 2016-09-14 | added graphics info (controller, display) | | 3.5.0 | 2016-09-14 | added graphics info (controller, display) |
| 3.4.4 | 2016-09-02 | tiny fixes system.model, getDefaultNetworkInterface | | 3.4.4 | 2016-09-02 | tiny fixes system.model, getDefaultNetworkInterface |
| 3.4.3 | 2016-09-02 | tiny bug fix fsStats, disksIO OSX | | 3.4.3 | 2016-09-02 | tiny bug fix fsStats, disksIO OSX |

View File

@ -81,6 +81,7 @@
// -------------------------------- // --------------------------------
// //
// version date comment // version date comment
// 3.5.1 2016-09-14 bugfix graphics info
// 3.5.0 2016-09-14 added graphics info (controller, display) // 3.5.0 2016-09-14 added graphics info (controller, display)
// 3.4.4 2016-09-02 tiny fixes system.model, getDefaultNetworkInterface // 3.4.4 2016-09-02 tiny fixes system.model, getDefaultNetworkInterface
// 3.4.3 2016-09-02 tiny bug fix fsStats, disksIO OSX // 3.4.3 2016-09-02 tiny bug fix fsStats, disksIO OSX
@ -1149,7 +1150,10 @@ function graphics(callback) {
} }
reject(error); reject(error);
} }
let result = {}; let result = {
controllers: [],
displays: []
};
if (_darwin) { if (_darwin) {
let cmd = 'system_profiler SPDisplaysDataType'; let cmd = 'system_profiler SPDisplaysDataType';
exec(cmd, function (error, stdout) { exec(cmd, function (error, stdout) {
@ -1169,6 +1173,7 @@ function graphics(callback) {
if (!error) { if (!error) {
let lines = stdout.toString().split('\n'); let lines = stdout.toString().split('\n');
result.controllers = parseLinesLinuxControllers(lines); result.controllers = parseLinesLinuxControllers(lines);
}
let cmd = "xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'"; let cmd = "xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'";
exec(cmd, function (error, stdout) { exec(cmd, function (error, stdout) {
let depth = 0; let depth = 0;
@ -1188,7 +1193,6 @@ function graphics(callback) {
resolve(result); resolve(result);
}) })
}) })
}
}) })
} }
}); });