You are not logged in.
All the scripts in /etc/pm/sleep.d are run as root. Is there any way for me to put a script such that it runs as my logged-in user AFTER all the scripts in /etc/pm/sleep.d. I tried putting su -c "command" - <username> but that doesn't have the full user environment, hence dbus session bus doesn't work yet.
EDIT: Solved: see solution by lucke below.
Last edited by ngoonee (2009-11-14 20:40:50)
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
It might help to know what command you're having trouble with--perhaps there's a better/easier way to execute it.
The scripts in /etc/pm/sleep.d are called in numeric order during suspend. That is, if you have a script titled 44-myfix-for-foo, it will run before a script titled 88-myfix-for-bar. These scripts are then executed in reverse order upon resume.
thayer williams ~ thayerwilliams.ca
Offline
Here's how I handle quitting some apps via dbus before suspend:
1) I save DBUS_SESSION_BUS_ADDRESS in KDE's autostart (echo $DBUS_SESSION_BUS_ADDRESS > /home/lucke/.dbus_session).
2) I run "DBUS_SESSION_BUS_ADDRESS=`cat /home/lucke/.dbus_session` su lucke -c "kquitapp amarok; kquitapp kmix"" in pm-utils.
Offline
Thanks lucke, that sounds a bit hackish but i think it'll work.
And thayer, I know the order of the scripts, but they're all run as root, which was my main issue. I'm trying to run jack2, which uses `jack_control start` to start jack via dbus.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline