graphics() added display position windows

This commit is contained in:
Sebastian Hildebrandt 2019-07-04 18:02:09 +02:00
parent 52c061d0dc
commit 2e405a6e08
8 changed files with 30 additions and 4 deletions

View File

@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 4.14.1 | 2019-07-04 | `graphics()` added display position windows |
| 4.14.0 | 2019-07-03 | `processes()` added process path and params | | 4.14.0 | 2019-07-03 | `processes()` added process path and params |
| 4.13.2 | 2019-07-02 | `versions()` fix getting all versions | | 4.13.2 | 2019-07-02 | `versions()` fix getting all versions |
| 4.13.1 | 2019-07-01 | `versions()` gcc fix macos | | 4.13.1 | 2019-07-01 | `versions()` gcc fix macos |

View File

@ -264,6 +264,8 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (
| | ...[0].resolutiony | X | | X | X | | pixel vertical | | | ...[0].resolutiony | X | | X | X | | pixel vertical |
| | ...[0].currentResX | X | | X | X | | current pixel horizontal | | | ...[0].currentResX | X | | X | X | | current pixel horizontal |
| | ...[0].currentResY | X | | X | X | | current pixel vertical | | | ...[0].currentResY | X | | X | X | | current pixel vertical |
| | ...[0].positionX | | | | X | | display position X |
| | ...[0].positionY | | | | X | | display position Y |
| | ...[0].currentRefreshRate | X | | X | X | | current pixel vertical | | | ...[0].currentRefreshRate | X | | X | X | | current pixel vertical |
#### 7. Operating System #### 7. Operating System

View File

@ -83,6 +83,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">4.14.1</th>
<td>2019-07-04</td>
<td><span class="code">graphics()</span> added display position windows</td>
</tr>
<tr> <tr>
<th scope="row">4.14.0</th> <th scope="row">4.14.0</th>
<td>2019-07-03</td> <td>2019-07-03</td>

View File

@ -168,7 +168,7 @@
<img class="logo" src="assets/logo.png"> <img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span></div> <div class="subtitle"><span id="typed"></span></div>
<div class="version">Current Version: <span id="version">4.14.0</span></div> <div class="version">Current Version: <span id="version">4.14.1</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button> <button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div> </div>
<div class="down"> <div class="down">

View File

@ -82,6 +82,8 @@ function graphics(callback) {
resolutiony: -1, resolutiony: -1,
currentResX: -1, currentResX: -1,
currentResY: -1, currentResY: -1,
positionX: 0,
positionY: 0,
currentRefreshRate: -1 currentRefreshRate: -1
}; };
for (let i = 0; i < lines.length; i++) { for (let i = 0; i < lines.length; i++) {
@ -117,6 +119,8 @@ function graphics(callback) {
resolutiony: -1, resolutiony: -1,
currentResX: -1, currentResX: -1,
currentResY: -1, currentResY: -1,
positionX: 0,
positionY: 0,
currentRefreshRate: -1 currentRefreshRate: -1
}; };
} }
@ -145,6 +149,8 @@ function graphics(callback) {
currentDisplay.connection = ''; currentDisplay.connection = '';
currentDisplay.sizex = -1; currentDisplay.sizex = -1;
currentDisplay.sizey = -1; currentDisplay.sizey = -1;
currentDisplay.positionX = 0;
currentDisplay.positionY = 0;
currentDisplay.pixeldepth = -1; currentDisplay.pixeldepth = -1;
} }
} }
@ -302,6 +308,8 @@ function graphics(callback) {
resolutiony: -1, resolutiony: -1,
currentResX: -1, currentResX: -1,
currentResY: -1, currentResY: -1,
positionX: 0,
positionY: 0,
currentRefreshRate: -1 currentRefreshRate: -1
}; };
// find first "Detailed Timing Description" // find first "Detailed Timing Description"
@ -359,6 +367,8 @@ function graphics(callback) {
resolutiony: -1, resolutiony: -1,
currentResX: -1, currentResX: -1,
currentResY: -1, currentResY: -1,
positionX: 0,
positionY: 0,
currentRefreshRate: -1 currentRefreshRate: -1
}; };
let is_edid = false; let is_edid = false;
@ -383,6 +393,8 @@ function graphics(callback) {
resolutiony: -1, resolutiony: -1,
currentResX: -1, currentResX: -1,
currentResY: -1, currentResY: -1,
positionX: 0,
positionY: 0,
currentRefreshRate: -1 currentRefreshRate: -1
}; };
} }
@ -481,6 +493,8 @@ function graphics(callback) {
resolutiony: parseInt(parts[1], 10), resolutiony: parseInt(parts[1], 10),
currentResX: -1, currentResX: -1,
currentResY: -1, currentResY: -1,
positionX: 0,
positionY: 0,
currentRefreshRate: -1 currentRefreshRate: -1
}); });
} }
@ -703,6 +717,8 @@ function graphics(callback) {
pixeldepth: bitsPerPixel, pixeldepth: bitsPerPixel,
currentResX: util.toInt(util.getValue(bounds, 'Width', '=')), currentResX: util.toInt(util.getValue(bounds, 'Width', '=')),
currentResY: util.toInt(util.getValue(bounds, 'Height', '=')), currentResY: util.toInt(util.getValue(bounds, 'Height', '=')),
positionX: util.toInt(util.getValue(bounds, 'X', '=')),
positionY: util.toInt(util.getValue(bounds, 'Y', '=')),
}); });
} }
} }

2
lib/index.d.ts vendored
View File

@ -179,6 +179,8 @@ export namespace Systeminformation {
resolutiony: number; resolutiony: number;
currentResX: number; currentResX: number;
currentResY: number; currentResY: number;
positionX: number;
positionY: number;
currentRefreshRate: number; currentRefreshRate: number;
} }

View File

@ -470,8 +470,8 @@ function processes(callback) {
let command = ''; let command = '';
let params = ''; let params = '';
// try to figure out where parameter starts // try to figure out where parameter starts
let firstParamPos = fullcommand.indexOf(' -') let firstParamPos = fullcommand.indexOf(' -');
let firstParamPathPos = fullcommand.indexOf(' /') let firstParamPathPos = fullcommand.indexOf(' /');
firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000); firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000);
firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000); firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000);
const firstPos = Math.min(firstParamPos, firstParamPathPos); const firstPos = Math.min(firstParamPos, firstParamPathPos);

View File

@ -96,7 +96,7 @@ function system(callback) {
result.serial = util.getValue(lines, 'serial', ':', true); result.serial = util.getValue(lines, 'serial', ':', true);
// reference values: https://elinux.org/RPi_HardwareHistory // reference values: https://elinux.org/RPi_HardwareHistory
https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md // https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
if (result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2835' || result.model === 'BCM2837') { if (result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2835' || result.model === 'BCM2837') {
// Pi 4 // Pi 4