mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +00:00
Merge pull request #8165 from HiassofT/le12-kodi-poweroff2
kodi GBM: shut down kodi when case power button is pressed
This commit is contained in:
commit
198cbf75a6
@ -0,0 +1,12 @@
|
|||||||
|
# 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"
|
||||||
|
|
||||||
|
LABEL="end"
|
||||||
|
|
@ -407,6 +407,12 @@ post_makeinstall_target() {
|
|||||||
mkdir -p ${INSTALL}/usr/cache/libreelec
|
mkdir -p ${INSTALL}/usr/cache/libreelec
|
||||||
cp ${PKG_DIR}/config/network_wait ${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
|
# update addon manifest
|
||||||
ADDON_MANIFEST=${INSTALL}/usr/share/kodi/system/addon-manifest.xml
|
ADDON_MANIFEST=${INSTALL}/usr/share/kodi/system/addon-manifest.xml
|
||||||
xmlstarlet ed -L -d "/addons/addon[text()='service.xbmc.versioncheck']" ${ADDON_MANIFEST}
|
xmlstarlet ed -L -d "/addons/addon[text()='service.xbmc.versioncheck']" ${ADDON_MANIFEST}
|
||||||
|
@ -203,7 +203,11 @@ post_makeinstall_target() {
|
|||||||
|
|
||||||
# tune logind.conf
|
# tune logind.conf
|
||||||
sed -e "s,^.*HandleLidSwitch=.*$,HandleLidSwitch=ignore,g" -i ${INSTALL}/etc/systemd/logind.conf
|
sed -e "s,^.*HandleLidSwitch=.*$,HandleLidSwitch=ignore,g" -i ${INSTALL}/etc/systemd/logind.conf
|
||||||
sed -e "s,^.*HandlePowerKey=.*$,HandlePowerKey=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
|
# replace systemd-machine-id-setup with ours
|
||||||
safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-machine-id-commit.service
|
safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-machine-id-commit.service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user