Merge pull request #8180 from HiassofT/le11-kodi-poweroff

[le11] backport kodi power button / shutdown improvements
This commit is contained in:
Christian Hewitt 2023-09-30 08:41:41 +04:00 committed by GitHub
commit b48e2eeaaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,15 @@
# Ignore power button input devices in libinput so logind can handle them
ACTION=="remove", GOTO="end"
SUBSYSTEM!="input", GOTO="end"
KERNEL!="event*", GOTO="end"
IMPORT{parent}="KEY"
# match devices that only generate KEY_POWER (code 116) events
ENV{KEY}=="10000000000000 0", ENV{LIBINPUT_IGNORE_DEVICE}="1"
# 32bit systems report the bitmap in 32bit chunks
ENV{KEY}=="100000 0 0 0", ENV{LIBINPUT_IGNORE_DEVICE}="1"
LABEL="end"

View File

@ -408,6 +408,12 @@ post_makeinstall_target() {
mkdir -p ${INSTALL}/usr/cache/libreelec
cp ${PKG_DIR}/config/network_wait ${INSTALL}/usr/cache/libreelec
# GBM: install udev rule to ignore the power button in libinput/kodi so logind can handle it
if [ "${DISPLAYSERVER}" = "no" ]; then
mkdir -p ${INSTALL}/usr/lib/udev/rules.d/
cp ${PKG_DIR}/config/70-libinput-ignore-power-button.rules ${INSTALL}/usr/lib/udev/rules.d/
fi
# update addon manifest
ADDON_MANIFEST=${INSTALL}/usr/share/kodi/system/addon-manifest.xml
xmlstarlet ed -L -d "/addons/addon[text()='service.xbmc.versioncheck']" ${ADDON_MANIFEST}

View File

@ -0,0 +1,26 @@
From 5604be6a6701e0bd68cb36fadb05cecba57f7887 Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Fri, 22 Sep 2023 23:41:51 +0200
Subject: [PATCH] keymaps: change remote poweroff action to show shutdown menu
Signed-off-by: Matthias Reichl <hias@horus.com>
---
system/keymaps/remote.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/keymaps/remote.xml b/system/keymaps/remote.xml
index c122b99188..baebf679c0 100644
--- a/system/keymaps/remote.xml
+++ b/system/keymaps/remote.xml
@@ -50,7 +50,7 @@
<volumeplus>VolumeUp</volumeplus>
<volumeminus>VolumeDown</volumeminus>
<mute>Mute</mute>
- <power>ShutDown()</power>
+ <power>ActivateWindow(ShutdownMenu)</power>
<myvideo>ActivateWindow(Videos)</myvideo>
<mymusic>ActivateWindow(Music)</mymusic>
<mypictures>ActivateWindow(Pictures)</mypictures>
--
2.39.2

View File

@ -203,7 +203,11 @@ post_makeinstall_target() {
# tune logind.conf
sed -e "s,^.*HandleLidSwitch=.*$,HandleLidSwitch=ignore,g" -i ${INSTALL}/etc/systemd/logind.conf
if [ "${DISPLAYSERVER}" = "no" ]; then
sed -e "s,^.*HandlePowerKey=.*$,HandlePowerKey=poweroff,g" -i ${INSTALL}/etc/systemd/logind.conf
else
sed -e "s,^.*HandlePowerKey=.*$,HandlePowerKey=ignore,g" -i ${INSTALL}/etc/systemd/logind.conf
fi
# replace systemd-machine-id-setup with ours
safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-machine-id-commit.service