Skip to content

Commit

Permalink
Include all possible DRM device paths
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Socob committed Aug 13, 2021
1 parent d04a7a0 commit 0f467c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enforce-dpms.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 0f467c1

Please sign in to comment.