summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Reimer <manuel.reimer@gmx.de>2019-07-21 09:20:55 (GMT)
committerManuel Reimer <manuel.reimer@gmx.de>2019-07-21 09:20:55 (GMT)
commitd679a8251ad1cf4ff782d9d96b1b3231de3fabfa (patch)
tree12f4b98f75b78e2753df6e86bf51fd3716bf12df
parent8d73a7c7e7cb4026f4c3b35308686701d925bef2 (diff)
downloadvdrpbd-d679a8251ad1cf4ff782d9d96b1b3231de3fabfa.tar.gz
vdrpbd-d679a8251ad1cf4ff782d9d96b1b3231de3fabfa.tar.bz2
Add second device path candidate for power button
-rwxr-xr-xvdrpbd7
1 files changed, 6 insertions, 1 deletions
diff --git a/vdrpbd b/vdrpbd
index 5d2b035..c002142 100755
--- a/vdrpbd
+++ b/vdrpbd
@@ -193,8 +193,13 @@ sub HaveSystemd {
}
sub GetButtonDevice {
- my $basepath = '/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input';
+ # Power buttons to check for in order of falling priority
+ my @devicepaths = (
+ '/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input',
+ '/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input'
+ );
+ my ($basepath) = grep {-d $_} @devicepaths or die("No power button found\n");
opendir(my $dh, $basepath) or die("failed to query for input device\n");
my ($input) = grep(/^input/, readdir($dh)) or die("no input device found\n");
closedir($dh);