Monday, June 25, 2012

XBMC - Arch Linux - Suspend

Here's a quickie on suspending your computer with XBMC on Arch Linux. This is afaict not at all specific to Arch in any way, except the pacman-command obviously and should work on other distros as well.

Install upower and consolekit if not already installed:
pacman -S upower consolekit

Run pkaction and you should see these two among the... err... things listed:
org.freedesktop.consolekit.system.stop
org.freedesktop.upower.suspend

Create/edit custom-actions.pkla:
nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla

"Type" in:
[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
where xbmc is the user you have running xbmc.

That's it.