Your first and last points can be trivially achieved by mapping those keys via xmodmap - for instance:
! keycodes of your right and left alt keys
keycode 108 = Mode_switch
keycode 64 = Mode_switch
! remap the i key to emit Up when pressing Alt+i
keysym i = i I Up Up
You can use the 'xev' utility to quickly find out the keycodes of keys on your system (just hover the window, press your button, and read the keycode). But all that is only necessary if your desktop environment doesn't ship with key mapping functionality already.If you're on wayland instead of Xorg, then you'll have to use xkb to set this up.
There's also a bunch of AutoHotkey-like tools, but they're probably not necessary for something as simple as you're describing. The first that come to mind are AutoKey, SikuliX and IronAHK (a cross-platform rewrite of AutoHotkey, but I think it's discontinued).
Most desktop environments ship with functionality to (at least) run a command when you press a certain key. Others, like AwesomeWM, are way more powerful.
My AHK stuff is a bit more complicated - my scripts total about 5000 LOC, but a lot of that is inflated cause it also doubles as a window manager. It does a bunch of other minor stuff, e.g. Alt-IJKL also combos with Shift for selection and Ctrl for word skipping, but I'm sure xmodmap and other tools you mentioned can handle that.
Alt-IJKL, when remapped at a low level like that, should behave exactly like arrow keys and combo with Ctrl/Shift like you would expect. You don't have to do anything extra.
Now, whether it's worth it to you, who has already learned autohotkey's syntax, to move to Linux, I can't say. Linux is a game of differently confusing config files from Windows and sometimes it's about the devil you know vs the one you don't.
Where Linux suffers is support for many big commercial applications (MS Office for obvious reasons, Adobe software, etc.) and hardware support (which can be hit and miss, depending on your luck).
But if you're thinking: "how could I automate whatever desktop action operation?" Linux for sure can do it. I have no idea right now how you'd it, but I'd be shocked if it couldn't. There's sooo much configurability.
- AHK is kinda tough to replace on Linux, since you're kinda stealing the display manager's job. Since there are now two display managers in use (the older x11 and newer Wayland), you'd need to find a solution that works for you. It seems to be pretty easy on x11 though[0], and if Wayland doesn't offer similar functionality I'll be quite surprised.
- Taskbar manipulation is handled by your window manager, and you can typically get pretty granular with it. I don't have the exact same setup as you, but I do have a second taskbar on my second display specifically for Spotify/IRC.
- AFAIK, Linux was the progenitor of the extended function row :)
In conclusion, your sticking points are probably going to continue to be sticking points for the foreseeable future. I hope that doesn't discourage you from enjoying Linux though, even through WSL.
[0] https://wiki.archlinux.org/title/X_keyboard_extension#Caps_h...
Now I just need to learn Vim :D
I'm currently looking for a new mouse and trackball that I would use with AutoHotKey (yeah I'm windows fangirl - what can I say, it's just way more productive than Linux)
I read good things here about the Logitech MX Anywhere S2 so I'm thinking about getting one.
The more buttons, the merrier!
The thumb buttons do stuff like CtrlW/AltF4 (depending on the program), toggle between maximize/restore, minimize, media play/pause, and summon media player. Pretty basic stuff:
#IfWinActive ahk_exe chrome.exe
F14::
WinGet MX, MinMax, A
If MX
WinRestore A
Else WinMaximize A
Return
F13::SendInput ^+t
F15::WinMinimize,A
F16::SendInput ^+{Tab}
F17::SendInput ^{Tab}
F18::SendInput !{Right}
F19::SendInput !{Left}
F20::SendInput ^w
F21::Media_Play_Pause
Oh, and one of my more favorite AHK things: RButton & WheelUp::Send {Volume_Up 1}
RButton & WheelDown::Send {Volume_Down 1}
RButton & F17:: Send {Volume_Mute} ;; aka right click + mousetilt = muteIf you add the qualifier "than you", yes, it's not a very risky prediction given the difference between genders in the hand size distribution and the demographics of HN users: https://geogebraintheclassroom.blogspot.com/2015/11/introduc...
Objectively, I usually get glove size 6 to 6.5, but I do consider my hand quite big. I guess I could plug the numbers from http://www.fownesbrothers.com/press/2016/5/10/glove-size-doe... in the distribution above to compute my percentile and see if my perception is accurate.
All this to say, I'll have to be careful to adjust the recommendation by size, as mouse (or trackball) size is an important factor in comfort, and my perception may not be accurate.
> Oh, and one of my more favorite AHK things:
Chording!!! Yes!!! Extending the idea to mouse keys is very inspiring!!
FWIW, like many people I have Caps and Enter using that: Caps and Enter are respectively Esc and Enter when used alone, or Left and Right control when used with other keys.
But wait, it goes further:
- my Shift keys behave as Page Up and Page Down when used alone,
- my Alt keys behave as Home and End when used alone,
- my Control keys behave as Insert and Delete when used alone
In practice, this puts the edit keys very close to my fingers, even on laptop-style keyboards.
I don't always use these alternatives, but I've noticed a tendency for modern keyboard to remove these edit keys, so I want to have a solution ready for when I can't find good keyboards anymore.
> I've noticed a tendency for modern keyboard to remove these edit keys...
The teeny tiny arrow keys on modern laptops is actually part of the reason why I have Caps+IJKL be arrow keys. I have a lot of opinions/feelings about arrow keys. (Why are the most commonly used keys so small??? /rage)
For me Caps + H and semicolon are home/end, Y/P are PgUp/Down, U/O are 4lefts/4rights, and 8/, are 4ups/4downs. The 4's are surprisingly useful, especially when navigating. Home and End combo with Ctrl to yield beginning/end of document, which is also nice. (so like Ctrl+Caps+H = beginning). Everything combos with Ctrl and Shift for wordskipping/selection which is really nice.
I haven't tried making modifiers do different things when used alone - that's a neat idea.
My prediction wasn't very risky given the demographics of HN :)
> The teeny tiny arrow keys on modern laptops is actually part of the reason why I have Caps+IJKL be arrow keys.
I'm currently back to Lenovo, mostly for the wonderful keyboards that still have decent sized arrow keys and Page Up / Page Down nearby on both side of the up arrow, so I don't feel this need, but the modern trend of teeny up/down next tothe HUGE left/right is concerning.
I might end up doing like just you. In fact, I might start adding shortcuts right now.
I'm thinking of doing a mapping with Alt, as my Caps key is chorded as Control, and I can't imagine doing without Ctrl-K or Ctrl-L, but. Did you have any specific reason to go with IJKL instead of WASD?
> Everything combos with Ctrl and Shift for wordskipping/selection which is really nice.
It's wonderful to meet fellow minded people :)
My AHK scripts work the same: to go to the beginning of a webpage, I press and hold right Alt, then press on left Alt to send a Home. To to go the end, I use the same keys, but in the opposite order!
It quickly gets into muscle memory!
> I haven't tried making modifiers do different things when used alone - that's a neat idea.
Here's my current implementation which still leaves much to be desired but mostly perform acceptably. Try it for yourself and see if you like it! I've found using less chording whenever possible made sense, and I find myself often scrolling down page by using the Shift key instead of space, as it's just more conveniently placed as a big button right where my thumb rests while holding my laptop
~LShift::
KeyWait, LShift
If (A_TimeSinceThisHotkey < 300 and A_PriorKey = "LShift") {
if (GetKeyState("RAlt", "P") || ( GetKeyState("LAlt", "P") && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {
SendInput !{PgUp}
} else {
SendInput,{PgUp}
}
}
return~RShift::
if (GetKeyState("RAlt", "P") || ( GetKeyState("LAlt", "P") && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {
SendInput !{PgDn}
} else {
SendInput {PgDn}
}
}
return*LAlt::
KeyWait, LAlt
If (A_TimeSinceThisHotkey < 300 and A_PriorKey = "LAlt") {
if (GetKeyState("LShift", "P") || ( GetKeyState("RShift", "P") && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {
SendInput +{Home}
} else {
SendInput {Home}
}
}
return*RAlt::
KeyWait, RAlt
If (A_TimeSinceThisHotkey < 300 and A_PriorKey = "RAlt") {
if (GetKeyState("RShift", "P") || ( GetKeyState("LShift", "P") && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {
SendInput +{End}
} else {
SendInput {End}
}
}
returnReplace CapsLock and Enter by your own chording keys if needed, to allow composition.
If you end up improving on that, please send me your improved AHK script! My email is my username at outlook dot com.
My own scripts are hardly prettier. AHK is not a great language, and I've put very little effort into learning its syntax. Here's my implementation Alt IJKL & friends: https://pastebin.com/F0xgWHH9 Same invitation to you. If you find a way to improve it, email me at my HN handle at gmail :D Note that it has explicit stuff to work with the AltTab window.
I daily drive a Thinkpad X1, but honestly these days Alt+IJKL is so ingrained into my muscle memory that I make grumbly noises when I try to use them on another coworker's machine and fail. Well at least I used to precovid.
> Did you have any specific reason to go with IJKL instead of WASD?
Ergonomics, primarily. I didn't want to twist the fingers of my left hand to try to hit Ctrl/Shift/Alt WASD while my right hand is sitting snickering. Oh. And I just realized I could have used the right alt + WASD. I went with LeftAlt because Caps is also on the left. You can certainly choose to go with RightAlt, though I would encourage you to try ESDF so you get to leave your fingers on the homerow. Also means you have a bit more room for QAZ if you wanna do anything fancy with them.
I suppose I could try and make RightAlt+ESDF mouse movement... but TrackPoint. Might be useful for when I'm at the desktop though. Anyway, being able to left click from the keyboard is surprisingly useful. (CtrlCaps for me.) Often times my mouse is exactly where I want it to be. Happens multiple times a day.
> To to go the end, I use the same keys, but in the opposite order!
That is fantastic.
I also have I think 6 g700s'!!
My favorite was the old Logitech MX with the autoswitching hyperscroll. But I couldn't live without hyperscroll at all anymore.
AHK is also super useful but I've only done a couple of things so far.
idk if they actually work with QMK, but they use the same configurator as their custom keyboard for desktops, which can run QMK
The Plasma desktop environment lets you modify window behavior on a per-application or per-window basis OOTB, including having them skip the taskbar.
* AutoHotKey. Alt/Capslock + IJKL is a universal way to get arrowkeys - e.g. it works in Chrome/a note taking app/Terminal. I'm not against getting a QMK keyboard, but I'm not aware of any laptop keyboards which support QMK. Switching between the two will get real annoying real fast.
* 7+ Taskbar Tweaker. My taskbar hides window names for programs like Spotify/Outlook/Slack (programs which usually have 1 window), but shows window names for programs like Chrome/Terminal/VSCode (programs which usually have multiple windows).
* Logitech software. My mouse has buttons hooked up to F13-F20 (yeah, there's more past F12), which AutoHotKey listens for and does specific stuff depending on what program is currently in focus.
The above are relatively important for my computing happiness, and I'm not entirely sure what I'll gain from moving to Linux.
If you can can address any of these points, please LMK! My reasons not to move to Linux have been growing fewer and fewer, but I've yet to find reasons to move to Linux.
Edit: Actually now that I think about this... I can just setup the mouse on a Windows box and it should just keep sending F13 etc. to a Linux box. So now I only have 2 reasons keeping me on Windows: AutoHotKey and an easily customizable Taskbar. The latter reason will also likely prevent me from upgrading to Win11.