0

Currently using KDE.

I'd like a shortcut that's able to kill a window, but not all windows of the same process.

For example, right now I'm using xkill to kill windows using the mouse. I love it, but say I launch two xfce-terminal windows and I only want to xkill one of them with the mouse. If I click on any of those terminal windows, it kills both. I only want the one I specifically clicked on to close, not both terminal windows.

Any way to accomplish this without having to manually type anything in? I'm hoping I can use the mouse like I usually do, only just having it kill specific windows.

  • 2
    What you're asking for already exists as an x in the corner of the window. – Nmath Mar 13 '22 at 21:57
  • Borders and title bars are removed for aesthetic purposes. – Ran Shorowitz Mar 13 '22 at 23:07
  • 2
    Sounds like you launched one xfce4-terminal from the other? Is that correct? If so, you need to run the command like xfce4-terminal & then disown in the original terminal to prevent the one from closing the other one. – Terrance Mar 13 '22 at 23:34
  • Oh maybe. I launched it using the standard KDE task manager honestly. I guess I need to set a specific launcher then – Ran Shorowitz Mar 14 '22 at 00:24

2 Answers2

2

A quite universally used shortcut that kills a single window is Alt+F4. Much faster than launching xkill, then click, and will work also on systems running Wayland instead of Xorg.

It was already defined like that in Windows 3.1, and ever since has continued to be adopted in a majority of desktop environments, including KDE. Most desktop environments allow to change that shortcut key if you wish.

vanadium
  • 88,010
2

xkill kills a process the window belongs to, not a window. There is no such concept in the OS process or window management as "killing a window". It just doesn't work this way. The window is not a standalone entity, it is always just a "face" (sometimes one of many) of a process displaying it. You cannot kill a face without killing the owner of that face :).

If the process is working correctly, it usually has its own method of closing the window (if all else fails, just by clicking "x" icon in the window top bar - if you removed the top bar "for aesthetic purposes", that's exactly the mistake you have made. It is there for a reason.). But there's no need to use xkill in that case. xkill is a tool meant to be used when the process has hung up and is not responding. In that case, if two windows are displayed by the same process, and you kill that process, both windows will be closed.

raj
  • 10,353