Suspend for LXDE and SLiM

After updating the computer, the login to the graphical interface was not able anymore. The terminal login still worked, after replacing lightdm with SLiM via:

# aptitude install slim
# aptitude dpkg-reconfigure slim

Now, you should be able to login via SLiM and not with lightdm. But a new problem arises, you cannot suspend anymore… After some testing, there was a command with which the computer could be suspended:

# /usr/sbin/pm-suspend

In SLiM you have to uncomment in the default configuration file (/etc/slim.conf) the suspend_cmd:

# suspend_cmd sudo /usr/sbin/pm-suspend

In this case the computer runs on ubuntu 12.04 and the suspend works with sudo pm-suspend for the normal user. But now there was still the problem, that the pc could not be suspend with normal user rights. This seems to be controlled by the dbus system. There are two storages for configuration files, which can give or deny permissions to user (/etc/polkit-1/localauthority/ and /var/lib/polkit-1/localauthority). /etc is for local configuration and /var is for third-party-applications. I put the file costum-actions.pkla into /etc/polkit-1/localauthority/50-local.d/:

# [Actions for computer user]
# Identity=unix-user:username
# Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
# ResultAny=yes
# ResultInactive=yes
# ResultActive=yes

You can seperate more user with unix-user:userOne;unix-user:userTwo etc. for more information use the man page on pklocalauthority. After a reboot it worked, hopefully there are no flaws o:

sources:

http://wiki.ubuntuusers.de/Displaymanager
https://wiki.archlinux.org/index.php/SLiM#Shutdown.2C_reboot.2C_suspend.2C_exit.2C_launch_terminal_from_SLiM
http://wiki.xbmc.org/index.php?title=HOW-TO:Suspend_and_wake_in_Ubuntu

~ by frankooh on 2012-11-06T11:40:43+01:00.

Leave a comment