in reply to in ♥️ with PDA (and 🐧)

@ebassi I don't use Gnome and I'm still in #X11 land on #OpenBSD and my #MLVWM window manager, so I'm just "thinking out loud" here...

Do Gnome apps reliably "do the right thing" if sent a SIGTERM, e.g. confirming quit and/or prompting to save unsave changes, as necessary? If so, maybe write a script (triggered on super-q) to get the PID for the frontmost window's process and then `kill -TERM -p $PID` it?

in reply to Morgan Aldridge

@morgant sorry, but no, that’s not how UNIX signals work; you can’t block inside the signal while running a UI loop to get user confirmation—you don’t even have access to most of the POSIX API because of re-entrancy. The number of GUI apps with a signal handler is vanishingly small, and they don’t use it for interaction. Command+q works on macOS because it’s a shortcut managed by the platform to begin with.
in reply to Emmanuele Bassi

@ebassi My understanding is that `xdotool`'s `windowquit` is the equivalent to the WM sending a `WM_DELETE_WINDOW` event, which Gnome and such libraries _should_ handle gracefully. I agree that the `windowclose` & `windowkill` commands should be avoided, if at all possible, since they are _not_ going to be graceful, lose data, and break stuff.