This may be marked a dupe of https://bugzilla.xfce.org/show_bug.cgi?id=9326
(This could be handled in xfce4-session by calling systemd-inhibit on session start, but could be solved here by calling the dbus calls to inhibit systemd when xfce4-power-manager is actually running).
As of systemd version 190, systemd now takes over handling lid button, power and sleep buttons, etc.
This overrides xfce4-power-manager. It would be nice if xfce4 session could inhibit this on startup.
From the systemd NEWS file:
" * logind's inhibition logic has been updated. By default,
logind will now handle the lid switch, the power and sleep
keys all the time, even in graphical sessions. If DEs want
to handle these events on their own they should take the new
handle-power-key, handle-sleep-key and handle-lid-switch
inhibitors during their runtime. A simple way to achiveve
that is to invoke the DE wrapped in an invocation of:
systemd-inhibit --what=handle-power-key:handle-sleep-key:handle-lid-switch ..."
See also: http://www.freedesktop.org/wiki/Software/systemd/inhibit
It may be that xfce4-power-manager should take this instead of xfce4-session... which would allow for systemd to handle things still in cases where xfce4-power-manager was not running.
is it maybe possible to inhibit systemd by a script snippet via xinitrc that calls startxfce4? I guess strongly this should be only a configuration issue.
(In reply to comment #1)
> is it maybe possible to inhibit systemd by a script snippet via xinitrc that
> calls startxfce4? I guess strongly this should be only a configuration issue.
Yes, but this means that it inhibits it for the entire session.
So, if for example, you don't have xfce4-power-manager installed, or running, nothing at all will handle the buttons and they won't work.
It seems cleaner to me to have xfce4-power-manager do this itself, and drop the inhibit on exit.
Of course it may not be easy to implement, so short term we may want to go with a session wide inhibit in xfce4-session (thus the other bug).
I can reproduce on Manjaro (ArchLinux). The system is going into standby mode twice, when on power supply, and first to standby, then to hibernation, after woke up from standby.
$ xfconf-query -vl -c xfce4-power-manager
When on battery, first to standby, then really in hibernation, after woke up from first standby (guess systemd introduces the standby).
There is "DBus server implementation for org.freedesktop.PowerManagement.Inhibit" available.
Maybe systemd can use that? Sorry, I am not interested in systemd's configuration or internal logic.
see also bug #9090
"inhibit warning doesn't display application name and reason"
after some discussion has taken place on the mailing lists, this here seems to be more like a feature request. There are options available for the distributions and then also for the end user to work around the unwanted doubled sleep action.
As an alternative to the inhibit option, we could think about an enhancement to the GUI. It could detect that systemd is about handling the switches on a system wide base (generally, only the root user can modify logind.conf while xfpm can have individual settings for each user). When systemd doesn't prevent power management, there should be an hint to the user about that. When the user has chosen "nothing" as the individual action, this doesn't mean systemd cares. The user could get confused in both ways, because there are two independent configurations (root and user). Automated inhibit wouldn't make that less complicated.
I suggest to add a systemd option to all those action handler lists in the settings dialogs.
For instance, there is a hint already that not enough swap space is available for hibernation. Another hint could also warn about systemd. Improving the user interface make more sense than implementing some magical code behind the possibilites of a not so experienced user.
What do you think?
My xfce4-power-manager settings explicitly say "do nothing on lid close" -- and yet my laptop started suspending since upgrade to F18.
THIS IS A BUG, NOT A FEATURE. PLEASE FIX ASAP!
(In reply to comment #8)
> My xfce4-power-manager settings explicitly say "do nothing on lid close" --
> and yet my laptop started suspending since upgrade to F18.
This can be adjusted in /etc/systemd/logind.conf. Just set HandleLidSwitch and other the events you want to handled by systemd to "ignore".
> THIS IS A BUG, NOT A FEATURE. PLEASE FIX ASAP!
From a x-p-m point of view, support for systemd is a feature.
Created attachment 4929
Here is patch for inhibiting systemd to handle power/suspend/hibernate buttons
and lid-switch while xfce4-power-manager is running. It works with both systemd and SysV init systems (if there is no systemd-logind then just do nothing).
(In reply to comment #10)
> Created attachment 4929
> Here is patch for inhibiting systemd to handle power/suspend/hibernate
> and lid-switch while xfce4-power-manager is running. It works with both
> systemd and SysV init systems (if there is no systemd-logind then just do
Patch works fine here for me. :)
I think instead of unconditional inhibition user got to have a choice in GUI whether to use systemd settings (this should gray-out x-p-m settings) or override them.
(In reply to god12 from comment #12)
> I think instead of unconditional inhibition user got to have a choice in GUI
> whether to use systemd settings (this should gray-out x-p-m settings) or
> override them.
As far as I understand it, there's also the possibility to only delay the suspend from systemd, in order for xfpm to do something (for example locking the screen). That's what Gnome is doing right now, afaict.
This bug has been fixed in git master.