Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: A Native Tiling Window Manager for Windows 10, Inspired by I3wm (github.com/mcyoloswagham)
327 points by mcyoloswagham on Feb 28, 2021 | hide | past | favorite | 95 comments



So happy to see so much more active development in windows stuff these days, for a while it looked like all the cool stuff was happening in the apple ecosystem, I’m happy to see developers starting to trust windows again.

One of the things that I’d love to see in this that fancy zones is missing is the ability of windows to remember where they should be after I reconnect to my dock. Like maybe I run some shortcut right before I disconnect the dock that stores window locations and then when I reconnect I click the shortcut again to restore them to those monitors.


> One of the things that I’d love to see in this that fancy zones is missing is the ability of windows to remember where they should be after I reconnect to my dock.

When I worked in an office, and had frequent meetings I had to take my laptop to, it irked me enough to come up with my own solution:

https://github.com/nearwood/windmill


can you save different 'layouts' so you can load a different one in diff context?


No. It's pretty bare-bones. Save before a disconnect, restore after re-connect.

And it's hWnd based, so if the window handle ever changes it won't work. Also won't work for admin windows, unless run as an admin.

But it worked well enough for me.


Oh wow, the hwnd approach is an awesome idea! I suffer from a different issue - my monitor has a displayport and 2 hdmi inputs, and when you activate one of the hdmi inputs, the other sends a "monitor disconnected" signal to its host, which messes up the layout. It would be awesome to have an app that constantly remembers the layout, and once it detects a change in the number of monitors, or a resolution change, it stops doing it until the monitor returns, and it does, it restores windows to the saved places. Sounds easy enouch, and I'll probably create this app myself based on examples from your code.


I had wanted to do that, but when I created it I was using a proprietary ThinkPad dock and Windows 7, and I couldn't find an easy way to detect when connected/disconnected. Might be a way now with Win10 and Type-C docks.


