Skip to content

Commit 6f19dac

Browse files
committed
Fallback to sysfs to control backlight if vbetool fails
Change-type: minor Signed-off-by: Rahul Thakoor <[email protected]>
1 parent 258e28b commit 6f19dac

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
#!/bin/bash
22

3-
/usr/sbin/vbetool dpms off
3+
/usr/sbin/vbetool dpms off 2>/dev/null
4+
5+
# fallback to sysfs if vbetool fails
6+
if [ $? -ne 0 ]; then
7+
# source https://unix.stackexchange.com/a/504839
8+
echo -n 4 > /sys/class/backlight/*/bl_power
9+
fi
+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
#!/bin/bash
22

3-
/usr/sbin/vbetool dpms on
3+
/usr/sbin/vbetool dpms on 2>/dev/null
4+
5+
# fallback to sysfs if vbetool fails
6+
if [ $? -ne 0 ]; then
7+
# source: https://unix.stackexchange.com/a/504839
8+
echo -n 0 > /sys/class/backlight/*/bl_power
9+
fi

0 commit comments

Comments
 (0)