1

I asked the same question for Freya but in Loki the situation is different, none of the two dialogues can be triggered with those commands.

gnome-session-quit --power-off used to trigger this dialogue:

enter image description here

while the default dialogue was triggered by the command dbus-send --session --print-reply --dest=com.canonical.Unity /org/gnome/SessionManager/EndSessionDialog org.gnome.SessionManager.EndSessionDialog.Open uint32:2 uint32:0 uint32:0 array:objpath:[].

enter image description here

Asking on the g+ group here, the command dbus-send --system --print-reply --dest=/org/freedesktop/login1 org.freedesktop.login1.power_off was mentioned, but it doesn't work.

What is the command behind the default Loki Shutdown dialogue? I prefer to use a shortcut for that, especially that the shutdown laptop button triggers no dialogue but suspends directly.

5
+50

Not quite what you wanted, but here was what I was able to find:

Shutdown directly:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true

Reboot directly:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:true

Sleep directly:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Suspend" boolean:true

Theses commands will immediately trigger the action without any confirmation dialogue — it's the hook that the dialog box uses.

The dialog box you're after is known as EndSessionDialog. It's part of Wingpanel's session indicator. Here is where it's built. Here is where the indicator calls it. Here is where the indicator interfaces with dbus. Here is when org.gnome.SessionManager was swapped out for org.freedesktop.login1.

After much gdbus introspection, I surmise that it's going to be similar to the original dbus command with /org/gnome/SessionManager swapped for /org/freedesktop/login1, but I don't speak the language well enough to find the hook. But I emailed the maintainer so we'll see what we hear back.

  • what about the logout? – user170 Nov 25 '16 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy