Re: [i3] i3wm exit session

  • From: Michael Stapelberg <michael@xxxxxxxx>
  • To: "Discussions/Questions about the i3 window manager" <i3-discuss@xxxxxxxxxxxxx>
  • Date: Sun, 5 Apr 2015 18:50:38 +0200

To expand a bit on my original post: I thought about the pidof
solution, but that will fail on multi-user systems or when you have a
hanging/broken instance of i3-nagbar sticking around.

Making this more robust is not as simple as one might think, and
that’s why I wanted to clarify what the real problem here is. If it’s
merely the dialog showing up more than once (and I _think_ this is
what the question is about), I think not fixing it outweighs the
complexity of fixing it. But it could be that I missed something,
which is why I asked…

On Sun, Apr 5, 2015 at 4:23 PM, Bigby James <bigby.james@xxxxxxxxxxxxxxx> wrote:

On 04/05, Tony Crisci wrote:
Is there any way to add some snipe of code to solve it if I press many
times?

Change the binding to this

bindsym Mod1+Shift+e exec "pidof i3-nagbar || i3-nagbar -t warning -m
'You pressed the exit shortcut. Do you really want to exit i3? This will
end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"

More often than not, the simplest solution to a problem is the preferrable
one.
You can hit several dozen keystrokes writing code to "correct" this "problem,"
or you can just hit one keystroke and train yourself to not compulsively do
the
same thing over and over and over when there's no reason to. Incidentally,
that
ugly yellow thing is called "i3-nagbar," emphasis on "nag." If it's annoying
you, it's doing its job. Personally I (and, I suspect, many other users) just
remove all mention of i3-nagbar from the configuration.

This whole thread reminds me of that old joke:

PATIENT: Doctor, it hurts when I do this...
DOCTOR: Then don't do that.

--
"A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools." - Douglas
Adams




--
Best regards,
Michael

Other related posts: