Skip to content

A window manager written in AutoHotKey. Jump to windows without needing to know where they are.

License

Notifications You must be signed in to change notification settings

grantith/harken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Harken

A window manager written in AutoHotkey v2.

Harken allows a keyboard-centered workflow on Windows: a single super modifier, mnemonic app keys, and fast window actions. Alt+Tab and Win+Tab still work, but you will hardly use them.

Contents

Overview

Note

CapsLock is the default super key, because who needs it?

Features

  • Launch-or-focus your most common programs with the hotkeys you assign in your config file.
  • Focused tile includes border highlight that can be customized, including per app, window class, or window title.
  • Snap tiles to grid and cycle through various positions with subsequent key presses.
  • Freely move tiles with your keyboard.
  • Resize tiles and their edges with your keyboard.
  • Directional focus changes with vim-like motions.
  • Cycle stacked tiles with super + [ and super + ].
  • Cycle focus between tiles of the same program with super + c.
  • Show a hotkey menu with super + /.
  • Virtual desktops (native)
    • Navigate between desktops with better hotkeys
    • Assign custom hotkeys for the index-based virtual desktops.

Launch-or-focus a program with super + [letter], or directionally change window focus with alt + h/l/j/k (left, right, down, up) and alt + [ / alt + ] for back/forward in a stack. Alt text

Cycle centered window widths with super + spacebar. Alt text

Maximizes/restores with super + m. Alt text

Move a window with super + h/j/k/l. Alt text

Freely move a window with double tap super + h/j/k/l Alt text

Resize edges with super + shift + h/j/k/l. Alt text

Show the Command Overlay when the super key is held. Disable through command mode. Alt text

Use the "window switcher" (like powertoys window walker) with super + w. Alt text

Other

  • super + alt sends ctrl + tab (configurable via global_hotkeys)
  • super + c cycle through windows of the same app
  • super + shift + c cycle through windows of the same app on the current desktop
  • super + alt + h/l switch to previous/next virtual desktop
  • super + alt + shift + h/l move the active window to previous/next desktop (follow)
  • super + w open Window Selector (fuzzy find open windows)
  • alt + h/l move window focus left/right
  • alt + j/k move window focus down/up (non-stacked)
  • alt + [ / alt + ] move window focus forward/back through stacked windows
  • super + alt + h/l to move between desktops
  • super + shift + alt + h/l send current tile to adjacent desktop

Enter Command Mode with super + ;.

  • r to reload program/config
  • e to open config file
  • w opens a new window for the active program, if the program supports it
  • n toggles the command overlay on or off
  • i opens the Helper Utility

TODO

  • Clarify and work on areas of state
    • saving layouts
    • per app configs determining where things go (virtual desktop destination is supported now)
  • Possibly rework the config schema. It's hectic.

Configuration

Quick start

  • If not using the binary, make sure to install AutoHotKey 2.1-alpha18 or newer.
  • Start the program and enter command mode with super + ;. The binary is not currently signed and you will be warned by Windows. Clone and use harken.ahk directly as an alternative.
  • The program might fail on first run? Probably something to do with the config. For now you can create the config first to maybe avoid the initial-crash scenario.
  • Press e to open the config file. You can also find it manually in ~/.config/harken/harken.toml as it will be created on first run.
  • After making changes to your config you can reload the config (the entire program, actually) with r while in command mode.

All default keybindings

Window management (Super)

Shortcut Action
super + / Show command overlay (temporary)
super + w Window selector (window walker)
super + c Cycle app windows on current desktop
super + shift + c Cycle app windows across desktops (not working)
super + space Center width cycle
super + m Maximize/un-maximize
super + q Close window
super + Left/Right/Up/Down Resize window and snap to grids
super + shift + h/j/k/l Resize centered
super + ctrl + h/j/k/l Move window
super (double tap) Toggle move mode

Window management (Move mode)

Shortcut Action
h/j/k/l Move window
Esc or super Exit move mode

Focus navigation (Alt)

Shortcut Action
alt + h/l Focus left/right
alt + j/k Focus down/up
alt + [ / alt + ] Cycle stacked (prev/next)

Virtual desktops

Shortcut Action
super + alt + h/l Previous/next desktop
super + alt + shift + h/l Move window to previous/next desktop (follow)
super + alt + <key> Go to mapped desktop ([[virtual_desktop.<N>]])
super + alt + shift + <key> Move window to mapped desktop (follow)

Apps (defaults)

These are examples for the launch-or-focus keybindings.

Shortcut Action
super + e Files (explorer.exe)
super + v Editor (Code.exe)
super + s Terminal (WindowsTerminal.exe)
super + n Notes (notepad++.exe)

Command mode

Shortcut Action
super + ; Enter command mode
r Reload program/config
e Open config file
w Open a new window for the active app
n Toggle command overlay
i Open window inspector
Esc Exit command mode

Helper Utility

  • tools/window_inspector.ahk lists active window titles, exe names, classes, and PIDs.
  • Use it to identify values for apps[].win_title in your config.
  • In Command Mode, press i to launch the window inspector.
  • Use Refresh to update the list; Copy Selected/All or Export to save results.

Limitations

  • This has not been tested with multi-monitor setups or much outside of ultra-wide monitors.
  • Virtual desktop integration requires AutoHotkey v2.1-alpha-18 or later.
  • Some apps (e.g., Discord) launch via Update.exe and keep versioned subfolders, which makes auto-resolution unreliable for launching or focusing more challenging.
  • For some apps that minimize or close to the system tray, it's recommended you disable that in the program. Otherwise you can try to set apps[].run to a stable full path (or use run_paths) in your config.
  • Windows with elevated permissions may ignore Harken hotkeys unless Harken is run as Administrator.

Third-Party

Similar tools and inspirations

For this project I was primarily inspired by what I was able to accomplish with Raycast on macOS. Between Karabiner, Raycast, and HammerSpoon one could achieve all of Harken and more on macOS. I needed to move back to windows for work, and I wanted a way to use the same flow on Windows that I had become accustomed to on macOS.

Other macOS tools that I tried for more than five minutes were AeroSpace and Loop.

The foundation of Harken was built upon this reddit post, shared by u/CrashKZ -- Thanks to /u/plankoe for their initial contributions, too.

FancyZones is okay, but it doesn't remove the need to know where things are in order to focus on them, and its features are insufficient for a truly keyboard-centered workflow.

I really like komorebi--though I didn't use it for long and I have never been able to stick with tiling in the long run--but for those who prefer the tiling approach this might be the best option on Windows.

GlazeWM is another popular tiling window manager for Windows operating systems.

About

A window manager written in AutoHotKey. Jump to windows without needing to know where they are.

Topics

Resources

License

Stars

Watchers

Forks