diff options
| author | Manuel Reimer <manuel.reimer@gmx.de> | 2019-07-21 11:20:55 +0200 |
|---|---|---|
| committer | Manuel Reimer <manuel.reimer@gmx.de> | 2019-07-21 11:20:55 +0200 |
| commit | d679a8251ad1cf4ff782d9d96b1b3231de3fabfa (patch) | |
| tree | 12f4b98f75b78e2753df6e86bf51fd3716bf12df | |
| parent | 8d73a7c7e7cb4026f4c3b35308686701d925bef2 (diff) | |
| download | vdrpbd-d679a8251ad1cf4ff782d9d96b1b3231de3fabfa.tar.gz vdrpbd-d679a8251ad1cf4ff782d9d96b1b3231de3fabfa.tar.bz2 | |
Add second device path candidate for power button
| -rwxr-xr-x | vdrpbd | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); |
