mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 14:37:59 +00:00
xbmc: rework sleep scripts for systemd
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
4a5a22c670
commit
52086f25ab
@ -555,4 +555,6 @@ post_install() {
|
|||||||
enable_service xbmc-reboot.service
|
enable_service xbmc-reboot.service
|
||||||
enable_service xbmc-userfonts.service
|
enable_service xbmc-userfonts.service
|
||||||
enable_service xbmc.service
|
enable_service xbmc.service
|
||||||
|
enable_service xbmc-lcd-suspend.service
|
||||||
|
enable_service xbmc-lirc-suspend.service
|
||||||
}
|
}
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# This file is part of OpenELEC - http://www.openelec.tv
|
|
||||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
|
||||||
#
|
|
||||||
# This Program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This Program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
|
||||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
|
||||||
# http://www.gnu.org/copyleft/gpl.html
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
. /etc/profile
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
hibernate|suspend)
|
|
||||||
xbmc-send --host=127.0.0.1 -a "LIRC.Stop"
|
|
||||||
;;
|
|
||||||
thaw|resume)
|
|
||||||
xbmc-send --host=127.0.0.1 -a "LIRC.Start"
|
|
||||||
;;
|
|
||||||
*) exit $NA
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# This file is part of OpenELEC - http://www.openelec.tv
|
|
||||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
|
||||||
#
|
|
||||||
# This Program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This Program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
|
||||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
|
||||||
# http://www.gnu.org/copyleft/gpl.html
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
. /etc/profile
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
hibernate|suspend)
|
|
||||||
xbmc-send --host=127.0.0.1 -a "LCD.Suspend"
|
|
||||||
;;
|
|
||||||
thaw|resume)
|
|
||||||
xbmc-send --host=127.0.0.1 -a "LCD.Resume"
|
|
||||||
;;
|
|
||||||
*) exit $NA
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -22,7 +22,11 @@
|
|||||||
|
|
||||||
. /etc/profile
|
. /etc/profile
|
||||||
|
|
||||||
|
# see https://wiki.archlinux.org/index.php/Power_Management#Hooks_in_.2Fusr.2Flib.2Fsystemd.2Fsystem-sleep
|
||||||
|
|
||||||
for script in $HOME/.xbmc/addons/*/sleep.d/*.power; do
|
for script in $HOME/.xbmc/addons/*/sleep.d/*.power; do
|
||||||
progress "running addon sleep script $script ($1)..."
|
progress "running addon sleep script $script ($@)..."
|
||||||
sh $script $1
|
sh $script $@
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit 0
|
@ -22,9 +22,13 @@
|
|||||||
|
|
||||||
. /etc/profile
|
. /etc/profile
|
||||||
|
|
||||||
|
# see https://wiki.archlinux.org/index.php/Power_Management#Hooks_in_.2Fusr.2Flib.2Fsystemd.2Fsystem-sleep
|
||||||
|
|
||||||
for script in $HOME/.config/sleep.d/*.power; do
|
for script in $HOME/.config/sleep.d/*.power; do
|
||||||
if [ -f $script ]; then
|
if [ -f $script ]; then
|
||||||
progress "running custom sleep script $script ($1)..."
|
progress "running custom sleep script $script ($@)..."
|
||||||
sh $script $1
|
sh $script $@
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit 0
|
13
packages/mediacenter/xbmc/system.d/xbmc-lcd-suspend.service
Normal file
13
packages/mediacenter/xbmc/system.d/xbmc-lcd-suspend.service
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=LIRC sleep hook
|
||||||
|
Before=sleep.target
|
||||||
|
StopWhenUnneeded=yes
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=-/usr/bin/xbmc-send --host=127.0.0.1 -a "LCD.Suspend"
|
||||||
|
ExecStop=-/usr/bin/xbmc-send --host=127.0.0.1 -a "LCD.Resume"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sleep.target
|
13
packages/mediacenter/xbmc/system.d/xbmc-lirc-suspend.service
Normal file
13
packages/mediacenter/xbmc/system.d/xbmc-lirc-suspend.service
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=LIRC sleep hook
|
||||||
|
Before=sleep.target
|
||||||
|
StopWhenUnneeded=yes
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=-/usr/bin/xbmc-send --host=127.0.0.1 -a "LIRC.Stop"
|
||||||
|
ExecStop=-/usr/bin/xbmc-send --host=127.0.0.1 -a "LIRC.Start"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sleep.target
|
Loading…
x
Reference in New Issue
Block a user