Giter Club home page Giter Club logo

twm's Introduction

twm — Directional focus switcher for Windows  

You've perfectly arranged your windows. Code in the middle, terminal to the left, browser to the right. You're flying through your task, deep in the zone. But then it happens: you press alt-tab and it focuses the wrong window. No matter, alt-shift-tab, alt-tab-tab. Dammit, wrong window again. Why is this so hard!?

No more! With twm, you can move focus by pressing direction keys. Duh! alt-right to move focus to the right. alt-left to go to the left. Impossible to get wrong. Vim shortcuts? alt-h/j/k/l also work.

You can also swap adjacent windows with alt-shift-<dir key>.

Installation

Download the twm installer (.msi) or portable executable (.exe) from the releases page. The installer makes twm autostart with Windows (can be disabled in in the system tray later) and adds it to PATH.

Configuration

twm can be configured by a TOML file that must be placed at %APPDATA%\twm\twm.toml. You can also use another path by setting the TWM_CONFIG_PATH environment variable.

If the config file does not exist, twm uses the (self-explanatory) default config:

disable_drop_shadows = false
disable_rounded_corners = false
draw_focus_border = false

[hotkeys]
alt-left = "focus window left"
alt-down = "focus window down"
alt-up = "focus window up"
alt-right = "focus window right"

alt-shift-left = "swap window left"
alt-shift-down = "swap window down"
alt-shift-up = "swap window up"
alt-shift-right = "swap window right"

alt-h = "focus window left"
alt-j = "focus window down"
alt-k = "focus window up"
alt-l = "focus window right"

alt-shift-h = "swap window left"
alt-shift-j = "swap window down"
alt-shift-k = "swap window up"
alt-shift-l = "swap window right"

alt-1 = "focus desktop left"
alt-2 = "focus desktop right"

alt-shift-q = "close window"
ctrl-alt-shift-q = "terminate window"

alt-shift-r = "reload"

Styling

twm can add styling to make navigation easier. Simply enable any of the following config values:

disable_drop_shadows = true
disable_rounded_corners = true
draw_focus_border = true

# RRGGBB border colors
focused_border_color = "#999999" # light gray
unfocused_border_color = "#333333" # dark gray

Tiling window manager

Maybe you guessed that twm stands for tiling window manager... and that would be correct! I would like to add BSP-tree (binary space partitioning) tiling in the future. Until then, I recommend using FancyZones (part of PowerToys) to tile your windows.

Alternatively, check out komorebi, an almost fully fledged tiling window manager for Windows. (I say "almost" because there is no tree-based tiling like you might be used to from i3 or yabai.)

Building twm

All that is required for building twm is CMake and Visual Studio 2022 or newer. Once both are installed, clone this repository and all its submodules using the following command:

> git clone --recursive https://github.com/Tom94/twm

Then, use CMake as follows:

> cmake . -B build
> cmake --build build --config Release -j

Afterwards, you can either run twm.exe or you can create an installer with

> cpack --config build/CPackConfig.cmake

License

GPL 3.0

twm's People

Contributors

tom94 avatar

Stargazers

Shailesh Mishra avatar Josh Kerekes avatar MightyIT avatar Manuel Köster | shadesoforange avatar Yunsheng Luo avatar Zhen Xu avatar David Bauer avatar Jeff Carpenter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.