From 0f467c1a074a35554df0f0a0380802db65d9a549 Mon Sep 17 00:00:00 2001 From: Simon May Date: Sat, 14 Aug 2021 01:06:06 +0200 Subject: [PATCH] Include all possible DRM device paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, DRM_DEVICE_PATH=/sys/class/graphics/fb0/device/drm/card0 is hard-coded. However, on some systems, this specific path may not exist (for example, I have /sys/class/graphics/fb0/device/drm/card1 and /sys/class/graphics/fb1/device/drm/card0), causing the entire script to fail. To prevent this, replace the hard-coded “0”s by globs. --- enforce-dpms.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enforce-dpms.sh b/enforce-dpms.sh index 3c50189..83f3d9d 100755 --- a/enforce-dpms.sh +++ b/enforce-dpms.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash set -ueo pipefail -DRM_DEVICE_PATH=/sys/class/graphics/fb0/device/drm/card0 +DRM_DEVICE_PATH=/sys/class/graphics/fb*/device/drm/card* ALL_DRM_PORTS=$(find ${DRM_DEVICE_PATH} | grep '/dpms$') DEBUG=0