LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Running 'xfce-session-logout' from acpi script (http://www.linuxquestions.org/questions/linux-software-2/running-xfce-session-logout-from-acpi-script-604449/)

ewolf 12-04-2007 11:23 AM

Running 'xfce-session-logout' from acpi script
 
Hello,
I am trying to run xfce4-session-logout from an acpi script. The script is called, but logs indicate that xfce4-session-logout has a problem: 'no session manager running'. Subsequently, the logout/shutdown dialog does not appear in my Xfce session.


From /var/log/acpid:
Code:

[Tue Dec  4 11:11:03 2007] received event "button/power PWRF 00000080 00000002"
[Tue Dec  4 11:11:03 2007] notifying client 2830[105:106]
[Tue Dec  4 11:11:03 2007] notifying client 2999[0:0]
[Tue Dec  4 11:11:03 2007] executing action "/etc/acpi/powerbtn-acpi-support.sh"
[Tue Dec  4 11:11:03 2007] BEGIN HANDLER MESSAGES
xfce4-session-logout: No session manager running.
[Tue Dec  4 11:11:04 2007] END HANDLER MESSAGES
[Tue Dec  4 11:11:04 2007] action exited with status 0
[Tue Dec  4 11:11:04 2007] completed event "button/power PWRF 00000080 00000002"

I also get no results when running xfce4-session-logout from a shell. Has anyone had luck running xfce4-session-logout from the command line or a script?

peart 12-05-2007 10:57 PM

Hello,

I just tried the xfce4-session-logout command in xterm, and the logout popup appeared.

I'm going to assume that the logout command only works if xfce4-session is running, as well as dbus. This is just an assumption, not hard fact. Do you have both those processes running?

Judging by the error message, I'd say you are using XFCE4 without the session manager.

ewolf 12-06-2007 10:56 AM

Actually, I now am getting the logout dialog if I type "xfce4-session-logout" from the shell, and I am not sure why this has changed. I can even script it.... but it doesn't work unless I call the script from the command line. The ACPI event handler tries to execute "xfce4-session-logout" when I press my laptop's power power button, but xfce4-session-logout can't seem to find the xfce4-session that I have open, and thus, no window pops up.

MasterC 12-06-2007 11:05 AM

My guess is that it's trying as the user who runs your ACPI daemon. Offhand I can't think of a way to get around that without running the ACPI as the user who is logged in, but you may be able to instead turn xfce4-session-logout into a wrapper that queries the user who is running XFCE4 and executes it as that user.

-Chad


All times are GMT -5. The time now is 01:41 PM.