7 Best Window Managers for Windows in 2023 (Free & Paid)
By Alex • Updated Sep 16, 2023
Best for: Overall | Windows | Mac
In the digital age, managing computer windows efficiently is crucial for productivity. Window managers are great tools that help you organize, resize, and reposition windows effortlessly. This guide explores the top 7 window managers for Windows in 2023, both free and paid, to enhance your efficiency.
Best Window Management Apps for Windows
- Windows Snap
- AquaSnap
- MaxTo
- PowerToys FancyZones
- SmartWindows
- Divvy
- FancyWM
What Makes a Great Window Management App?
Before we delve into the list, let’s look at what makes a great window management app. The application should be user-friendly, intuitive, and highly customizable. It should offer features like window snapping, tiling, and docking. The ability to create custom keyboard shortcuts for faster navigation is also a significant plus. Furthermore, it should be lightweight, not consuming too much of your CPU or memory. Lastly, the app should be compatible with the latest Windows versions and support multi-monitor setups.
Now, let’s jump into our list of the 7 best window managers for Windows in 2023.
1. Windows Snap
Windows Snap is a built-in feature in Windows 10 and 11 that allows you to quickly organize your windows by snapping them to the sides or corners of your screen.
Key Features:
- Snap windows side-by-side or into the four corners of your screen.
- Drag and drop windows to resize and reposition them.
- Keyboard shortcuts for quick window movement and resizing.
Our Take:
While Windows Snap may not offer as many features as some third-party tools, its seamless integration with the Windows operating system and the fact that it comes pre-installed make it a convenient and useful tool for basic window management.
2. AquaSnap
AquaSnap is a versatile window manager that goes beyond the standard features offered by the built-in Windows Snap.
Key Features:
- Snap windows side-by-side, in quarters, or create complex layouts with hotkeys.
- Window tiling and docking with keyboard shortcuts.
- Window stretching and snapping for precise control over window sizes.
- Group multiple floating windows and move them together.
Our Take:
AquaSnap is a powerful tool that provides highly customizable window management. With its ability to create complex layouts and manage multiple floating windows, it’s perfect for power users who need advanced control over their workspace.
3. MaxTo
MaxTo is a highly efficient window manager that allows you to divide your screen into exact portions, maximizing your workspace.
Key Features:
- User-defined grid system for precise window positioning.
- Customize keyboard shortcuts for almost all actions.
- Virtual desktop support for Windows 10 users.
- Recipe feature to launch and place multiple programs at once.
Our Take:
MaxTo is an excellent choice for those seeking a balanced combination of power and simplicity. Its user-defined grid system and recipe feature are unique selling points that make it stand out.
4. PowerToys FancyZones
Created by Microsoft, PowerToys FancyZones is a powerful window manager designed to make multitasking easier and more efficient.
Key Features:
- Create custom layouts for your windows.
- Snap windows into defined zones using drag-and-drop or hotkeys.
- Multi-monitor support for enhanced productivity.
- Zone templates for quick setup.
Our Take:
Being a Microsoft product, PowerToys FancyZones integrates seamlessly with Windows. It’s a fantastic tool for those who frequently multitask and need to manage their workspace efficiently.
5. SmartWindows
SmartWindows is a versatile window manager that aims to save users’ time by restoring their display settings and application positions with a single click.
Key Features:
- Restore display settings and application positions.
- Create unlimited profiles for work, play, and study.
- Support for multiple users on a single PC.
- Multi-browser and Microsoft Office file support.
Our Take:
SmartWindows is an excellent choice for those who frequently switch between different workspaces. Its ability to restore display settings and application positions can save a lot of time and effort.
6. Divvy
Divvy is a window management solution that gives users control over their desktop layout using a simple and intuitive interface.
Key Features:
- Grid system to easily organize windows.
- User-customizable keyboard shortcuts.
- Drag-and-drop functionality for resizing windows.
- Multi-monitor support.
Our Take:
Divvy is a great tool for those who value simplicity and ease of use. It may not have as many features as some other options, but its intuitive interface makes it easy to manage windows efficiently.
7. FancyWM
FancyWM is a dynamic tiling window manager designed specifically for Windows 10 and 11 to optimize the user’s workflow.
Key Features:
- Create dynamic tiling layouts with mouse or keyboard.
- Move window focus with keyboard.
- Swap windows with keyboard.
Our Take:
FancyWM is a superb choice for those seeking a dynamic tiling window manager. It requires a bit of a learning curve, but once mastered, it can significantly boost productivity.
Frequently Asked Questions
What is a window manager?
A window manager is a software application that controls the arrangement of open windows on your computer screen. It helps in resizing, moving, and managing multiple windows efficiently.
Why do I need a window manager?
If you frequently work with multiple windows open, a window manager can significantly improve your productivity. It allows you to precisely control the positioning and size of your windows, making multitasking easier and more efficient.
Does Windows have a built-in window manager?
Yes, Windows has a built-in feature called Snap which allows you to organize your windows by snapping them to the sides or corners of your screen. However, it is relatively basic, and you might need a more powerful third-party tool for advanced window management.
Can I use a different window manager with each virtual desktop on Windows 10?
Some window managers like MaxTo and PowerToys FancyZones support virtual desktops on Windows 10, allowing you to have different window layouts on each virtual desktop.
Conclusion
In conclusion, window managers can be a game-changer for your productivity, especially if you regularly work with multiple windows open. Whether you’re looking for a simple tool like Windows Snap or a more advanced solution like AquaSnap or MaxTo, there’s a window manager out there that’s just right for your needs. So why wait? Start improving your efficiency with one of these fantastic window managers today!
All Window Management Apps for Windows
Table of Content
Understanding Tiling Window Managers
A tiling window manager (WM) is a type of window manager that organizes open windows in a non-overlapping manner on the screen. Instead of traditional overlapping windows, tiling window managers place windows side by side, stacked, or in a grid, automatically adjusting the layout as new windows are opened or closed.
These tools are highly keyboard-focused, allowing users to manage windows efficiently without relying on a mouse, making them ideal for power users and developers who value productivity and workflow efficiency.
History and Importance
Tiling window managers have been around since the early days of graphical user interfaces. They emerged as a response to the need for more efficient window management, particularly for users who work with multiple applications simultaneously.
The emphasis on keyboard shortcuts and automation reduces the time spent resizing and moving windows, allowing users to focus on their tasks.
In modern computing, tiling window managers are especially important for managing multi-monitor setups. As more professionals work with several screens, the ability to quickly and efficiently organize applications across multiple displays becomes crucial.
Tiling window managers streamline this process by automatically arranging windows in a logical manner, reducing clutter and maximizing the use of screen real estate.
Examples of Tiling Window Managers
1- Linux
- i3: A popular and flexible tiling window manager known for its simplicity and extensive configurability.
- Xmonad: A highly customizable tiling window manager written in Haskell, favored by users who prefer to script their configurations.
- Awesome: A dynamic tiling window manager that allows users to define custom layouts and has a strong community of contributors.
2- macOS
- Amethyst: A tiling window manager for macOS that offers automatic window arrangement and easy customization via a simple configuration file.
- Yabai: A powerful tiling window manager for macOS, focusing on providing extensive control over window layout and behavior.
- Phoenix: While not a tiling manager by default, it allows extensive scripting to achieve tiling-like behavior on macOS.
10 Open Source Tiling Window Managers for macOS
What is a Tiling Window Manager? A tiling window manager is a desktop environment that organizes windows in a non-overlapping layout. Rather than allowing windows to be manually resized and positioned, a tiling window manager automatically arranges them in a logical, space-efficient manner. Tiling window managers are often favored by
MEDevel.com: Open-source for Healthcare, and EducationHazem Abbas
Importance in Managing Multi-Monitor Setups
In the context of Windows, tiling window managers are increasingly important for users who work with multi-monitor setups. Managing multiple screens can quickly become cumbersome with traditional window management, as windows need to be manually moved and resized across different displays.
Tiling window managers address this challenge by allowing users to automatically organize windows across all connected monitors, ensuring that screen space is used efficiently and that workflows remain smooth.
For developers, designers, and professionals who rely on having multiple applications open simultaneously—such as code editors, terminals, and browsers—tiling window managers provide a significant boost in productivity.
They eliminate the need for constant adjustments and help maintain an organized workspace, which is essential for staying focused and efficient in a multi-monitor environment.
Tiling window managers on Windows, though less common than on Linux, are growing in popularity as more users recognize the benefits of a keyboard-focused, automated approach to window management.
Whether it’s for coding, design, or general productivity, these tools offer a way to harness the full potential of modern multi-monitor setups.
In the following list, we collected the best active open-source free tools that works as tiling window manager for Windows systems.
1. Komorebi
Komorebi is a tiling window manager for Windows that enhances desktop productivity by providing dynamic tiling, keybindings, and multi-monitor support. It focuses on offering a seamless and efficient window management experience for users who need better control over their workspace.
Features:
- Dynamic Tiling: Automatically arranges windows in a non-overlapping layout.
- Customizable Keybindings: Allows users to define and use keyboard shortcuts for efficient window management.
- Multi-Monitor Support: Manages windows across multiple monitors, ensuring optimal use of screen space.
- Configurable Layouts: Users can customize window layouts to fit their workflow.
- Resource Efficient: Designed to be lightweight, ensuring smooth performance without significant system impact.
GitHub — LGUG2Z/komorebi: A tiling window manager for Windows 🍉
A tiling window manager for Windows 🍉. Contribute to LGUG2Z/komorebi development by creating an account on GitHub.
GitHubLGUG2Z
2. workspacer
workspacer is a free tiling window manager for Windows 10+, similar in style and function to common unix tiling window managers (dwm, i3, xmonad).
GitHub — workspacer/workspacer: a tiling window manager for Windows
a tiling window manager for Windows. Contribute to workspacer/workspacer development by creating an account on GitHub.
GitHubworkspacer
3. GlazeWM
GlazeWM lets you easily organize windows and adjust their layout on the fly by using keyboard-driven commands.
Features
- Simple YAML configuration
- Multi-monitor support
- Customizable rules for specific windows
- Easy one-click installation
- Integration with Zebar as a status bar
GitHub — glzr-io/glazewm: GlazeWM is a tiling window manager for Windows inspired by i3wm.
GlazeWM is a tiling window manager for Windows inspired by i3wm. — glzr-io/glazewm
GitHubglzr-io
4. FancyWM
FancyWM is a tiling window manager for Windows that enhances productivity by automatically organizing windows into a non-overlapping layout. It offers customizable layouts and efficient keyboard controls, making it easier to manage multiple windows and workspaces.
Features:
- Automatic Tiling: Organizes windows without overlap.
- Custom Layouts: Allows users to define their preferred window arrangements.
- Keyboard Control: Enables efficient window management through shortcuts.
- Multi-Monitor Support: Handles windows across multiple screens.
- Lightweight: Minimal resource usage for smooth operation.
GitHub — FancyWM/fancywm: FancyWM — Dynamic Tiling Window Manager for Windows
FancyWM — Dynamic Tiling Window Manager for Windows — FancyWM/fancywm
GitHubFancyWM
5. bug.n
Bug.n is a tiling window manager extension for Windows that brings efficient window management features typically found on Linux to the Windows environment. It integrates seamlessly with Windows, providing users with the ability to tile windows across their desktop, enhancing productivity by organizing open applications more effectively.
Bug.n provides Windows users with a powerful tool to enhance their productivity by bringing the benefits of tiling window management to the Windows desktop, making it easier to manage multiple applications and monitor setups.
bug.n is a tiling window manager add-on for the Explorer shell of Microsoft Windows. It is written in the scripting language AutoHotkey.
Features:
- Tiling Window Management: Automatically arranges open windows in a non-overlapping layout.
- Multi-Monitor Support: Manages windows across multiple monitors for a more efficient workflow.
- Keyboard-Focused Operation: Allows extensive control over window management via keyboard shortcuts.
- Customizable Layouts: Offers various tiling layouts that can be customized to suit different user needs.
- Lightweight: Minimal impact on system resources, ensuring smooth performance.
GitHub — fuhsjr00/bug.n: Tiling Window Manager for Windows
Tiling Window Manager for Windows. Contribute to fuhsjr00/bug.n development by creating an account on GitHub.
GitHubfuhsjr00
6. Miguru
Miguru is an automatically tiling window manager for Windows 10, inspired by Amethyst/ xmonad.
GitHub — imawizard/MiguruWM: A tiling window manager for Windows
A tiling window manager for Windows. Contribute to imawizard/MiguruWM development by creating an account on GitHub.
GitHubimawizard
7. Nog
Nog is a free and open-source tiling window manager for Windows.
GitHub — TimUntersberger/nog: A tiling window manager for Windows
A tiling window manager for Windows. Contribute to TimUntersberger/nog development by creating an account on GitHub.
GitHubTimUntersberger
8. grout
group is a free and open-source simple tiling window manager for Windows, written in Rust. Inspired by Budgie’s Window Shuffler grid functionality.
GitHub — tarkah/grout: Simple tiling window manager for Windows
Simple tiling window manager for Windows. Contribute to tarkah/grout development by creating an account on GitHub.
GitHubtarkah
9. WinWM
WinWM is a free and open-source tiling window manager inspired by i3wm.
Features
- Multi monitor support
- LuaJit Scripting
- Uses virtual desktops instead of just moving around windows
- Fast seamless performance
GitHub — McYoloSwagHam/win3wm: A Tiling Window Manager for windows 10, Inspired by i3wm
A Tiling Window Manager for windows 10, Inspired by i3wm — McYoloSwagHam/win3wm
GitHubMcYoloSwagHam
10. JigsawWM
JigsawWM is a free and open-source project that aims to increase your productivity by offering a set of automation facilities, including the jmk module as an AHK alternative, a Tiling Window Manager to free you from managing windows manually and the Daemon to support any customization you may have in mind.
GitHub — klesh/JigsawWM: JigsawWM is a dynamic window manager for Windows10/11 just like the suckless dwm for the X
JigsawWM is a dynamic window manager for Windows10/11 just like the suckless dwm for the X — klesh/JigsawWM
GitHubklesh
Здравствуйте, читатели ХабраХабр.
Недавно я начал самостоятельно изучать программирование, и с тех пор во время учебного процесса (ну или процесса примитивной разработки) регулярно сталкиваюсь со следующими проблемами:
—
лень учиться
— затраты времени и «сил» на организацию окон, с которыми работаешь в данный момент
— присутствие лишних окон, с которыми или в данный момент, или вообще не работаешь (например, консоль запущенного сервера)
— физический недостаток пространства для размещения всех окон, при котором будет удобно работать
Если в Google ввести запрос «менеджер окон Mac», выдается множество результатов утилит — менеджеров окон, обзоры и отзывы. А вот для Windows — полная тишина.
На любимом сервисе Toster мне подсказали несколько утилит, существенно облегчающих организацию рабочего пространства, которыми я теперь пользуюсь сам и хочу поделиться с другими.
Чтобы не тратить время тех, кто о них знает, сразу перечислю: AquaSnap, DIVVY и BetterDesktopTool.
Сам же постараюсь кратко описать их наиболее полезные функции.
AquaSnap
Коронной функцией этой программы считаю
синхронное изменение
размера окон. Странно, что фирме Microsoft в своем популярнейшем ПО с названием «Окна» (Windows) не пришла в голову идея реализовать это.
Также существенным удобством является возможность переместить окно в одну из четвертей (или двух половин) рабочего стола, потянув за его заголовок, или назначить на это горячие клавиши
Лучший способ
влюбиться
оценить все возможности программы можно, посмотрев полное демонстрационное видео.
Небольшое отступление или «камень в огород LG»
В данный момент фирма LG активно рекламирует и пытается внедрить в новых моделях мониторов ту самую функцию синхронного изменения окон, но программное обеспечение работает исключительно криво, а резкие и краткие ответы операторов Call-центра создают впечатление, что маркетологи сработали хорошо, а вот разработчики «немного не успели» реализовать обещанное. Все вышесказанное проверенно и подтверждено покупкой (и последующим возвратом в магазин) монитора LG с заявленной функцией.
DIVVY
Из-за того, что AquaSnap выполняет весь необходимый функционал, я несколько раз устанавливал, а после удалял DIVVY.
Причиной тому является дополнительная неплохая (но мне не очень нужная) функция, позволяющая размещать окно в определенном месте, просто выделив это место на сетке, представляющей схему рабочего стола.
На этот раз на горячие клавиши можно назначить расположение окон не только в одну из четвертей экрана, а в любую, заранее заданную область.
Полное демонстрационное видео
BetterDesktopTool
Во время просмотра презентации новой ОС от Apple я заметил отличный функционал под названием Mission Control, позволяющий отобразить на экране все открытые окна, что визуально облегчает выбор нужного при их большом количестве. Именно это выполняет указанная программа.
Приятным бонусом является возможность создавать виртуальные столы и взаимодействовать с ними с помощью горячих клавиш. Например, я на виртуальный стол всегда «отправляю» ненужные окна (например, консоль запущенного сервера).
Полное демонстрационное видео
Второй монитор
Я очень надеюсь, что однажды стану достойным программистом, но уже сейчас, на стадии обучения, испытываю потребность в увеличении рабочего пространства, для чего планирую приобрести еще один монитор.
Это не программа, но все же, по утверждению многих, отличное решение в подобных ситуациях.
Уверен, что совместное использование описанных утилит и увеличенного рабочего пространства улучшит эффективность работы.
P.S. Пока писал статью, нашел список альтернатив перечисленным программам.
Исходя из этого, буду благодарен за приведение примеров используемых Вами решений и их преимуществ\недостатков для выявления наиболее удачных программ.
P.P.S. Всем высокой продуктивности.
Только зарегистрированные пользователи могут участвовать в опросе. Войдите, пожалуйста.
Используете ли Вы менеджеры окон?
12.67% Использую (это удобно)47
53.91% Не использую (не возникает необходимость)200
33.42% Не использовал, но теперь, возможно, попробую124
Проголосовал 371 пользователь. Воздержались 83 пользователя.
Actual Window Manager — многофункциональный оконный менеджер для Microsoft Windows. Состоит из более чем 50 инструментов для организации рабочего стола. Повышает удобство использования и производительность работы с любыми приложениями. С его помощью вы сможете организовать рабочую среду для удобного, быстрого и эффективного выполнения ваших задач без необходимости отвлекаться на рутинные манипуляции с окнами.
После установки и запуска программа работает в фоновом режиме, обеспечивая:
- автоматическое выполнение широкого спектра действий над окнами, таких как: свернуть при запуске/деактивации, развернуть при запуске, закрыть при запуске, изменить положение/размер при запуске, зафиксировать положение/размер, изменить приоритет выполнения при запуске/деактивации и многих других;
- быстрый доступ к скрытым возможностям системы («Свернуть окно в область уведомлений», «Окно всегда поверх всех», «Полупрозрачное окно» и др.) через дополнительные кнопки заголовка окна или дополнительные пункты в системном меню окна;
- поддержку механизма виртуальных Рабочих Столов;
- дополнительные средства при работе с несколькими мониторами: эмуляция Панели Задач, кнопки «Пуск» и Переключателя Задач на каждом мониторе, быстрое перемещение окон между мониторами, быстрое разворачивание окна на все мониторы.
- и многое другое.
ТОП-сегодня раздела «Десктоп менеджеры»
Carroll 1.31
Carroll — простенький инструмент для управления разрешением экрана монитора…
DisplayFusion 10.1.2
DisplayFusion — приложение, которое призвано существенно упростить жизнь владельцев…
Taskbar Hide 3.3
Taskbar Hide — небольшая утилита, которая позволяет мгновенно (в одно нажатие) скрыть любое открытое приложение на компьютере…
Trayy 1.0
Инструмент для Windows, который помогает упорядочить рабочее пространство и перенести…
Отзывы о программе Actual Window Manager
Dima про Actual Window Manager 8.14.3 [21-03-2021]
Мощная штука.
Класс.
Пробовать пробовать
Эксперементировать.
60 дней пробный период.
4 | 4 | Ответить
Дмитрий про Actual Window Manager 8.14.2 [20-04-2020]
Не понял как работает эта прога, возможно я тупой.
5 | 5 | Ответить
komorebi
Tiling Window Management for Windows.
Overview
komorebi is a tiling window manager that works as an extension to Microsoft’s
Desktop Window
Manager in
Windows 10 and above.
komorebi allows you to control application windows, virtual workspaces and display monitors with a CLI which can be
used with third-party software such as whkd
and AutoHotKey to set user-defined keyboard shortcuts.
komorebi aims to make as few modifications as possible to the operating
system and desktop environment by default. Users are free to make such
modifications in their own configuration files for komorebi, but these will
remain opt-in and off-by-default for the foreseeable future.
Please refer to the documentation for instructions on how
to install and
configure
komorebi, common workflows, a complete
configuration schema reference and a
complete CLI reference.
Community
There is a Discord server available for
komorebi-related discussion, help, troubleshooting etc. If you have any
specific feature requests or bugs to report, please create an issue in this
repository.
There is a YouTube
channel where I post
komorebi development videos, feature previews and release overviews. Subscribing
to the channel (which is monetized as part of the YouTube Partner Program) and
watching videos is a really simple and passive way to contribute financially to
the development and maintenance of komorebi.
There is an Awesome List which
showcases the many awesome projects that exist in the komorebi ecosystem.
Licensing for Personal Use
komorebi
is educational source
software.
komorebi
is licensed under the Komorebi 2.0.0
license, which is a fork of the
PolyForm Strict 1.0.0
license. On a high level
this means that you are free to do whatever you want with komorebi
for
personal use other than redistribution, or distribution of new works (i.e.
hard-forks) based on the software.
Anyone is free to make their own fork of komorebi
with changes intended either
for personal use or for integration back upstream via pull requests.
The Komorebi 2.0.0 License does
not permit any kind of commercial use (i.e. using komorebi
at work).
Sponsorship for Personal Use
komorebi is a free and educational source project, and one that encourages you
to make charitable donations if you find the software to be useful and have the
financial means.
I encourage you to make a charitable donation to the Palestine Children’s
Relief Fund or to contribute
to a Gaza Funds campaign before you consider sponsoring
me on GitHub.
GitHub Sponsors is enabled for this
project. Sponsors can claim custom roles on
the Discord server, get shout outs at the end of komorebi-related videos on
YouTube, gain the ability to submit feature requests on the issue tracker, and
receive releases of komorebi with «easter eggs» on physical media.
If you would like to tip or sponsor the project but are unable to use GitHub
Sponsors, you may also sponsor through Ko-fi, or
make an anonymous Bitcoin donation to bc1qv73wzspc77k46uty4vp85x8sdp24mphvm58f6q
.
Licensing for Commercial Use
A dedicated Individual Commercial Use License is available for those who want to
use komorebi
at work.
The Individual Commerical Use License adds “Commercial Use” as a “Permitted Use”
for the licensed individual only, for the duration of a valid paid license
subscription only. All provisions and restrictions enumerated in the Komorebi
License continue to apply.
More information, pricing and purchase links for Individual Commercial Use
Licenses can be found here.
Installation
A detailed installation and quickstart
guide is available which shows how to get started
using scoop
, winget
or building from source.
Comparison With Fancy Zones
Community member Olge has created an
excellent video which compares the default window management features of
Windows 11, Fancy Zones and komorebi.
If you are not familiar with tiling window managers or if you are looking at
komorebi and wondering «how is this different from Fancy Zones? 🤔», this short
video will answer the majority of your questions.
Demonstrations
@amnweb showing komorebi v0.1.28
running on Windows 11 with window borders,
unfocused window transparency and animations enabled, using a custom status bar integrated using
komorebi‘
s Window Manager Event Subscriptions.
Windows.11.and.Komorebi.mp4
@haxibami showing komorebi running on Windows
11 with a terminal emulator, a web browser and a code editor. The original
video can be viewed
here.
0vadqFOyIJHglPRY.mp4
@aik2mlj showing komorebi running on Windows 11
with multiple workspaces, terminal emulators, a web browser, and the
yasb status bar with the komorebi workspace
widget enabled. The original video can be viewed
here.
0e0dd7fc-7115-11ec-a064-42a1fbc2e1e9-v4_t10000011-wbjnuX5De6.mp4
Contribution Guidelines
If you would like to contribute to komorebi
please take the time to carefully
read the guidelines below.
Please see CONTRIBUTING.md for more information about how
code contributions to komorebi
are licensed.
Commit hygiene
- Flatten all
use
statements - Run
cargo +stable clippy
and ensure that all lints and suggestions have been addressed before committing - Run
cargo +nightly fmt --all
to ensure consistent formatting before committing - Use
git cz
with
the Commitizen CLI to prepare
commit messages - Provide at least one short sentence or paragraph in your commit message body to describe your thought process for
the changes being committed
PRs should contain only a single feature or bug fix
It is very difficult to review pull requests which touch multiple unrelated features and parts of the codebase.
Please do not submit pull requests like this; you will be asked to separate them into smaller PRs that deal only with
one feature or bug fix at a time.
If you are working on multiple features and bug fixes, I suggest that you cut a branch called local-trunk
from master
which you keep up to date, and rebase the various independent branches you are working on onto that branch
if you want to test them together or create a build with everything integrated.
Refactors to the codebase must have prior approval
komorebi
is a mature codebase with an internal consistency and structure that has developed organically over close to
half a decade.
There are countless hours of live coding videos demonstrating work on this project and
showing new contributors how to do everything from basic tasks like implementing new komorebic
commands to
distinguishing monitors by manufacturer hardware identifiers and video card ports.
Refactors to the structure of the codebase are not taken lightly and require prior discussion and approval.
Please do not start refactoring the codebase with the expectation of having your changes integrated until you receive an
explicit approval or a request to do so.
Similarly, when implementing features and bug fixes, please stick to the structure of the codebase as much as possible
and do not take this as an opportunity to do some «refactoring along the way».
It is extremely difficult to review PRs for features and bug fixes if they are lost in sweeping changes to the structure
of the codebase.
Breaking changes to user-facing interfaces are unacceptable
This includes but is not limited to:
- All
komorebic
commands - The
komorebi.json
schema - The
komorebi-application-specific-configuration
schema
No user should ever find that their configuration file has stopped working after upgrading to a new version
of komorebi
.
More often than not there are ways to reformulate changes that may initially seem like they require breaking user-facing
interfaces into additive changes.
For some inspiration please take a look
at this commit which added the
ability for users to specify colours in komorebi.json
in Hex format alongside RGB.
There is also a process in place for graceful, non-breaking, deprecation of configuration options that are no longer
required.
Development
If you use IntelliJ, you should enable the following settings to ensure that code generated by macros is recognised by
the IDE for completions and navigation:
- Set
Expand declarative macros
toUse new engine
under «Settings > Langauges & Frameworks > Rust» - Enable the following experimental features:
org.rust.cargo.evaluate.build.scripts
org.rust.macros.proc
Logs and Debugging
Logs from komorebi
will be appended to %LOCALAPPDATA%/komorebi/komorebi.log
; this file is never rotated or
overwritten, so it will keep growing until it is deleted by the user.
Whenever running the komorebic stop
command or sending a Ctrl-C signal to komorebi
directly, the komorebi
process
ensures that all hidden windows are restored before termination.
If however, you ever end up with windows that are hidden and cannot be restored, a list of window handles known
to komorebi
are stored and continuously updated in %LOCALAPPDATA%/komorebi//komorebi.hwnd.json
.
Restoring Windows
Running komorebic restore-windows
will read the list of window handles and forcibly restore them, regardless of
whether the main komorebi
process is running.
Panics and Deadlocks
If komorebi
ever stops responding, it is most likely either due to either a panic or a deadlock. In the case of a
panic, this will be reported in the log. In the case of a deadlock, there will not be any errors in the log, but the
process and the log will appear frozen.
If you believe you have encountered a deadlock, you can compile komorebi
with --features deadlock_detection
and try
reproducing the deadlock again. This will check for deadlocks every 5 seconds in the background, and if a deadlock is
found, information about it will appear in the log which can be shared when opening an issue.
Window Manager State and Integrations
The current state of the window manager can be queried using the komorebic state
command, which returns a JSON
representation of the State
struct.
This may also be polled to build further integrations and widgets on top of.
Window Manager Event Subscriptions
Named Pipes
It is possible to subscribe to notifications of every WindowManagerEvent
and SocketMessage
handled
by komorebi
using Named Pipes.
First, your application must create a named pipe. Once the named pipe has been created, run the following command:
komorebic.exe subscribe-pipe <your pipe name>
Note that you do not have to include the full path of the named pipe, just the name.
If the named pipe exists, komorebi
will start pushing JSON data of successfully handled events and messages:
{"event":{"type":"AddSubscriber","content":"yasb"},"state":{}} {"event":{"type":"FocusWindow","content":"Left"},"state":{}} {"event":{"type":"FocusChange","content":["SystemForeground",{"hwnd":131444,"title":"komorebi – README.md","exe":"idea64.exe","class":"SunAwtFrame","rect":{"left":13,"top":60,"right":1520,"bottom":1655}}]},"state":{}} {"event":{"type":"MonitorPoll","content":["ObjectCreate",{"hwnd":5572450,"title":"OLEChannelWnd","exe":"explorer.exe","class":"OleMainThreadWndClass","rect":{"left":0,"top":0,"right":0,"bottom":0}}]},"state":{}} {"event":{"type":"FocusWindow","content":"Right"},"state":{}} {"event":{"type":"FocusChange","content":["SystemForeground",{"hwnd":132968,"title":"Windows PowerShell","exe":"WindowsTerminal.exe","class":"CASCADIA_HOSTING_WINDOW_CLASS","rect":{"left":1539,"top":60,"right":1520,"bottom":821}}]},"state":{}} {"event":{"type":"FocusWindow","content":"Down"},"state":{}} {"event":{"type":"FocusChange","content":["SystemForeground",{"hwnd":329264,"title":"den — Mozilla Firefox","exe":"firefox.exe","class":"MozillaWindowClass","rect":{"left":1539,"top":894,"right":1520,"bottom":821}}]},"state":{}} {"event":{"type":"FocusWindow","content":"Up"},"state":{}} {"event":{"type":"FocusChange","content":["SystemForeground",{"hwnd":132968,"title":"Windows PowerShell","exe":"WindowsTerminal.exe","class":"CASCADIA_HOSTING_WINDOW_CLASS","rect":{"left":1539,"top":60,"right":1520,"bottom":821}}]},"state":{}}
You may then filter on the type
key to listen to the events that you are interested in. For a full list of possible
notification types, refer to the enum variants of WindowManagerEvent
in komorebi
and SocketMessage
in komorebi::core
.
Below is an example of how you can subscribe to and filter on events using a named pipe in nodejs
.
const { exec } = require("child_process"); const net = require("net"); const pipeName = "\\\\.\\pipe\\komorebi-js"; const server = net.createServer((stream) => { console.log("Client connected"); // Every time there is a workspace-related event, let's log the names of all // workspaces on the currently focused monitor, and then log the name of the // currently focused workspace on that monitor stream.on("data", (data) => { let json = JSON.parse(data.toString()); let event = json.event; if (event.type.includes("Workspace")) { let monitors = json.state.monitors; let current_monitor = monitors.elements[monitors.focused]; let workspaces = monitors.elements[monitors.focused].workspaces; let current_workspace = workspaces.elements[workspaces.focused]; console.log( workspaces.elements .map((workspace) => workspace.name) .filter((name) => name !== null) ); console.log(current_workspace.name); } }); stream.on("end", () => { console.log("Client disconnected"); }); }); server.listen(pipeName, () => { console.log("Named pipe server listening"); }); const command = "komorebic subscribe-pipe komorebi-js"; exec(command, (error, stdout, stderr) => { if (error) { console.error(`Error executing command: ${error}`); return; } });
Unix Domain Sockets
It is possible to subscribe to notifications of every WindowManagerEvent
and SocketMessage
handled
by komorebi
using Unix Domain Sockets.
UDS are also the only mode of communication between komorebi
and komorebic
.
First, your application must create a socket in $ENV:LocalAppData\komorebi
. Once the socket has been created, run the
following command:
komorebic.exe subscribe-socket <your socket name>
If the socket exists, komorebi will start pushing JSON data of successfully handled events and messages as in the
example above in the Named Pipes section.
Rust Client
As of v0.1.22
it is possible to use the komorebi-client
crate to subscribe to notifications of
every WindowManagerEvent
and SocketMessage
handled by komorebi
in a Rust codebase.
Below is a simple example of how to use komorebi-client
in a basic Rust application.
// komorebi-client = { git = "https://github.com/LGUG2Z/komorebi", tag = "v0.1.36"} use anyhow::Result; use komorebi_client::Notification; use komorebi_client::NotificationEvent; use komorebi_client::UnixListener; use komorebi_client::WindowManagerEvent; use std::io::BufRead; use std::io::BufReader; use std::io::Read; pub fn main() -> anyhow::Result<()> { let socket = komorebi_client::subscribe(NAME)?; for incoming in socket.incoming() { match incoming { Ok(data) => { let reader = BufReader::new(data.try_clone()?); for line in reader.lines().flatten() { let notification: Notification = match serde_json::from_str(&line) { Ok(notification) => notification, Err(error) => { log::debug!("discarding malformed komorebi notification: {error}"); continue; } }; // match and filter on desired notifications } } Err(error) => { log::debug!("{error}"); } } } }
A read-world example can be found
in komokana.
Subscription Event Notification Schema
A JSON Schema of the event notifications emitted to subscribers can be generated with
the komorebic notification-schema
command. The output of this command can be redirected to the clipboard or a file,
which can be used with services such as Quicktype to generate type definitions in different
programming languages.
Communication over TCP
A TCP listener can optionally be exposed on a port of your choosing with the --tcp-port=N
flag. If this flag is not
provided to komorebi
or komorebic start
, no TCP listener will be created.
Once created, your client may send
any SocketMessage to komorebi
in the
same way that komorebic
would.
This can be used if you would like to create your own alternative to komorebic
which incorporates scripting and
various middleware layers, and similarly it can be used if you would like to integrate komorebi
with
a custom input handler.
If a client sends an unrecognized message, it will be disconnected and have to reconnect before trying to communicate
again.
Socket Message Schema
A JSON Schema of socket messages used to send instructions to komorebi
can be generated
with the komorebic socket-schema
command. The output of this command can be redirected to the clipboard or a file,
which can be used with services such as Quicktype to generate type definitions in different
programming languages.
Appreciations
-
First and foremost, thank you to my wife, both for naming this project and for her patience throughout its
never-ending development -
Thank you to @sitiom for
being an exemplary open source community leader -
Thank you to the developers of nog who came before me and whose work taught
me more than I can ever hope to repay -
Thank you to the developers of GlazeWM for pushing the boundaries of tiling
window management on Windows with me and having an excellent spirit of collaboration -
Thank you to @Ciantic for helping me bring
the hidden Virtual Desktops cloaking function tokomorebi