graphics() improved for Raspberry PI

This commit is contained in:
Sebastian Hildebrandt 2025-01-09 16:25:06 +01:00
parent a2b0906e02
commit a06c23ae2c

View File

@ -733,8 +733,8 @@ function graphics(callback) {
}
if (_linux) {
// Raspberry: https://elinux.org/RPI_vcgencmd_usage
if (util.isRaspberry() && util.isRaspbian()) {
let cmd = 'fbset -s | grep \'mode "\'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;';
if (util.isRaspberry()) {
let cmd = 'fbset -s 2> /dev/null | grep \'mode "\' ; vcgencmd get_mem gpu 2> /dev/null; tvservice -s 2> /dev/null; tvservice -n 2> /dev/null;';
exec(cmd, function (error, stdout) {
let lines = stdout.toString().split('\n');
if (lines.length > 3 && lines[0].indexOf('mode "') >= -1 && lines[2].indexOf('0x12000a') > -1) {