If you want to see some nice stuff: Powertoys ( https://docs.microsoft.com/en-us/windows/powertoys/ )

Search Everything ( https://www.voidtools.com/ & it's toolbar https://github.com/stnkl/EverythingToolbar - highly recommended )

Gif about search everything toolbar: https://user-images.githubusercontent.com/17520641/102723553...

PsTools - https://docs.microsoft.com/en-us/sysinternals/downloads/psto...

The tools included in the PsTools suite, which are downloadable as a package, are: PsExec - execute processes remotely, PsFile - shows files opened remotely, PsGetSid - display the SID of a computer or a user, PsInfo - list information about a system, PsPing - measure network performance, PsKill - kill processes by name or process ID, PsList - list detailed information about processes, PsLoggedOn - see who's logged on locally and via resource sharing (full source is included), PsLogList - dump event log records, PsPasswd - changes account passwords, PsService - view and control services, PsShutdown - shuts down and optionally reboots a computer, PsSuspend - suspends processes, PsUptime - shows you how long a system has been running since its last reboot (PsUptime's functionality has been incorporated into PsInfo)


Additional tips regarding psTools.

Enter https://live.sysinternals.com in to Windows Explorer to browse and run the psTools suite.

Its also exposed via WebDav at: \\live.sysinternals.com@SSL\DavWWWRoot


> Enter https://live.sysinternals.com in to Windows Explorer to browse and run the psTools suite.

How do they do that?

Edit: well I guess going there answers the question: it’s exposed via WebDAV


what do you mean by reconnect to my dock? Feel free to open an issue if you'd like and I'll try and to my best to implement it. edit: I think I understand, WinWM has a hotkey called refresh after you move windows you can use it to return all windows to the current layout.


I think he is talking bout plugging or unplugging a new/different display.

You can connect external displays to USB-C or Thunderbolt docks / hubs.


ah I see, I'll add that to the checklist


Worth remembering that you can configure a machine to either mirror a display (I would expect the most common case) or extend the desktop (new display becomes display #2).

It is also not uncommon to dock a laptop at a workstation with dual or triple monitors.


On the subject of tiling managers (I use one since so long I don't even remember when I started using those), time for a rant...

I never ever understood why those who do allow gaps (i.e. some space between each window) are basically all, by default (and sometimes it's very hard to change), do add "gaps" near the monitor's borders.

I mean seriously: why on earth are empty pixels added between the leftmost window(s) and the left side of the monitor, between the rightmost window(s) and the right side of the monitor, between the bottommost window(s) and the bottom of the monitor?

This, to me, makes absolutely zero sense. And they all do that, including this one for Windows 10 (as can be seen in the screenshots).

Why? Really: just why? I want to rant and ask: what's wrong with people? : )

It just makes no sense. There's not a world in which it makes sense.

Worse, Awesome VM calls all the gaps "useless gaps" even though it's a fact that gaps between windows aren't useless (especially when you're tiling terminal windows with no borders or with a 1-pixel border, where it can be hard to detect boundaries between two terminals if there's no gap).

But gaps near the monitor's borders are really useless: it's ok, I don't risk mistaking what's at the right of my monitor (atm a physical cup of coffee) or what's at the right of my monitor (atm a tower with three Raspberry Pi stacked) for, say, a terminal window!?

I hacked my tiling VM (the "Awesome VM" on Linux) to not have these really useless gaps on the borders but the assumption that they should be there are so deeply tied in the code that's it's a PITA to do.

"Use the source Luke" and all that but, why, just why? And why hardcode these assumptions in the code? Why do they all do that?

I just don't get it and never will.

Rant off : )


I can't speak for everyone, but on my 4k 40" monitor I appreciate the gap at the left/right border because it can be quite difficult to read the text on the far left/right of the screen unless I'm sitting over 120cm away from the screen. It's literally only the first column of text (in a console) so the left gap just pushes everything over enough that I can see it easier.


I have a cute wallpaper, I like the impression that windows are inside the overall workspace, and I can spare 5px left and right.

Its purely esthetical :-)


Your perspective seems to be purely based on optimizing for screen real estate. I don't use a tiling VM for the efficient use of pixels but for the usability benefits they provide. Useless gaps are useless when optimizing for use of pixels for content that is relevant to you. I like to have some visual "breathing" space between object I look at for the same reason passe-partouts are a thing in art for a very long time and pauses matter in music.


Yes bit shouldn’t that be the role of the application, that decides to either put info too near the edge or not? You should treat your borders as edges and not put letters too near them, leaving breathing space for the fact that who knows what’s beyond.


No. I want to define global behavior and don't want to rely on all applications doing that. Application windows are the objects on screen I want space between, that space should be visually reliable and consistent independently from the applications design and color.

I don't even want to convince people this is right way to do it and just want to make clear there are different perspectives and for some visual composition is more important than information density on screen. I get this might be important for a laptop but running three 4k displays I find it important to clearly visually distinguish all the things on my screens at a glance and also to enjoy an uncluttered but spacey desktop.


If the window is sitting at the edge of the screen, with no gap at all, it can easily create the illusion that part of the window is off the edge of the screen. Especially when text sits right against the edge. The extra border is just a visual indicator that yes, you are seeing the entire window.


FancyZones for Windows allows you to adjust or disable the gaps.

Some people prefer the aesthetic of the gaps, but it should at least be an option for tiling window managers.


Looks cool. If you want to get rid of your hook DLLs and the need for the x86ipc child process, you can use SetWinEventHook() with EVENT_OBJECT_CREATE / EVENT_OBJECT_DESTROY as min/max event values and WINEVENT_OUTOFCONTEXT to get notification on newly created/destroyed windows, all within the context of your process. No hook DLLs required.


Oh wow, that's huge I'll definitely add that, that'll help a lot with dealing with processes that don't need injection, and protected processes (anticheats/drm etc...).

edit: though regardless, I need to inject ForceResize into them, but still maybe I can come up with some way to subclass windows without subclassing windows lmao, need some gui thread message hijacking


On Linux I’m a now full time sway-user, and a former i3 user.

While on Windows I never found a good i3-replacement, I found a fairly mature and stable tiling WM I’ve been contributing too, although it’s more in the style of xmonad.

So if you’re into tiling WMs and you’re stuck on Windows you may want to give that one a try too:

https://workspacer.org/


Great work! I love FancyZones but this is a bit more configurable (a friend on Twitter calls FZ “lighter touch,” which I think is a perfect descriptor, whereas this is more flexible and more of a traditional tiling manager) and it’s such a good start!

I’m primarily a macOS user, but projects like this really make me wish there were more options (yes, I’m aware of Amethyst, Yabai, Spectacle (now Rectangle), Hammerspoon, and so on. Those options all have their own deficits and trade-offs) in the Apple world.


FZ is awesome. I think few people are aware of it.

https://docs.microsoft.com/en-us/windows/powertoys/fancyzone...


FancyZones is what makes large display setups usable.


100% and so easy to use as well. I wish there was FZ for MacOS as well. I tried plenty but most of them are very limited or requires reliance on multiple key combos.


If anyone here has a Dell monitor, they have a small tray application called "Dell Display Manager" and it can split your screen up into all kinds of different configurations (I use 1x pane on the left and 2x panes on the right). It works only on Windows though. It works great and easy to switch off if it gets in the way.


On the macOS front I’ve only heard of Yabai and amethyst. I settled on amethyst since it didn’t require disabling SIP but I’d be interested to hear about the drawbacks you’ve seen in others. Amethyst seems to work okayish, but I definitely would be interested in something more advanced if the drawbacks aren’t too painful.


I combine FancyZones and TidyTabs, and it nearly gives me the tabbed-panes interface that I want.


One important distinction is that you can still resize the window without affecting other windows, so not really true tiling WM in linux sense, where you can never escape the tiles.

I have never seen Windows WM behave the way i3 does.


Windows can be made to behave like i3, with a lot of work. I've done a few different things over the years, but I never got into i3 so I haven't made my personal WM software work like that.

It's a bit of a curiosity nowadays, but Windows started out as a tiling system - if memory serves, overlapping windows were not supported until 2.1. But even then, it wasn't like i3.

- guy that worked on the Windows WM (USER & DWM) for over a decade


damn that's very interesting, due to certain performance issues on very old hardware, I was debating writing a driver for win32k, make it work faster, like I mean 1-5ms render times, but it was too much of a mess. DWM & Win32k are very complicated


Before coming to Microsoft, I wrote my own EngAlphaBlend() accelerator driver in 2003 or so. I knew a lot about how things worked from disassembly but after coming to MS in 2004 I quickly destroyed a lot of my own assumptions. Mess? no. Complicated? yes.


well I mean it was too much of a mess in my own work, I know a bit about win32k, but trying to deal with all the xxx, yyy,zzz functions and the locks and everything kinda confused me, and so I gave up. :(


> where you can never escape the tiles

Tbf that's exactly what floating mode is for


Can floated windows in i3 be snapped to somewhere on the screen in any way?

I use i3 but don't know of any way to do this.


I'll have to try this one out, I've been using PyleWM[0] for a few months, and it works well, but doesn't have as much workspace support as this project, it seems.

One recent thing PyleWM has added, but isn't in the readme, is a fuzzy program launcher, does this have anything like that?

[0]: https://github.com/GGLucas/PyleWM


Gee, what the OP has is a LOT of advanced Windows software but, still, gives results not what I prefer!!

I don't want to change the sizes of the windows and but just move them so that I can easily make use of all of them and for that goal:

For each window, I want its UL (upper left) corner to be on a line from roughly the top center of the screen to roughly the left center of the screen. And I want all those UL corners equally spaced on that line.

So, for the goal: With this arrangement (1) can see at least a little of each of the windows, (2) usually can see the title of each of the windows, and (3) properties (1) and (2) continue to hold for any Z-order for the windows, i.e., can click on the windows in any order, thus, changing the Z-order, and still have properties (1) and (2). So, with (3) can just click on any window, bring it to the top of the Z-order, see all of that window, and still have (1) and (2). That is, can continue working with all the windows without more arranging.

I wrote a little script in Rexx to do this arranging and put an icon on the desktop to run that script. Best place for the icon? Sure, in the UL corner of the screen thus, not covered by any of the so arranged windows.

The version of the Firefox Web browser I'm using does something similar BUT with a difference: The line I mentioned goes from the top center of the screen to the center RIGHT of the screen instead of the center left. Sooo, when a window is brought to the top of the Z-order, usually all the windows with UL corner to the lower right are fully covered, i.e., usually can't see any part of any of them. So, lose property (3) and often soon also properties (1) and (2).

So, having that "line" go to the center left of the screen instead of the center right is a biggie!


I'm not too sure what you mean, if you mean the little inequalities from the top of the screen, the option "adjust_for_nc" should be turned on, I should probably change that to include it. As for the rest of the stuff I'm not sure


There is a (similar?) effort that takes inspiration from dwm:

https://github.com/prabirshrestha/dwm-win32

Maybe you can take inspiration from one another...

I'm really tempted to try them out, but I probably first need a spare Windows system...


Kinda on-topic: if anyone here has a Dell monitor, they have a small tray application called "Dell Display Manager" and it can split your screen up into all kinds of different configurations (I use 1x pane on the left and 2x panes on the right). It works only on Windows though. It works great and easy to switch off if it gets in the way.


I used this for a while, but I found FancyZones, the MS powertoy to do a similar job in a way that worked better for me.


> The task bar must be at the bottom of the screen and not on the sides, this is something that will hopefully be fixed soon

That's a shame, I look forward to this restriction being lifted so I can check it out without rewiring my brain in two ways at once instead of just learning the new tool.


How does this stack up against Nog [0]? I currently use it for my i3 needs and its very clean and works better than anything else I've tried.

0 - https://github.com/TimUntersberger/nog


How different from https://docs.microsoft.com/en-gb/windows/powertoys/fancyzone... is i3 or this i3 spinoff?


fancyzones is pretty good but it's more like fixed layouts that you can change to, where as i3wm and other twms let you change the layout on the fly making them a bit more flexible.


Yeah, it's a bit of a push versus pull distinction: Fancy Zones sets up "zones" on the monitor that you can push applications into. A tiling window manager pulls new windows as they appear into non-overlapping "tiles". With Fancy Zones a window typically overlaps by default (just as the Windows default has been since sometime in Windows 2) until you the user pushes that window into one of the zones (using the mouse or a keyboard shortcut). A tiling window manager should default to that automatically without user intervention.

There's definitely plenty of overlap: Fancy Zones has some options to try to automatically remember to snap applications to given zones.


> push versus pull

Thanks that really clarifies how to view the projects actually.


> The subtractive Grid model starts with a three column grid and allows zones to be created by splitting and merging zones, resizing the gutter between zones as desired.

i3wm is basically like that except ad-hoc instead of preconfigured, and starting from a single full-screen window.


Nice work! One thing I always miss from MacOS is per-monitor workspaces. Does your WM support this? Gonna give it a shot. Right now I'm using the Microsoft's FancyZones PowerToy which is more about custom snap zones than proper tiling.


well each monitor has it own workspace, but when you change workspaces it will change them all in sync with each monitor, so I don't know if that's what you mean. you can have different layouts on different monitors if that is what you mean


May be you can help me with this.

I am using the same computer from 2 locations, one 10 meters away (using extension cables) from the computer. Both locations have a keyboard and a mouse. When I start an application it always opens on the primary display, not the display I initiated the opening of the application from.

On Linux with X11 (with BSPWM or not) this is flawless. The multi display support in Linux / X11 seems to be much more advanced compared to Windows.

Any idea how I can get this in Windows 10?


On Linux you have two X servers instances, with 2 window managers, and 2 consoles. Each X server is working with a different display, so naturally the content ends up on the right display.

On Windows you have just one console, one window manager, and multiple monitors. The easiest way to accomplish this is to clone the two monitors in display settings so you're always using the same monitor, regardless of where you're sitting.


I am using a single xserver and extended the desktop.

Yes cloning is what I ended up doing.


FancyZones and DisplayFusion both have this feature. I think they achieve it by tracking your cursor position and moving the window.


I actually have no idea, this is something I had to work around in my twm, since the windows always spawn on the primary monitor


Okay, I think that answers my question.

I meant the ability to change workspaces on each monitor separately. In MacOS I can have a 2 monitors each with 2 workspaces, and switch to workspace 2 on monitor 1 without affecting monitor 2's workspace.


I also find this feature extremely useful on macOS, especially combined with the ability to move entire workspaces from one monitor to another.

I have a primary and secondary monitor (with actual physical differences) and being able to easily move a task from one to the other is such a useful feature. I'd go so far as to say this is the most significant thing from macOS I'm missing right now.


Can you turn it on/off without logging out? I use i3 at work, and I'd guess I would want it 20% of the time for my personal computer.


Why do you want it at work but not at home?


I'm using Linux in both places.

For me it's because I spend more of my time at work programing, while at home I spend as much time gaming, which I've found doesn't work with tiling WM's as well.


yes you can the default shortcut for turning it off and restoring everything to a single virtual destkops is MOD + T


this is great! Did you encounter any Win10 quirks, that wouldn't allow to recreate full i3 window-tiling experience like fullscreen focus?


Yeah, there are definitely a few, I've implemented an experimental thing that removes titlebars for windows, but that's totally dependant on the application it works on, so browers that do fancy things don't work as well, but something like notepad/cmd/etc... work pretty well.

Also the focus bar is a little overlay line that could be improved, but it's very difficult to make it like in i3wm without covering a significant portion of a windows content since you can't really control a windows rendering, etc....


This is really cool. It doesn't seem to capture every app though - the first one I tried was Calculator, which just floated on top.


Yes my bad, this is a debugging remnant because all UWP windows share the same name meaning that it gets very confusing when the settings and other applications get captured by WinWM, or like the wifi popup, etc...

I'll address the bug soon


Calculator is one of those applications that I set to floating in i3/awesome, so I'm not sure it should be "fixed". This is the sort of thing that users should be able to decide on the fly.


It's nice that Windows allows alternate Windows Managers unlike that other proprietary operating system. Give users a choice!


It actually does not. All WMs on Windows just move windows around sending commands to Windows own WM. That one is not disablable.


Does it have workspaces (virtual monitors)? Can it save them and restore them after I reboot?


yes it does have workspaces, 9 of them that aren't just moving around windows but windows's own Virtual Desktop, but no the state isn't stored through reboots, though that is one of the goals.


I have dozen named workspaces on i3. Limiting them or not providing the ability to (re)name them or create them on the fly makes the whole experience of virtual desktops pretty lame.


The biggest issue on W10 is that there's no way to even more windows from one workspace to another without several clicks, unlike most Linux implementations that have hot keys or dragging the icon around.


since it's using virtual desktops you can just win+tab and do that


[flagged]


Luckily mcyoloswagham doesn't need you to accept it.

I quite like the look of it, I'll quite likely use it next time I need Windows for something more useful than gaming.


I was very rude in my comment. And I apologize.

But the fact stays: i3 is not solely about windows management. It is a major step forward in workspace management too.

Bringing to Windows all the i3 features in term of workspace management would (in my opinion) be the real game changer.

But I presume it is technically challenging.


Which WM/desktop manager do you use when you are not on Windows?


Depends on the machine.

I daily drive Gnome shell with the Pop_OS tweaks on my laptop. On a couple of other desktops (both at work and home), I use KDE, i3, and Sway.

I've played around with XFCE, enlightenment, vanilla GNOME as well.

Which one I use highly depends on the usecase of the machine.

Pop_Shell is a nice all-rounder, it's got decent tiling, decent defaults, Jack-of-all-trades, master of none feel.

KDE is nice for machines I share with others, and when I just use a machine occasionally for light work/gaming. I also like it for machines that I do graphics work on, as A) Krita is a KDE app, and B) GIMP/Krita don't play with tiling very well, and I forget to turn it off in Pop!_Shell. Yes that's my fault. Yes it's still a factor.

I like i3/Sway for doing actual work in, especially with regards to ops and development work.

XFCE was fine, not my favorite, but it did the job. Ditto for enlightenment.

Vanilla GNOME is a nightmare. I can't stand it.


I am surprised, given your very reasonable experience, that you do not highly praise the flexibility of i3 workspace management.


Honestly, I've never had a need for it.

I've done deep dives into software as I've needed it, and even just the very surface level of familiarity with i3 was plenty to get enough of a performance boost that the WM was not what was limiting my productivity. At that point, why spend more time optimizing it?

I did daily drive it for a while on my laptop, and highly enjoyed being able to set up workspaces complete for different uses at the touch of a button, but I don't need that days, and didn't do much useful work when I did use it.

Edit: A big part of this is that the machines I use i3/Sway on these day's are really just single purpose machines that I don't do enough different things on to justify refreshing workspace management in my head. I find just being able to sanely open/manipulate open terminals is enough.


Given the asynchronicity of developer's life, I usually create a workspace for any microtask I have. And the workspace/microtask automatically dies whenever it no longer contains any window. Even looking for information on stack overflow is now a workspace in my workflow. (Because workspaces are so cheap).

After some weeks living like this, i see that some microtask survive for a surpisingly long time, and my workspace management has evolved into a kind of poor's man task manager.

The fantastic side-effect of a workspace tied to a task is that the windows, history, URLs are ready to use instantly. Which makes cognitive load when task switching a breeze.


Where does that limit of 9 comes from? Doesn't Windows 10 accept more that 9 desktops? I have tried the shortcut Ctrl+Win+D and could create more than 9 desktops on my Win10 install.


This is awesome. It’s always nice to see new Win32 productivity software. Thank you!


Are workspaces integrated with windows desktops or they are separate entities?


They are integrated with windows desktops. You can see them in the Win+Tab menu


Nice work. I'll definitely be using this!


i was just thinking of removing windows 10 and going back to manjaro i3 this evening. Will give this a go before I do! Thanks


Thank you! I am very excited to try this


Fantastic work, THANK you!

A suggestion: get rid of any spaces between the windows, but keep the snapping.

Sort of how Aero Snap works today, snap to the entire left half, or the entire right.

Keep the 2x2 grid you have now, but just make it easy to snap to the full size of each grid cell (or 1x2 or 2x1 spaces).


you can totally change that in the settings, set the "adjust_for_nc" on and disable gaps. I'll change the defaults right now. it's in config.json the explanations are here mcyoloswagham.github.io/win3wm


The gaps are a beloved option in i3wm. This project borrow opinions and hotkeys from that project and will likely be more appealing to people who just an _automatic_ tiling WM full time.


How is this different from the default tiling support in Win 10? If you drag a window to a corner/edge it starts to offer you options to add windows.


LOL, if you don't know why downvote? :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: