# emacsclient
set $em_daemon ~/.local/bin/em
# make a quick launcher for specific things I do all the time
bindsym $mod+o mode "spotlight"
mode "spotlight" {
## specific files in a new emacs buffer
# dired in home
bindsym d exec $em_daemon ~/; mode "default"
# ibuffer
bindsym e exec $em_daemon --eval "(ibuffer)"; mode "default" #
# guaranteed new scratch buffer
bindsym s exec $em_daemon --eval '(switch-to-buffer (format-time-string "%d %b %Y %H:%M:%S"))'; mode "default"
## common binaries
bindsym f exec firefox ; mode "default"
bindsym h exec --no-startup-id zeal ; mode "default"
bindsym j exec --no-startup-id ~/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox ; mode "default"
bindsym m exec --no-startup-id mendeley ; mode "default"
bindsym k exec --no-startup-id keepassxc ; mode "default"
## special launchers
# ipython
bindsym i exec zsh -c '$alacritty -e ~/.local/pipx/venvs/ipython/bin/ipython'; mode "default"
# app switcher
bindsym a exec "rofi -show window -show-icons -theme gruvbox-dark-hard.rasi"; mode "default"
## just in case we did this by mistake
bindsym Escape mode "default"
}
Not if you suffer from RSI and you want to use as few key strokes as possible. I really don't understand this trend towards minimalist keyboards. I want more keys, not fewer.
I mean, a pianist also doesn't put everything on their home row.
Funny, RSI of a different kind is what pushed me to a minimalist keyboard. I pay the cost of increased complexity to avoid the strain of reaching distant keys.
You can also get most of this configuration-free in Gnome. [Super] key switches to a spotlight context; one alphabetic letter focuses the most frequently used app with that prefix; and [Enter] key launches it without prompt.
I meant for example, if I hit Meta+o then I could press any single key after that.. i.e. 't' for terminal, 'f' for file manager, 'b' for browser. KDE doesn't support that, as far as I know.. nothing built in, anyways.
My mental sanity depends on some fixed beliefs. One of those is that every key sequence not involving the Win key is sent to and handled by the application in focus. Including F-keys, which many applications expect, in any case. Ex: F2=edit cell, F9=recalculate in Excel.
Global actions handled by the SO or DE must involve Win. Ex: Win+L lock screen.
And yes, Redmond-imposed Alt-Tab is an abomination: it should have been Win+Tab since the beginning.
The workflow you're proposing could be easily achieved with Win+ a carefully chosen letter. Benefits: 1. the letter is easier to remember; 2. You have 20-something free slots instead of 12 (excluding the ones that are already taken for standard actions like L for lock); 3. Most probably your fingers are already there and you have muscles memory of where the letters are; 4. Consistent, expected behavior of where keys are sent to.
Broad standards are so valuable. When a hotkey becomes common across apps and operating systems, we should work hard to preserve that rare and beautiful covenant that humanity has achieved together.
F1 means help.
F2 means edit. It edits filenames on most operating systems if you have a file selected, and cells in most spreadsheet programs.
Alt+F4 means close.
Alt+tab means switch program.
Ctrl+C is copy, Ctrl+V is paste
I feel the same way about automobiles. It doesn't really matter whether we initially decided that the brake pedal would be the right or left of the gas pedal, but the fact that you can get in just about any car in the world and rely on the pedals to be in roughly the same place and do roughly the same thing is magical. If you're going to move them around, you better have a great reason.
The agreements we've achieved on standards, even when they're not perfect (QWERTY keyboard, heirarchical directory structure), should be considered global treasures and treated as such.
> The agreements we've achieved on standards, even when they're not perfect, should be considered global treasures and treated as such.
Hell no! As soon as you see a better way to do the same thing, you should allow the user to embrace the new way, while still keeping compatibility with the old one during a grace period.
I know that there are companies that behave differently. Their products are often cruft-ridden.
Automobiles are not exempted: just look at the clumsy, unnecessarily large shift gear lever that equips electric cars where the P R N D L modes are simulated in software. But hey the big lever between the seats is a sacred standard!
I think the optimal solution lies somewhere between my conservative argument and your disruptive one. Standards do become obsolete, and I agree that positive innovation often means leaving them behind.
But in the case of the shift lever -- I think it's great that I can hop in any car, and count on having obvious lever with the basic drive modes. In lots of cars, it's not big or between the seats; doesn't the Prius have it on the dash?
The idea is not centered around F-keys. The idea is to have fast shortcuts to every app you need regularly. You can use any other keys.
The problem, of course, is that all keys are already taken. Even F-keys are normally taken by volume control, playback control, brightness control, etc, and you have to press Fn-F1 to access F1. There are no spare keys, unless you buy a dedicated keypad.
So I, as likely everyone else, have a bunch of Win+something shortcuts, often involving 2 or 3 more keys. (Using KMonad to have modifiers on the home row helps.)
But the idea still stands. I already have shortcuts for the screen shot app, for the character map app, etc; why not add shortcuts for bringing Emacs or Firefox or a terminal to the front? I'll explore that.
Windows 3.1 tasking was technically lacking, but still very useful and still very much needed alt+tab. It needed it even more than win95, in fact, as it had no task bar.
Well it’s worth noting that you can achieve this very easily by just pinning apps to the taskbar : Win+1 will toggle the first one, Win+2 the second one and so on up to 9.
1. Alt-Tab also works to select which Excel file you want in focus. I often have 10+ Excel files open and choose what I need with Alt-Tab-Arrow.
2. I can open all apps fast using Windows+Text. For example, Excel opens if I hit the Windows Key then “exc”, Chrome opens if I hit the Windows Key then “chr”, etc. Mac users can do the same by replacing the Windows Key with Command + Space.
Idk where you were at that era but the Win key came out half a decade after Alt-Tab.
Win95 didn't even have the Win key.
Goodness. Think before you post. :) A thing cannot be an abomination for not making use of a building material which would not exist for most of the decade.
I see your point, but personally I never liked following fixed beliefs if in the long run I could benefit from dropping them. As an example, that's why I also learned Dvorak (which was much more painful than re-learning F-keys).
Alt+Ctrl+Delete was special-cased as an unforgeable sequence to access the security screen in Win NT, with special provisions down to BIOS level IIRC. (Else credentials stealing becomes too easy.)
REISUB is for truly exceptional circumstances; I used it 2-3 times in 20 years of using Linux on desktop.
In this kind of discussion people often focus solely on frequent actions, but there is one class of action that should have priority for the limited keys: the infrequent urgent. That is, tasks that don't happen that often, but when they do they are very urgent. For me the best example is the sound volume controls, I don't change sound volume nearly as often as I alternate between apps, but when I need to change the sound volume I need it right now, so that is what I'm using my F-keys for.
Some keyboard come with dedicated volume +/-/mute keys which is great and frees up function keys.
I have "screenshotting" as a frequent need -- which in some occassions is an urgent one too :)
I use 3 different types of screen capture (current window, select a region, repeat last region) mapped to F6 F7 F8 on all my machines now which gets a lot of use.
I use sharex and screenshot and region snip a lot. I have it override the screenshot key and then just ctrl and shift for region. Screen. And current windows modifications.
F keys are in my opinion better used elsewhere when you can override screenshot key for screenshots.
I know lots of apps that use those F keys you've overriden.
That is a fine use, but multimedia keys use 3-7ish (depending on how crazy you go) of the 48-ish function keys readily available. By which I mean, unmodified, SHIFT, CTRL, and ALT, and that's without counting multiple modifiers. I've got volume, mute, pause, fast forward and reverse in there but it's far from the only things I've got. (Well... technically FF, reverse, and pause are WIN-right, WIN-left, and WIN-up respectively, but same principle.) I'm not even close to using up all the function keys.
I've mapped these in something like the last four window managers I use, and they've survived across probably a dozen physical keyboards now. Physical buttons for these things come and go but "WIN-Up" (or Super-Up if you prefer) has always been there.
(I did use a mac with a touch bar for a bit. Was that ever a train wreck for me, as you might expect. Fortunately, people don't seem to be copying them and dumping the function keys. I'm actually perfectly happy with them being a reduced-height bar across the top, as most laptops seem to have now. They don't need to be full height.)
In general, I say to anyone who makes a living on a computer... take control of your keyboard! I don't obsess on not using the mouse at all, but the keyboard can do a lot. There's a lot of keys on there, even ignoring the letter keys (which are densely enough "taken" by a lot of other things I don't tend to override them much).
No, you're using the computer wrong. See, you should use a tiling window manager with several workspaces and shortcuts without having to look at your keyboard, e.g. Meta+4 to go to workspace 4 where you have your chat apps.
I've tried tiling WMs several times and they inevitably drive me nuts because on normal computer screen sizes, windows frequently end up awkwardly-sized adding scrolling requirements that wouldn't be present with overlapping windows that are sized to fit the content…
If I were to commit to a tiling WM I think I'd have to replace my main monitor with a 4k TV large enough to run at 1x UI scale without the UI elements being tiny so each window gets the virtual real estate required without effectively making the "tiling" part of the tiling WM moot by maximizing every window.
This probably boils down to the type of programs one uses though… someone living in chromeless text editors and terminals all day will probably fare better with tiling than someone who spends all their time in IDEs, graphics editors, and web browsers.
> each window gets the virtual real estate required without effectively making the "tiling" part of the tiling WM moot by maximizing every window.
The tiling part is just there to making your windows manageable without the mouse and in a predictable way. Out of my 5 preassigned workspaces, 3 are fullscreen windows, 1 is split in 2, and 1 is split in 3 usually.
When I want a new program running big, then I either 1) close and make space in some workspace I'm not using right now, 2) send it to one of the empty "non-preassigned" spaces, or 3) change the current space layout into "all windows fullscreen" temporarily (with the new window on front, obviously).
Or, use tiling window manager, but also have symbolic mnemonics for the apps (not have to remember on which desktop it's on, nor change your muscle memory if you change what desktop it's on).
For example mnemonic "M" for mail/email, so my xmonad.hs has something like:
Anytime I hid modifier+M, it will either go to the desktop and window with the mail program, or start the mail program if it's not yet running.
Personally, my mail program is usually on desktop 1, but some of the other program, like Web browser, I move between desktops as needed for tasks. Hitting modifier+W always gets to it.
Yep. Came to say this. Having say, meta+4 for "chat" is far better than having f4 for "a chat app".
You arrive to your chat workspace, your works slack side by side with your favorite irc and matrix clients, all positioned and scaled perfectly every time. Adding more / fewer / swapping apps in is just a matter of invocation, and there the new configuration sits waiting.
The concept is expanded greatly. Shoutout to i3 and xmonad, for my personal setups.
> See, you should use a tiling window manager with several workspaces and shortcuts without having to look at your keyboard, e.g. Meta+4 to go to workspace 4 where you have your chat apps.
That's basically what I do. A tiling WM and then one modifier key (Super in my case but whatever) and then keys to go to any workspace/virtual desktop I want.
And most of my workspaces are always organized in exactly the same manner, so I know exactly where is what.
Ha, this was my first thought, though I've got a built-in damper on being that annoying guy who brings up tiling WMs in every workspace conversation.
It is a little amusing to see such a dramatic headline supported by the extremely elementary thesis that you should have kbd shortcuts for your favorite applications.
On top of that, numbered shortcuts for arbitrary apps is way worse than using Super+[arbitrary key].
My mind works differently. I need to put together a set of apps I'm using for a task, say, editor + browser + terminal for software development, or DAW + bunch of instruments + browser + player to work with music, or, say, GIMP + Krita + Inkscape for graphics.
Tiling helps, but I just have a bunch of shortcuts that tile a particular window just so under xfwm4.
Is your tiling-manager also automatically focusing a window on that workspace? And are workspaces limited to a single screen, or do all screen simultaneously change state? Because those are the main reasons why I switch to specific apps instead of desktops/workspaces/tags/whatever you call it. Apps are reliable, but desktops seem too heavy and pointless for me.
I've been doing this for >10 years with https://manytricks.com/butler/. Works great! You can also bind snippets of text, scripts, etc.
I can't overstate how important it is to have a keyboard that groups function keys into "islands" of (generally) 4 so you can touch-type them. An ergonomics consultant once observed that the source of my neck pain was that I looked at the keyboard while typing. As a touch-typist, I found this puzzling—until we realized it was just the function keys. :-)
It's superb for toggling pinned programs moment-to-moment, without needing to pay attention to UIs.
On smaller-than-regular keyboards, such as 60% size, function keys already require one extra key held to activate (Fn+<number>, an upside is being closer to reach while on the home row), so they're already both equivalent in keypresses for such users.
I use shortcuts heavily, but Win+number is something I never get used to despite knowing them. They way they work when you have multiple X programs opened (say, editors, explorers..) is kinda weird and I ended up just using alt+tab, which is much easier to press anyway.
Microsoft's PowerToys has a shortcut guide that might help get you over that last hurdle towards using win+number effectively. Might want to give it a look.
It's ok, but unfortunately it doesn't seem to register with "multiples of the same application" open, i.e. if I have Firefox at Win-2 then it's always the first window that was opened (which is fine most of the time) but if I need the other Firefox window then it's alt-tabbing again. No, tabs don't help here, I don't have 50 Firefox windows open, but often a second.
Ha, thanks. Was on Linux when I wrote that so couldn't try it. Also Win+Alt+Number opens a new window of that type. Weird hand twisting aside, this could be useful :)
I think most Linux systems have this too. GNOME definitely, for the applications pinned in the overview, and I would be very surprised if KDE didn't do this too.
Apple is the only one that lacks this. Windows and most linux WM have this for at least 20 years!
windows you just use WIN+[1,2,3,4...] to alternate between your quick launch apps.
Linux obviously you have a myriad of options. Including the top comment here now about using virtual desktops which is even better than application (but you can mix them too!)
And all that while still keeping your Fkeys functionality on each application!
The time I was forced to use a Mac for development was the time my productivity was lowest and frustration highest.
I'm fully convinced that Macs exist only because managers (and wanna be managers) make those decisions. Not to mention i've worked on employeer provided apple, dell, hp, lenovos... macs were the only ones i had to send to IT with failing keyboards, dead screens, etc.
I'm always puzzled by the stubbornness with which Apple refuses to make window management on macOS ergonomic. They think about so many subtler points, they can't fail to notice the elephant in their room. It bothers me every time I have to use macOS.
I wonder who should leave the macOS team to have this finally addressed, like Jony Ive had to leave to make the Macbook hardware reasonable again.
I've mentioned in a previous discussion here that I believe that macOS has the worst UX of all the major OSes. And that belief is mostly because of how horrendous window management is (and Finder but that's a different discussion altogether). The lack of hotkeys for switching workspaces was one of my biggest gripes.
And the culture that has formed around macOS users is to just accept it and buy numerous third apps to fix things that should be a standard feature of the OS.
My greatest annoyance with keyboards is that Fn keys (as found to one side of the left Ctrl/Control key; ubiquitous on laptops and common on other keyboards) are always implemented in firmware, and simply don’t do anything with most of the keys, but implement them in such a way that I can’t either.
My laptop’s keyboard has one Fn key, and 82 others.¹ I can only use Fn with 20 of them—one is legitimately handled in firmware², one does nothing³, two emit combos⁴, and 16 emit distinct key codes. The remaining 62 keys? They just get passed through as though I weren’t holding down the Fn key.
I really wish I could use that Fn key just as a regular additional modifier. I use Super+[hjkl] in my tiling window manager, why can’t I use Fn+[hjkl] instead if I want to?
Yes, I know that shifting it all from firmware to driver would cause inconvenience in some situations. Look, perhaps we could at least begin by adding a key code for Fn when it’s tapped by itself or with any of the 62 keys. I dunno, Hyper or something (is Hyper a thing at that level? or is there some other extra modifier available?). That’s sufficiently pragmatic, right?
—⁂—
¹ Asus Zephyrus G15 (2021), GA503QM. I included the power button as one of the 82 keys, as I use it that way: I have XF86PowerOff switch to a Sway/i3 mode where pressing it again shuts down, r reboots, h hibernates, &c. It’s fun being like most projectors with their “press the power button again to show you actually meant it”. But you know my favourite key on the keyboard? XF86AudioMicMute. Really not looking forward to the inevitable day when I get a laptop without one again.
² Fn+Super disables/enables the Super key. Windows things. Wish I could disable this feature, because just occasionally I accidentally trigger it, and I will never want it.
³ As far as I can tell, Fn+Space just gets swallowed. evtest on the appropriate /dev/input/event* file doesn’t show anything being emitted.
⁴ Fn+F6 = Super+Shift+S, and Fn+F9 = Super+P, because those are standard Windows shortcuts. I don’t get why they did it this way, though they’re both very common, given how much more interesting stuff they’ve done than most others. Mostly I’m just grumbling about duplicates because I already want Super+P to do something else, so now Fn+F9 is a dead weight, though I would otherwise have used it.
If you haven't already gone down the custom keyboard rabbit hole, I suspect you might like it. There's a pretty large enthusiast community out in the world, and there's a lot of ways to go custom - build your own from scratch, use a kit, use a pre-built with flashable firmware, etc.
The firmwares used (e.g. QMK) allow you to build the sort of thing you're talking about into your keyboard and more.
In addition to custom firmware, the other benefit is some custom keyboards have designs which are more coherent than typical keyboards. (e.g. replacing the gigantic spacebar, with more keys so that the thumbs can be more useful).
Can people hit their function keys without looking at the keyboard? Sure, hitting F5 to go to your terminal is less keystrokes than e.g. Cmd+tab+tab, but I can't hit anything in the function row without glancing down at my keyboard. And I put a lot of value in looking at my keyboard as little as possible
You need a keyboard with extra space between groups of 4 function keys. Apple keyboards are horrible in this regard. I hotglued a spacer between groups to help with that.
Why though? I can't consistently hit it without looking, but I can hit it with barely a glance. The cost of looking at the keyboard isn't that high is it?
It's possible to learn to use the function row without looking just like you can learn to use the number row without looking. It just takes getting used to your particular keyboard.
For my Gnomies, the Run-or-raise extension [0] is stellar. It does exactly what it says: you bind a key combo to a launcher command, and optionally define a windowname or wm_class query to check for the existence of the program before it's launched. If it's running it's raised, if it's not then it's run. It has options for the window behaviour after toggling, optionally minimising the programs etc.
I can't rate it highly enough. It helped me finally step away from my decade-long i3wm-adhd addition, where everything else failed.
Yeah I use F2 constantly for rename, not just in explorer but very useful in lots of apps. In Unity (the game engine) it's invaluable. Also F3 is generally "Find next" when you have a search box open. F12 and Shift-F12 do code navigation in VS and F10 and F11 are useful in the debugger. There are lots of nice things you can do with the F keys which this tip spoils.
This is not too different to how I've been using tiling window managers for the last decade.
There 9 or 10 virtual desktops which are accessed with WIN+1-0.
1 is for shells, 2 is the IDE, 3/4 are browsers, 6 is administrative stuff, usually a root shell, 0 is for zoom, 5,7,8 are less defined or just "whatever doesn't fit". In addition I'm using the multi-monitor switching from xmonad in i3 (i.e. if I have [1] on the left and [2] on the right screen, when I activate [1] while on the right one, they switch places, if I activate [3], then it will replace [2] and [1] stays on the left one).
It sounds very pedantic but I don't even have to think when context switching and it's made my life a lot easier. Interestingly it doesn't work as well on my private computer because (to no one's surprise) I am using many more GUI tools and do different things when not working.
I haven't ever noticed a productivity hit from alt-tabbing.
Many of the devs I work with use Spaces and the three-finger slide to move between apps. However this doesn't work if you're not using the trackpad or Magic Mouse.
Additionally, since I'm usually just moving between a few apps (VSCode, terminal, browser, Teams) it's usually pretty easy to just alt-tab or alt-tab-tab with no loss of context.
If macOS didn't added a very annoying fade-out/fade-in delay when switching Spaces, you could simply use them with maximized apps and hotkeys for switching them. Another design mistake from Apple.
Sounds a bit pedantic, but this was the reason I could just not use macOS as a daily driver. IIRC, there was a brief period of time where this anti-feature could be disabled by some obscure command, and the switch was instantly. But this was later gone in an update, which ultimately taught me the lesson that one should not be at the complete mercy of some OS updates.
Is there any way to change the delay for that? I would think that tucked away somewhere under the hood there’s a setting that controls the animation duration.
Being able to turn that down or off would be a boon to my productivity.
"Nearly instant" is a massive loss of usability compared to "instant". The quicker the transition the less disruption there is to your short term memory. If it's instant then switching between virtual desktops is almost as good as having multiple monitors. If I have to wait for even a brief animation (and MacOS's animation is painfully slow) I'm likely to forget details, which means I'll have to switch again, and risk forgetting even more.
You can change the default slide-in/over animation to a faster fade-out/fade-in one by enabling "Apple menu -> System Settings -> Accessibility -> Display -> Reduce Motion", but you cannot disable the animation completely.
Charmstone [1] is a different take from everything mentioned here (I'm the developer).
The idea is to use your spatial memory to switch/launch apps faster than anything else that I've found, with a smaller learning curve and less memorization.
You can use keyboard shortcuts with the arrow keys, modifier keys + cursor movement, or a trackpad gesture.
Neat idea. I just downloaded it. How can I use just the keyboard, e.g. with arrows to select one the apps in the switcher? Using the mouse is a nonstarter for me.
EDIT: oh duh "display with arrow keys". Nice. Going to try this out for a while. It's definitely way faster than cmd + tabbing through my many apps.
Tried it out. I like this idea, but requiring two hands is a deal-breaker for me. I need to be able to switch apps while my hands are over the keyboard without needing mouse/trackpad interaction, ideally staying as close to home row as possible.
Thanks for trying it and for the feedback. Would you use it if you could set the keyboard shortcuts to mod+hjkl or something like that, rather than mod+arrow keys?
I've recently bought an Elgato Stream Deck*[0] (programmable 15-key LED macro-pad) and would strongly recommend it. Simply: define an icon, define a shell script/app/site and press a button to execute.
It natively supports 'profiles' for contextual actions if a given application is active, and 'folders', to extend the actions available given the 15 key limitation.
I believe there's also a SDK + plugin infrastructure which lets you define live-updating icons, but I haven't given this a try.
Love mine. There's an advanced launcher plugin for "run or raise" functionality.
I've got a little script to do the same for web pages, but I have an extended it yet to search for any open tab rather than just the ones that are currently active in the top window. I deal with this by having websites specific launchers.
Another way of doing this is assign Hyper key to Caps Lock with Karabiner and then use that to set up hyper+X shortcuts to different or macros using Hammerspoon.
So e.g. I have hyper+a for Alacritty, hyper+b for Browser etc.
Yep, this was the way I use it too. I had 'qmk' shortcuts but later moved to hammerspoon approach.
Right now trying this set up . Andweeb's 'Ki Spoon' [1] for much efficient workflow. It is still under development
I do the same (though I use spacehammer which is built on top of hammerspoon). It's been the biggest game changing in my keyboard-driven productivity. I don't like how it feels non-deterministic to command-tab since the order of the apps change. With a hotkey for each I know exactly what will show up when I hit the key, and better than using function keys, I don't have to move my hand from home row, plus it works when I use an external keyboard (which is most of the time).
You can also make your Spacebar (with a tiny delay not to interfere with typing) an app-launcher key, and then you don't even need to move your poor pinky for such frequent
space+r for browser
space+f for file manager, etc.
This is what I did in stumpwm. And I had a nice macro so I could define an app's command, what key to map to, what desktop it lives on, and whether jumping to the window or pulling it to me was the default.
I think this workflow is interesting and the title unfortunately clickbait-ish. We can read about things we find interesting without claiming X is better.
No. My function keys are used for things I do more often, like change color profiles, toggle a single app into dark mode, etc.
My favorite trick is not the function keys but other "useless" keys: like Caps is remapped to be Esc (when released before another key is pressed) or Control (when used in conjunction with another key: act as a modifier), my 2 shifts and 2 alt do their normal modifier function (when used in conjunction with another key) but when used by themselves act as PageUp/PageDown Home/End
Going up 2 pages up in the browser? Shift Shift. Top of the page? Alt. Bottom? The other Alt.
For the Control keys, as I don't need that many I've experimented with a few remapping, but BackSpace/Delete are very handy.
Going to the previous page in the browser? Alt+Control.
I’ve tried _so_ many different desktop workflows (including writing two custom window managers!), and I’ve finally settled for the exact same workflow - F
-keys bound to my most common apps, all fullscreened. It becomes muscle memory within two weeks, and it’s faster than anything else I’ve tried by a mile. I use Thor for MacOS if anyone wants to replicate it, it’s a no-fuss version of the author’s setup.
If I ever do need to see two things side-by-side, I’ve also got Rectangle for window positioning. A single cmd+caps lock+H/J/K/L for left-half/restore/maximise/right-half is all I’ve found is necessary.
Karabiner has already been mentioned here but I'll add that goku (https://github.com/yqrashawn/GokuRakuJoudo) is THE way to setup Karabiner and it can be hard to overcome the extremely verbose and unergonomic default json config of Karabiner otherwise. Goku also makes it trivial to add shortcuts which are activated by quickly pressing one key while another is held. I use this for the kind of launch mode described in the OP. eg. w + e = editor (Intellij), w + r = chrome, w + f = firefox.. The drawback to these shortcuts is that they can unintentionally be activated when regularly typing since we don't always release a key before pressing the next. That's only happened seldomly for me though since "w" isn't a frequently used letter and I've set the shortcut activation window pretty low so the w + <key> key has to be pressed essentially immediately after w.
Similarly, I use q + w for previous tab, q + e for next tab, and s+d to open the clipboard history from Alfred
I like my hands resting near the bottom of the keyboard, so Cmd-tab is very quick as it is within reach and does not require using my eyes. To use those function keys I’d have to look at the keyboard, which feels like a waste of time.
Though I’d rather have function keys back instead of the touchbar, as changing volume/brightness now requires looking at the keyboard as well as a certain precision/dexterity.
All the apps I use the most are open most of the time. I can just use cmd+tab to switch between them quickly.
To each their own, but this feels unnecessary to me in my own personal workflow. I've never thought to myself "boy I wish I could open one specific app, that wasn't already open, with a single keystroke"
A better "hack" for linux users: Linux supports a "digital-only" modifier called "Hyper". You can use Xmodmap to set a key as hyper on press, and set Hyper-F[X] to whatever functions you wish to.
Alternatively, use a keyboard with QMK, or install a dedicated application like KMonad.
Don't get me wrong - if it works for you or OP, great! Keep doing it. I use Sway and KDE depending on what tickles my fancy.
For application launching, I just use Alt+Space and type the first few letters of what I want. My frequent flyers get assigned to Meta+Alt+Letter.
- Krunner / Rofi - Alt+Space (Meta+D was a bit contorted for me)
- Meta+Enter - Konsole (KDE) / Kitty (Sway)
- Meta+Shift+<1-0> - move active window to desktop
- Meta+1-0 - switch to desktop #1-#10
A lot of apps use F-keys so it's not a good fit for me. When possible, I like to map custom shortcuts for various applications using F-keys.. not use it as an application launcher.
For example: With Dolphin, I've gotten used to F2 for renaming (Windows holdover), F3 for split file view, F4 for terminal, F5 for refresh
Kate or VS Code, I tend to map F5 to Build/Run/Debug.
He does cover this briefly: "Is it up to an app launcher such as Spotlight or Alfred?"
I'd be curious as to why he finds the F keys faster. Perhaps not having to wait for the bar to appear, not having to "context switch" by thinking about the app's name and not having to type anything.
He talks about how one key is his music software for example, so by simply remembering F6 it skips having to even know what the app's name is and having to potentialy pick the second of third choice of a list. "[alt space] spotif... oh damn, no [backspace] it's itun... wait no I just switched to Tidal... [backspace] So [T] [enter] oops, I just opened the Terminal..."
And I respect that. But, krunner and rofi is instant for me. I guess I don't really switch between apps that much for this context switching to be a problem.
I can't hit Fn keys reliably without looking. Instead I mapped switching to my common programs to `fn+h/j/k/l` and other closeby keys (firefox = fn+h, vscode = fn+j, etc). My right-hand fingers are already on hjkl anyway, it's much much faster for me :)
Proper keyboards group in clusters F1–F4, F5–F8, F9–F12, with gaps between them. Unfortunately, this practice is regularly disregarded (even though uniformity is obviously a terrible idea), and particularly uncommon on laptop keyboards.
I probably still wouldn't be able to hit them accurately, I'm not a great typist :) fn+h/j/k/l isn't mapped to anything, these keys are much more accessible and switching windows is probably the thing I do most, so it seems to make sense to me
Is there a keyboard-oriented window manager that doesn't require memorizing what keys do what?
What I envision is having one master key combination to pull up a panel or overlay of some sort, which displays which key I press next to go to a certain place, or do a certain action. So there's just one thing to memorize.
Sort of like how vimium works in browser, where you press 'f', and each clickable gets a little label. (But preferably not randomly assigned)
The memorizing-most-commonly-used-50-keyboard-combination thing really doesn't work for me, whether it's home row or function keys. I mean, I still have to look at the little pictures for stove knobs after years of using the same stove, and that's just four knobs.
On Mac I just use CMD+space to pull up spotlight which very quickly opens anything matching what you type from there. Usually within a single keystroke after CMD+space pulls up the desired app and typically takes under a second. It does a lot of other neat things as well but I use that feature daily.
Windows is similar in just pressing the windows key allows you to type the name of an app or file but in my experience is much slower and inaccurate compared to OSX.
It's easier for me to remember the name of the app I want than that+the key binding with muscle memory I've then had to set.
i think stumpwm has some kind of "which-key" mode.... which is i think what you are looking for, and of course there is always exwm that can do *anything*
I have a Stream Deck that I set up to change the LCD's based on what the current in focus application is. I also have a button on each of the custom screens that gets me to the "Main Macro" pad.
For MacOS there is Hammerspoon, that provides immensely powerful scripting, but can merely open and close the apps, too.
-- ~/.hammerspoon/init.lua
function define_shortcut(appName, key, mod)
hs.hotkey.bind(mod, key, function()
hs.application.enableSpotlightForNameSearches(true)
local app = hs.application.find(appName)
if app and app:isFrontmost() then
app:hide()
else
hs.application.open(appName)
end
end)
end
define_shortcut("Alacritty", "F1", {})
define_shortcut("Firefox", "F2", {})
Personally I’ve been using a similar approach for over a decade where I have 9 desktops on my Mac most of which have fixed windows on them eg 1 for a file explorer, 2 for mail, 3 for browser, 4 and 5 for IDEs, 6 for related tooling, 7 for notes and maybe another browser window, 8 for music, and 9 for chat windows and I switch between them with Ctrl+<number>. On top of all of them desktops I can Ctrl+Space the terminal (Quake style, Warp now, used to be iTerm) and Alt+Space for Raycast (used to be Alfred). This was I rarely if ever need to Cmd+Tab since everything is fixed in place most of the time.
linux user (kde, cinnamon, etc.). I have been using ctl-f1,ctl-f2, etc to switch between virtual desktops since about 2000. Each virtual desktop is labeled like 'email', 'docs', 'browser', 'editor', 'sql' etc. At each desktop I can alt-tab between a couple of apps, say IDEA and a terminal, or SquirrelSQL and a terminal. So I navigate apps by first selecting the correct desktop and then possibly alt tabbing a little bit. That works well for me and I think probably a lot of users since it's the default behavior after install.
Is it okay to use them for what they are actually useful for? F3 = repeat search, F5 = refresh, etc, etc, all context dependent, of course, but that is a good thing. Mac people I do not understand.
I use Karabiner-Elements and Hammerspoon to map caps lock to a "hyper" key, so browser is hyper+b, text editor is hyper+t, terminal is hyper+s, notes/tasks (Obsidian) is hyper+k, etc.
You can do something similar (albeit less fancy) without using any 3rd party applications on macOS.
1. Open Automator.app and create a Quick action.
2. Drag "Launch Application" to the workflow and choose an application to open. Save it.
3. Open Preferences -> Shortcuts -> Services and assign a keyboard shortcut to your action. Unfortunately, macOS will not let you assign many combinations. The other annoying thing is that running the shortcut is not instantaneous, there seems to be a noticeable delay before the action executes.
You know, the CTRL-Fn combinations are usually mapped to virtual workspaces on Linux, what is much more powerful than applications and give you the same kind of speedup.
Who organizes things around application anyway, instead of windows?
Anyway, no, it's bad to remap the Fn keys. They have been used to fast intra-application navigation since they appeared, and they are still in wide use. (Does the author not use application shortcuts?) Combining them with another key is just obvious.
> Who organizes things around application anyway, instead of windows?
macOS. There's no Alt+Tab, for example: no way to switch between two arbitrary windows on the Z-stack¹. The not-equivalent that exists is ⌘+Tab, and it switches apps; the usability of it, vs. Alt+Tab, is horrendous. (It fronts stuff you don't want, covering up stuff you do want.)
There are workspaces … but I have found them hard to get productive with: macOS will reorder keystrokes around workspace changes. That is, the keyboard input "abc ^→ (workspace change) def" is a race condition: typed quickly (within the animation delay), it becomes as if you typed "abcdef ^→".
I have 14 windows open, currently. That's not hugely unreasonable to display in a window switcher … not to mention that every other OS manages it? I've had more, but I mean, how many more are we even talking?
(And if you have a huge number more open, well, how does exposé function?)
And the window switcher on other OSes usually orders the choices by Z-order, which is essentially in recently-used order. The window you want is often only one or two hits away.
(And, if not, the one in MATE in Linux is also navigable by arrow keys or by mouse, so nothing's too far away.)
How many windows do you have opened? How many things are you doing at the same time?
Is this because you lose configuration if you close them, or because they take too long to open? Because you can't really use so many of them to make switching not viable on a single virtual desktop.
I tend to have a ton of apps/windows open at any given time due to a combination of tasks often requiring a fairly wide array of apps, but also to reduce the friction of context switching to a minimum (even with a lightning fast SSD, closing one set of apps/documents and opening another takes time). So at any given time I probably have apps/windows open for a few different tasks open.
Virtual desktops get heavy usage from me, but (Cmd|Alt)-Tab switching being caged off per-desktop would actually pose a problem, because when I reach for an app with that shortcut I'm not actively thinking about which desktop it's on — I just want to go to it, wherever it happens to be, even if it's been intentionally placed on a particular virtual desktop.
So app-scoped Cmd-Tab works well for me, because the number of entries it has is always reasonable to tap through and it includes entries from all desktops on both screens.
I only mention this because it reminded me of one of my old laptops where Ctrl+Alt+F{1,3,5,7,9} worked, but Ctrl+Alt+F{2,4,6,8,0} didn’t, or the other way round, due to a bad keyboard matrix. That was inconvenient, because I was deliberately using three distinct X sessions at that time (personal, work, and I forget what the third was). For some reason that quite escapes me now, instead of just using every second virtual terminal, I instead added Ctrl+Alt+{1–9} mappings inside i3 to chvt {1–9}. I still occasionally have cause to pull out a second one, though mostly I use workspaces within the one session.
I use my function keys for other things within programs.
I use Alfred on macOS to quickly launch various apps and actions using the launcher hotkey plus a few chars. I don't have a problem with my workflow, and it syncs between my Macs.
I am doing similar with Albert on Linux, with the goal of someday moving back to Linux full-time.
At this point, I have a vast collection of workflows and snippet completions and I feel like my experience is pretty optimized for my tasks, but you do you.
This kind of use case should have been what the Touch Bar supported.
I was actually excited when the Touch Bar came out because I though I would finally be able to just have named buttons, even click-through menus, instead of having to memorize what f1-f12 did on a given app.
Imagine if instead of “ok, f1 opens my [some application], I just need to memorize that” you could just add a button that says [some application]”.
Sadly the support for the Touch Bar was pretty middling to poor.
The function keys are too far away for such frequent operations, so it's much better to map apps to regular alpha keys (some can also have a mnemonic benefit like 'f' for File manager) with a modifier, e.g., CapsLock or even Space (though these would need to be behind a tiny delay not to interfere with typing), with a proper keyboard remapping app like Karabiner
My favorite function key trick is to first move the number keys into a “virtual numpad” and then move the function keys down onto the unused number row. That way the function keys are easy to reach without looking and always available without conflicting with the laptop’s media/utility keys.
This is exactly why I like to use a gaming keyboard with extra programmable function keys off to the left side. All the flexibility without having to override any default functionality that the standard keys might have.
Edit:
Also, dedicated media keys and a volume control wheel/knob are a must!
I use the same concept in Emacs/EXWM to launch/jump/bury X11 and native buffers, + mod.+keys for extras like F5 run notmuch, C-F5 access unread tag directly, M-F5 compose a new message etc.
That's why I damn HATE the disappearance of classic MANY-keys keyboards...
In the discussion of standards, standardisation, and reserving specific keystrokes for specific contexts (applications, OS / windowing system, increasing Web browser (an increasingly inadequate description), etc., we have ... an embarrassment of riches. Or something like that.
The first standardisation within a GUI context I'm aware of was the Common User Access system on IBM PCs. That grew out of the early PC era within which different programs had their own idiosyncratic command-key conventions, several of which are listed in the Wikipedia article on the topic:
This still wasn't the first such standard. IBM already had fairly standardised function-key conventions under MVS and TSO/ISPF. The Unix world inherited emacs functions from ITS (as a set of macros over the TECO editor), vi keybindings, and a number of other conventions. Emacs commands have been incorporated into Readline, and are generally available on bash and similar shells.
There was a revision of CUA under Windows (whose name / initialism I forget), as well as a set of interface guidelines for Apple's classic Macintosh, as well as MacOS / OS X). Within the Linux world, GNOME and KDE offer the HIG, Human Interface Guidelines.
And various X11 window managers offer their own shortcuts and hotkeys (I've long used and extended a set for WindowMaker, for my own use, which incorporate some of the ideas in the submitted article).
There's also the browser environment, in which there are often conflicts: browser-versus-OS (window manager / GUI shell), browser-versus-webapps (e.g., a site's own specific keybindings), and browser-versus-extensions, such as, say, Vimperator, which provides a vi/vim-like keybinding interface to major browsers.
A key problem is that once a standard does emerge, interface conventions change, often profoundly. And independent evolved systems (e.g., Emacs, VIM, CUA, MS Windows, Apple Mac, ...) have a rather stubborn persistence measured in decades. Moving from mainframes to minis to PCs to GUIs and over the past decade to both mobile/touch- and Web-based applications, and arguably voice-based (Siri, Google, Alexa, Cortana, ...) are further confounding standards. Given that the user-base of smartphones / tablets is now roughly 10x that of desktop-based systems, design principles for smartphones seem to be driving desktop conventions, regardless of suitedness to task.
You can use Win+[number on the row key] on Windows to do this, no configuration required. The number corresponds to the position of an app on the taskbar. You can pin apps to the task bar to make sure they are always in the same position.
I remap the useless caps lock to AltGr and then customize the whole keyboard. Mostly for unicode characters, but some shortcuts too—especially those F keys. I'm using Linux and do it with xkb. Can write a blog article if anyone is interested.
I do this using Win+1,2,3,4,etc on Windows and Gnome 3. I believe this has been a feature since Windows 7. It's one of the first features I look for when trying out a new Linux desktop environment since it's so convenient.
Gnome assigns SUPER+NUM to the applications in the sidebar by default. You can change the applications or their order visually and the keyboard shortcut is highly accessible.
It's one of the well thought features that makes me stick with it.
I map the function keys to virtual desktops, but same idea. And CAPLOCK to Alfred to select apps. Super easy on Mac, and difficult to do on Linux, the main reason I don't like Linux desktops.
To each their own.
Another solution to this problem is to get a standalone numpad and assign the keys as hotkeys. Lots of macro apps allow different functions to be assigned to specific keyboards.
Would be nice to have a usb keypad and perhaps a little oled screen in each keycap to implement this… my function keys are pretty overloaded with stuff now.
f1 key in its default 'help' function is so remarkably useless, i just remap it to Enter. and then, remap tilde to to Left and Caps Lock to Right, and you've got a neat little navigation block on the left side of the keyboard.