I've already checked and there are no alternatives for elementary OS
except ALT+F4
Well that is the "alternative" if I see it from your point of view. But like KDE, GNOME and many others yours is the real alternative and a rarity of a non spoken rule to define ALT+F4 as a way to close active windows
In elementary OS's Pantheon we call it shortcut, you may keep calling it alternative
If I start to think where it came the idea of this shortcut (or alternative), I'll probably will have to go back to the 80's where a lot of Common User Access standards were written/defined and then Microsoft thought to use F4 better than Q in case a non English speaker will use the shortcut (associated with Quit) or a DVORAK layout user who will not have the Q up there
Also you could check System reserved shortcuts for GNOME in
https://developer.gnome.org/hig/stable/keyboard-input.html.en
And for KDE you'll find them in https://docs.kde.org/trunk5/en/applications/fundamentals/kbd.html
All of them using the "alternative"
I understand you want something like XF86Close
, a simple command. But doesn't work when I tested it.
SOLUTION 1:
In terms of kill the current active window, isn't simple to achieve but you could do it by binding
"xkill -id $(xprop -root | grep NET_ACTIVE_WINDOW\( | cut -d# -f2)"
, to a key
ref: https://bbs.archlinux.org/viewtopic.php?pid=897968#p897968
SOLUTION 2:
$ xdotool key Alt+F4
To install it: sudo apt install xdotool
SOLUTION 3:
$ wmctrl -c :ACTIVE:
To install it: sudo apt install wmctrl
SOLUTION 4:
You could play with xev
Check the outputs and remap it (/usr/share/X11/xkb/keycodes/evdev
)
My ALT+F4 from xev
:
KeyPress event, serial 38, synthetic NO, window 0x4a00001,
root 0x6c6, subw 0x0, time 1732231, (-131,275), root:(500,652),
state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
FocusOut event, serial 38, synthetic NO, window 0x4a00001,
mode NotifyGrab, detail NotifyAncestor
ClientMessage event, serial 38, synthetic YES, window 0x4a00001,
message_type 0x132 (WM_PROTOCOLS), format 32, message 0x130 (WM_DELETE_WINDOW)
More info about map them and the use of xkb
https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450
https://askubuntu.com/a/347382/890782