I am afraid this would be hard to achieve however I'll try to ask.

I was used from other systems like Windows or other distros that when you have multiple applications opened and you want to shutdown your computer, then you just keep pressing Alt + F4 (and either saving or discarding sessions from programs you have opened before) until you reach the dialog which offers you shutdown.

However pressing Alt + F4 when no applications are opened in elementary OS does nothing, is there a way how to change the settings to have this kind of behavior?

marked as duplicate by Lewis Goddard Jul 27 '15 at 12:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from unix.stackexchange.com Jul 26 '15 at 17:49

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.

  • I do not believe it would be possible to both keep the current window-closing behaviour and also trigger a shutdown within elementary. – Lewis Goddard Jul 26 '15 at 17:56
  • it would be possible in gala which also handels the other known hotkeys. but perhaps gala doesn't track active windows than it would be hard. it would always need to be implemented code wise – kay Jul 26 '15 at 19:01
  • I don't have enough reputation to leave this as a comment so I'll leave this as an answer: This appears to be a feature request. Those should be done on Launchpad so developers can properly track and discuss it. If you don't know how to file a feature request, this might help: elementaryos.stackexchange.com/questions/387/… – vivien Jul 26 '15 at 21:01
  • Thanks, I have filled a bug report so hopefully it's going to find it's way to the Elementary :) – Petr Mensik Jul 26 '15 at 22:28

As far as I know this isn't supported by elementary. If you really want this feature then you will have to write something custom. If you can trigger a script by hotkey (autokey etc) then you could run "wmctrl -l" and count the lines of output by piping into wc like so: "wmctrl -l | wc -l". Since plank and wingpanel are also counted you would write an if statement that checks if more than two programs are open and closes the current one using: (not tested) "xdotool getactivewindow windowkill". I'm not sure how you would open the shutdown dialog but maybe someone else can shed some light on that.

tldr; Not supported. Scripting required.

Not the answer you're looking for? Browse other questions tagged or ask your own question.