diff --git a/PKGBUILD b/PKGBUILD index 5c5cebf..078b2e2 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -8,11 +8,11 @@ # Contributor: Maxime Gauduin pkgname=kodi-standalone-service -pkgver=1.5 -pkgrel=2 +pkgver=1.6 +pkgrel=1 pkgdesc="Systemd service and user to autostart kodi at boot" arch=('any') -url="https://wiki.archlinux.org/index.php/Xbmc#Autostarting_at_boot" +url="https://wiki.archlinux.org/index.php/Kodi#Kodi-standalone-service" license=('GPL') depends=('systemd' 'xorg-server' 'xorg-xinit' 'kodi') replaces=('xbmc-standalone-service') @@ -21,8 +21,8 @@ source=("https://github.com/graysky2/$pkgname/archive/v$pkgver.tar.gz") sha256sums=('10d3077b99d9a2511c3fc38e3ce73436d9de05c765ea4c9c44ca7b8bcd607f85') package() { - install -Dm644 "$srcdir/$pkgname-$pkgver/init/kodi.service" "$pkgdir/usr/lib/systemd/system/kodi.service" - install -Dm755 "$srcdir/$pkgname-$pkgver/common/kodi-standalone2" "$pkgdir/usr/bin/kodi-standalone2" + install -Dm755 "$srcdir/$pkgname-$pkgver/common/kodi-standalone2" \ + "$pkgdir/usr/bin/kodi-standalone2" install -dm 700 "$pkgdir"/var/lib/kodi chown 420:420 "$pkgdir"/var/lib/kodi diff --git a/README.md b/README.md index 6b0392c..cd7822e 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,9 @@ A simple systemd service file to run kodi in standalone mode. * xorg-server with xorg-xinit ## Post-install instructions -If using xorg version >=1.16 then create /etc/X11/Xwrapper.config containing these two lines: +If using xorg version >=1.16 then create /etc/X11/Xwrapper.config containing this line: allowed_users = anybody - needs_root_rights = yes Note that the systemd service requires /var/lib/kodi to be user kodi's homedir. See the readme.install which contains scriptlets used by the Arch Linux package system. Users of other distros can adapt the code therein. diff --git a/common/kodi-standalone2 b/common/kodi-standalone2 deleted file mode 100644 index 79fd326..0000000 --- a/common/kodi-standalone2 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2009-2013 Team XBMC -# http://xbmc.org -# -# 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 XBMC; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# http://www.gnu.org/copyleft/gpl.html - -APP=Kodi -prefix="/usr" -exec_prefix="/usr" -bindir="${exec_prefix}/bin" -bin_name=kodi -APP="${bindir}/${bin_name} --standalone $@" - -PULSE_START="$(which start-pulseaudio-x11)" -if [ -n "$PULSE_START" ]; then - # delay needed to allow PA to initialize for kodi - # to detect all audio sources - $PULSE_START - sleep 6s -else - PULSE_SESSION="$(which pulse-session)" - if [ -n "$PULSE_SESSION" ]; then - XBMC="$PULSE_SESSION $XBMC" - fi -fi - -LOOP=1 -CRASHCOUNT=0 -LASTSUCCESSFULSTART=$(date +%s) - -while [ $(( $LOOP )) = "1" ] -do - $APP - RET=$? - NOW=$(date +%s) - if [ $(( ($RET >= 64 && $RET <=66) || $RET == 0 )) = "1" ]; then # clean exit - LOOP=0 - else # crash - DIFF=$((NOW-LASTSUCCESSFULSTART)) - if [ $(($DIFF > 60 )) = "1" ]; then # Not on startup, ignore - LASTSUCESSFULSTART=$NOW - CRASHCOUNT=0 - else # at startup, look sharp - CRASHCOUNT=$((CRASHCOUNT+1)) - if [ $(($CRASHCOUNT >= 3)) = "1" ]; then # Too many, bail out - LOOP=0 - echo "${APP} has exited uncleanly 3 times in the last ${DIFF} seconds." - echo "Something is probably wrong" - fi - fi - fi -done diff --git a/init/kodi.service b/init/kodi.service index c748275..ece7a56 100644 --- a/init/kodi.service +++ b/init/kodi.service @@ -9,7 +9,7 @@ Group = kodi PAMName=login Type = simple TTYPath=/dev/tty7 -ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/kodi-standalone2 -- :0 -nolisten tcp vt7 +ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/kodi-standalone -- :0 -nolisten tcp vt7 Restart = on-abort [Install] diff --git a/readme.install b/readme.install index 573ff05..d77d5d5 100644 --- a/readme.install +++ b/readme.install @@ -43,8 +43,7 @@ post_remove() { post_message() { echo "Users of Xorg >=1.16 wishing to autostart kodi standalone" echo "must create or modify /etc/X11/Xwrapper.config to contain" - echo "the following 2 lines:" + echo "the following:" echo echo "allowed_users = anybody" - echo "needs_root_rights = yes" }