Although the Linux system is very stable and not prone to crashes, it’s inevitable that application windows will hang and freeze at some point. There are thankfully a few tools to get rid of the nasty ‘not responding’ windows instantly and ‘xkill’ is one of them that more friendly to users new to Linux.
In recent Linux distributions, system will detect any problematic windows and offer options to “forcing quit” or “waiting for application to respond”. In case you’re not prompted by such a dialog you can always use the ‘xkill’ command to kill the processes instantly.
Install & Use xkill:
xkill is included in most Linux distributions out-of-the-box. It’s part of the “
x11-utils” package in Debian / Ubuntu, and “
xorg-x11-apps” package in Fedora and CentOS. If your system don’t have this command, install either package in terminal:
sudo apt install x11-utils
sudo yum install xorg-x11-apps
To use the tool, simply open
terminal, type xkill and hit Enter. The mouse cursor will become a ‘X‘ or a scull (depends on the icon theme). Now simply left-click whatever window to kill it.
NOTE don’t click on panel, dock, or desktop which will kill them and break your current desktop session.
To countermand the command, simply right-click anywhere on the screen.
Add keyboard shortcut to xkill:
You don’t have to open a terminal every time trying to kill an app window. To make things easy, you can assign a keyboard shortcut to the command.
And most Linux desktops have Keyboard Shortcuts tab in settings. Simply add new custom shortcut, type
xkill in both name and command box, and finally set your preferred key sequence (‘Ctrl+Alt+K’ recommended).
After that, simply press the key combination on keyboard and left-click an app window will kill it instantly.