I assume you want an application to quit with Super+q because it looks like Command+q? In which case: no. All shortcuts are set up by applications, which means only applications can decide what to use, depending on the platform.
@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?
@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.
@ebassi At least on the #X11 side, you could still close all windows for the application with `xdotool`'s `windowquit` command (or `windowclose` or `windowkill`, if absolutely necessary).
@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.
Emmanuele Bassi
in reply to in ♥️ with PDA (and 🐧) • • •in ♥️ with PDA (and 🐧)
in reply to Emmanuele Bassi • • •Morgan Aldridge
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?
Emmanuele Bassi
in reply to Morgan Aldridge • • •Morgan Aldridge
in reply to Emmanuele Bassi • • •Morgan Aldridge
in reply to Morgan Aldridge • • •Emmanuele Bassi
in reply to Morgan Aldridge • • •Morgan Aldridge
in reply to Emmanuele Bassi • • •