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:



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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: