Hotkey to Close the Current Window

Forum rules
Before you post please read how to get help
Post Reply
raywood
Level 1
Level 1
Posts: 25
Joined: Sat Apr 09, 2016 1:45 pm

Hotkey to Close the Current Window

Post by raywood » Mon Jun 25, 2018 7:28 pm

Let's say I have sessions of Terminal, xed, Thunar, and Firefox open currently. This would be comparable to having a command window, Notepad, Windows Explorer, and Firefox open in Windows. In Windows, Ctrl-W has relatively desirable behavior, for my purposes: it closes the Windows Explorer session and the current Firefox tab. It has no effect on the command window or Notepad, unfortunately.

I switch back and forth between the two operating systems. How close can I come to setting Ctrl-W or Super-W to close any of the foregoing? So far, I'm not finding a single universal (or even semi-universal) command that I could assign to a hotkey to close the currently selected window, dialog, or tab in LMX.

This is not a high priority for me. It is a bell or whistle that I would ideally add. In part, I'm just curious. But if I could get that functionality, it would help. TIA.

gm10
Level 7
Level 7
Posts: 1691
Joined: Thu Jun 21, 2018 5:11 pm

Re: Hotkey to Close the Current Window

Post by gm10 » Mon Jun 25, 2018 7:49 pm

I'm not on Xfce but Ctrl+W already seems to be the default for closing tabs in those apps (Ctrl+Shift+W in the terminals)? Either way, a hotkey for closing a tab has to be provided by each application individually, you cannot configure that globally. So check the respective application setings/preferences.

User avatar
catweazel
Level 16
Level 16
Posts: 6305
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Hotkey to Close the Current Window

Post by catweazel » Mon Jun 25, 2018 8:13 pm

gm10 wrote:
Mon Jun 25, 2018 7:49 pm
I'm not on Xfce but Ctrl+W already seems to be the default for closing tabs in those apps (Ctrl+Shift+W in the terminals)? Either way, a hotkey for closing a tab has to be provided by each application individually, you cannot configure that globally. So check the respective application setings/preferences.
Nonsense.
There are no silly questions, but there are silly answers.

User avatar
catweazel
Level 16
Level 16
Posts: 6305
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Hotkey to Close the Current Window

Post by catweazel » Mon Jun 25, 2018 8:19 pm

raywood wrote:
Mon Jun 25, 2018 7:28 pm
In Windows, Ctrl-W has relatively desirable behavior
Alt-F4 is the standard method for closing windows. In Xfce, go to Window Manager, and on the keyboard tab, select 'Close window', double-click to clear, then set Ctrl-w as the action for F4. However on my xfce, ctrl-w closes windows without changing the setting.
There are no silly questions, but there are silly answers.

gm10
Level 7
Level 7
Posts: 1691
Joined: Thu Jun 21, 2018 5:11 pm

Re: Hotkey to Close the Current Window

Post by gm10 » Mon Jun 25, 2018 8:19 pm

catweazel wrote:
Mon Jun 25, 2018 8:13 pm
gm10 wrote:
Mon Jun 25, 2018 7:49 pm
I'm not on Xfce but Ctrl+W already seems to be the default for closing tabs in those apps (Ctrl+Shift+W in the terminals)? Either way, a hotkey for closing a tab has to be provided by each application individually, you cannot configure that globally. So check the respective application setings/preferences.
Nonsense.
Thank you for your helpful contribution. Then explain to me (or rather the OP) how a global hotkey from the window manager can interact with tabs in an application. Your explanation about closing the whole application window down, while correct, will hardly help him with that.

aes2011
Level 4
Level 4
Posts: 473
Joined: Wed Jul 06, 2011 10:39 pm

Re: Hotkey to Close the Current Window

Post by aes2011 » Mon Jun 25, 2018 10:21 pm

raywood wrote:
Mon Jun 25, 2018 7:28 pm
to close the currently selected window, dialog, or tab in LMX.
+1 gm10.

I very much doubt you can have one command that deals with closing tabs as well as with closing normal windows and tabs in applications.

User avatar
AZgl1500
Level 8
Level 8
Posts: 2022
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Hotkey to Close the Current Window

Post by AZgl1500 » Tue Jun 26, 2018 1:28 am

I'm using 18.3 Cinnamon,

and ALT-F4 will close everything period, no problems including Terminal.

User avatar
k-314
Level 3
Level 3
Posts: 125
Joined: Sun Aug 06, 2017 4:42 am
Location: Germany

Re: Hotkey to Close the Current Window

Post by k-314 » Tue Jun 26, 2018 12:43 pm

AZgl1500 wrote:
Tue Jun 26, 2018 1:28 am
I'm using 18.3 Cinnamon,

and ALT-F4 will close everything period, no problems including Terminal.
...but the question was about Xfce.
ASUS P5QL + Intel Core Duo E6750 @2.66GHz, Nvidia GEFORCE GT730
8GB DDR2-800, SSD 60GB, HDD 2TB, 250GB. Linux Mint 18.3 - Xfce

mint4all
Level 2
Level 2
Posts: 66
Joined: Tue Feb 13, 2018 1:16 pm

Re: Hotkey to Close the Current Window

Post by mint4all » Tue Jun 26, 2018 2:38 pm

k-314 wrote:
Tue Jun 26, 2018 12:43 pm
AZgl1500 wrote:
Tue Jun 26, 2018 1:28 am
I'm using 18.3 Cinnamon,

and ALT-F4 will close everything period, no problems including Terminal.
...but the question was about Xfce.
Greetings! I have been using Mint's xfce-editions for over 4+ years (and have tested a number of other distro's exploring how they have tweaked xfce, i.e. xubuntu's spin), and never had a problem using the ALT-F4 key to close open windows (except, of course, when an app has crashed or hangs) just as catweazel indicated above. Just to be sure, i opened ~10 different apps, incl. Terminal, on top of each other, then used ALT-F4 to close each of those "open" windows with the last one bringing up the logout popup. Afaict, no problem at all. Note: any minimized apps remain in xfce's window list, btw.

Just in case one needs to tweak something, there's more info available about typical linux shortcuts @ https://help.ubuntu.com/community/KeyboardShortcuts and @ https://en.wikipedia.org/wiki/Magic_SysRq_key ... Hope this helps.

User avatar
MtnDewManiac
Level 6
Level 6
Posts: 1351
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: Hotkey to Close the Current Window

Post by MtnDewManiac » Mon Jul 02, 2018 3:43 pm

catweazel wrote:
Mon Jun 25, 2018 8:19 pm
Alt-F4 is the standard method for closing windows.
In linux, too? I had been assuming that it was the standard method in Microsoft OS (for many years, at least), but wasn't sure about linux. I had been privately assuming (there I go, assuming again :lol: ) that this was another example of "The linux experience is like dealing with 1,000 rabid cats" in that there wasn't really a standard. CTRL Q seems to exit most applications I use, even ones that aren't "linux onlu" (such as Firefox). One notable exception being mint-Update, but as it still occasionally fails to display a changelog for the files it wishes to upgrade, I figure that anything else that it fails at is, realistically, pretty minor as long as it doesn't actually cause a fire :roll: . But with most apps, CTRL Q performs an exit and CTRL W closes a tab (if present) or window (ditto, if the application supports multiple windows), without actually exiting.

But if ALT F4 is the correct way to immediately exit an application and/or popup window, then I will attempt to train myself to use this combination instead of CTRL Q.

Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.

User avatar
AZgl1500
Level 8
Level 8
Posts: 2022
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: Hotkey to Close the Current Window

Post by AZgl1500 » Mon Jul 02, 2018 3:56 pm

In Mint Cinnamon and some of the other distros,

ALT-F4 closes every app I have tried it on, including Terminal.

gm10
Level 7
Level 7
Posts: 1691
Joined: Thu Jun 21, 2018 5:11 pm

Re: Hotkey to Close the Current Window

Post by gm10 » Mon Jul 02, 2018 4:56 pm

MtnDewManiac wrote:
Mon Jul 02, 2018 3:43 pm
But if ALT F4 is the correct way to immediately exit an application and/or popup window, then I will attempt to train myself to use this combination instead of CTRL Q.
The more mainstream distros have just picked it up to make the transition from Windows easier. Personally I use Ctrl+Q mostly, easier to reach. On the other hand, I configured Win+E to open the file browser, blatantly copied from the Windows world, but it's a good combination.

To go with the old Perl motto, there's more than one way to do it. Use whatever suits your work flow best.

User avatar
catweazel
Level 16
Level 16
Posts: 6305
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Hotkey to Close the Current Window

Post by catweazel » Mon Jul 02, 2018 6:14 pm

gm10 wrote:
Mon Jul 02, 2018 4:56 pm
The more mainstream distros have just picked it up to make the transition from Windows easier.
I'm not sure that's correct. It's been in UX design guidelines since the year dot. Consistency in UX is a golden rule.
There are no silly questions, but there are silly answers.

gm10
Level 7
Level 7
Posts: 1691
Joined: Thu Jun 21, 2018 5:11 pm

Re: Hotkey to Close the Current Window

Post by gm10 » Mon Jul 02, 2018 6:22 pm

catweazel wrote:
Mon Jul 02, 2018 6:14 pm
gm10 wrote:
Mon Jul 02, 2018 4:56 pm
The more mainstream distros have just picked it up to make the transition from Windows easier.
I'm not sure that's correct. It's been in UX design guidelines since the year dot. Consistency in UX is a golden rule.
Probably a hen/egg problem, but I'm good with either, makes no difference at the end of the day.

mint4all
Level 2
Level 2
Posts: 66
Joined: Tue Feb 13, 2018 1:16 pm

Re: Hotkey to Close the Current Window

Post by mint4all » Mon Jul 02, 2018 6:56 pm

gm10 wrote:
Mon Jul 02, 2018 6:22 pm
catweazel wrote:
Mon Jul 02, 2018 6:14 pm
gm10 wrote:
Mon Jul 02, 2018 4:56 pm
The more mainstream distros have just picked it up to make the transition from Windows easier.
I'm not sure that's correct. It's been in UX design guidelines since the year dot. Consistency in UX is a golden rule.
Probably a hen/egg problem, but I'm good with either, makes no difference at the end of the day.
Fwiw ... You're looking at 25+ years of keyboarding tradition. The ALT+F4 combo (afaicr) was introduced by IBM in ther "CUA" (common user access) specification which was adopted by MS in Windows 3.1 (ca. 1992) & IBM in OS/2. You can find that old keyboard shortcut map @ http://allhotkeys.com/os_2_hotleys.html ... Funny how history repeats itself, eh? :wink:

gm10
Level 7
Level 7
Posts: 1691
Joined: Thu Jun 21, 2018 5:11 pm

Re: Hotkey to Close the Current Window

Post by gm10 » Mon Jul 02, 2018 7:07 pm

Wow OS/2, now that's a blast from the past. Also interesting (mostly the fact that somebody would go to the trouble of creating this): https://en.wikipedia.org/wiki/Table_of_ ... _shortcuts

User avatar
lsemmens
Level 5
Level 5
Posts: 690
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Hotkey to Close the Current Window

Post by lsemmens » Mon Jul 02, 2018 9:40 pm

Time was when the only keyboard shortcut you needed to know was the old "three finger salute" or <Ctrl> <Alt> <Del> to terminate a process when Windoze wouldn't behave. Haven't needed that since the move to Linux. :D
Kernel: 4.15.0-24-generic x86_64 bits: 64
Desktop: Cinnamon 3.8.7
Distro: Linux Mint 19 Tara

Laptop T4500 Dualcore 4Gb RAM
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
Out of my mind - please leave a message

User avatar
catweazel
Level 16
Level 16
Posts: 6305
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Hotkey to Close the Current Window

Post by catweazel » Mon Jul 02, 2018 9:49 pm

lsemmens wrote:
Mon Jul 02, 2018 9:40 pm
Time was when the only keyboard shortcut you needed to know was the old "three finger salute" or <Ctrl> <Alt> <Del> to terminate a process when Windoze wouldn't behave. Haven't needed that since the move to Linux. :D
KDE uses it to offer logout/shutdown options. Presumably other DEs do the same.
There are no silly questions, but there are silly answers.

User avatar
MtnDewManiac
Level 6
Level 6
Posts: 1351
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: Hotkey to Close the Current Window

Post by MtnDewManiac » Mon Jul 02, 2018 11:16 pm

catweazel wrote:
Mon Jul 02, 2018 9:49 pm
lsemmens wrote:
Mon Jul 02, 2018 9:40 pm
Time was when the only keyboard shortcut you needed to know was the old "three finger salute" or <Ctrl> <Alt> <Del> to terminate a process when Windoze wouldn't behave. Haven't needed that since the move to Linux. :D
KDE uses it to offer logout/shutdown options. Presumably other DEs do the same.
I just tried it in Xfce (I believe this is my Mint 17.3 partition). The screen slowly faded to black. I waited a few more seconds, then pressed any key (lol) - and some archaic-looking window popped up, which required me to enter my password. After doing so, I got my system back. I assume, in Xfce, this keyboard combination is a shortcut for locking the computer without logging out or something?

I had previously thought that I could use that combination to run the task manager application included with Xfce. Apparently, I was mistaken.



Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.

Post Reply

Return to “Xfce”