top | item 44042490

Show HN: A Tiling Window Manager for Windows, Written in Janet

297 points| agentkilo | 9 months ago |agent-kilo.github.io

Hi HN!

I read[1] about Janet[2] some time ago, then immediately got impressed by the enthusiasm of its community, and by the language itself, so I started playing with it.

At the time I was searching for a tiling window manager for Windows, and unavoidably the idea of scratching my own itch with Janet got hold of me, so Jwno was born.

Simply put, Jwno is a keyboard-driven tiling window manager for Windows, scriptable with Janet. But since it has a complete Lisp runtime, and a thin wrapper library for Win32 APIs[3], you can certainly do much more with it.

I hope you'll enjoy playing with it as much as I enjoyed building it.

And yes, I use StumpWM on the Linux side, by the way.

[1]: https://ianthehenry.com/posts/why-janet/

[2]: https://janet-lang.org/

[3]: https://github.com/agent-kilo/jw32

103 comments

order

rich_sasha|9 months ago

I'm curious, did you find there were things that were easier to do because it's Janet/lisp-like language? Or you just fancied like using it (perfectly valid reason of course!).

I tried various lisp dialects, but I could never find the killer feature vs other languages I already use. And I can justify why I use these specific languages I do use, if that makes sense.

agentkilo|9 months ago

I find the REPL and interactive development workflow invaluable. A window manager is a long-running background service by nature, and has a lot of accumulated runtime states. The ability to peek inside and debug while the process keeps running helped me a lot when building Jwno.

I think Jwno's REPL module is so important, I specifically changed Jwno's architecture at one point to make it work.

iLemming|9 months ago

> I could never find the killer feature vs other languages I already use.

You're kidding or trolling? Structural editing and the REPL are the greatest features of Lisp. The ability to just grab any expression and move it around simplifies so many things when coding and refactoring. With the connected REPL you can eval anything on the spot, that turns the entire experience of coding into a video game — you don't need to wait for linter, linker, compiler — you just run things. You often don't even have to save anything. I suspect when you "tried various lisp dialects" maybe you didn't use structural editing and the connected REPL?

Often people confuse Lisp REPL with REPLs in other programming languages, e.g. Python, where usually you have to copy-n-paste chunks of code into it. Lisp's REPLs are different in the sense that every step in Read-Eval-Print-Loop is different — in Lisp, you typically eval things right where you type them, by sending whole expressions to the connected REPL, which could be remote. We (for example) run ours in a Kubernetes cluster, that allows us to experiment with pods, running queries against the "real" DB tables, testing services "live".

90s_dev|9 months ago

> You can implement custom commands and hooks to trigger. It's even possible to call native Win32 APIs in your own implementations. For example, to always move a Notepad window to the (100, 100) coordinates on your screen(s), using the low-level SetWindowPos function

Great job. Looks really interesting and useful. And a fun excuse to write Lisp.

I really appreciate it when APIs give you high-level functionality but keep the door open to lower-level APIs when you really need them.

once_inc|9 months ago

My experiences with tiling window managers is that they struggle in judging a modal screen like a confirmation box or detachable/dockable mini-containers like the interface of certain programs like GIMP. Considering those as new tile-able windows tends to be a hinderance instead of increasing productivity.

roflmaostc|9 months ago

I use AwesomeWM on Linux since over ten years.

For example, GIMP works without any issues. And the productivity boost is tremendous, for me it's very hard to work on anything else. I barely encounter programs where it does more harm than use.

Especially having multiple desktops with different names allow me to localize windows so much quicker than looking through a dozens of terminals manually.

Right now, I do have: 1 mail, 2 web, 3 gimp, 4 chat, 5 notes, 6 terminal, 7 ssh cluster

3036e4|9 months ago

They do struggle with that, or rather some developers struggle with not making assumptions about the way a user's window manager is laying out their windows?

I use StumpWM, and for the few applications that this becomes a real problem it is possible to run those in a floating windows group that works just like a minimalistic non-tiling window manager. I think this is a common features of tiling window managers.

aus10d|9 months ago

Janet looks really neat. And this project seems really cool. Windows DESPERATELY needs a more powerful built-in manager. It's ridiculous to use the mouse all the time.

Rasthor|9 months ago

One of the later PowerToys updates makes the first few steps in the right direction with "fancy zones". It's not strictly native windows, but still developed by Microsoft and adds keyboard shortcuts for all its utilities

jazzyjackson|9 months ago

I never use the mouse to move windows around, windows key + arrows key meets my needs fine even multi-monitor, breaks the screen up into halves and quarters. Alt-tab to change focus.

behnamoh|9 months ago

> Windows DESPERATELY needs a more powerful built-in manager. It's ridiculous to use the mouse all the time.

And yet, I find Windows window management far more advanced than macOS. It's ridiculous that up until recently, macOS didn't even have basic max-size functionality w/o reaching for 3rd party apps.

weeb|9 months ago

This looks to have great potential for accessibility! I work with individuals who use eye gaze input, where a significant part of the screen is taken up by an on-screen keyboard (including various shortcut/macro keys as well as for typing). Having tiling options that fit within a smaller part of the screen (e.g. still allow side by side or top/bottom split, but in a smaller total region) would be great. Particularly as Windows 11 has broken vertical docking of appbars.

The UI hints also look promising, but I can't get them working. Using example-config.janet I tried pressing RAlt or RAlt+K and I get the UI hint shortcuts list coming up, but none of them seem to do anything, except in Notepad where I sometimes get the standard UI hints (that always come up here with a long press of left alt)

Fwiw, as a newbie I found it a bit intimidating/off-putting that it doesn't work out the box without choosing a config file. That's quite a lot of extra cognitive effort and link-clicking before you can try it out. And I'm left quite unsure what I'm missing out on. Am I able to access the different documented features with the config file I have? It's not clear.

agentkilo|9 months ago

> Having tiling options that fit within a smaller part of the screen (e.g. still allow side by side or top/bottom split, but in a smaller total region) would be great.

Do you mean reserving screen space for the on-screen keyboard? If that's the case, you can try to "transform" the top-level frame (a frame that tracks a monitor's screen area), either in the REPL or in your config: https://agent-kilo.github.io/jwno/cookbook/adjust-top-level-...

> Using example-config.janet I tried pressing RAlt or RAlt+K and I get the UI hint shortcuts list coming up, but none of them seem to do anything

Can you please file a bug report and attach relevant logs? You can write logs to a file by starting Jwno like this:

jwno.exe --log-file C:\jwno.log --log-level debug --no-console your-config.janet

There should be some interesting logs when you press one of the UI hint shortcuts.

> Fwiw, as a newbie I found it a bit intimidating/off-putting that it doesn't work out the box without choosing a config file. That's quite a lot of extra cognitive effort and link-clicking before you can try it out.

I totally understand. But I chose to not include a default config in the executable, because I thought a window manager is a... personal thing. It should evolve with your habits and workflows, so the default config will most likely get changed to something dramatically different anyway. I can be wrong though.

iLemming|9 months ago

Whoa, very cool. I love WMs, I love Lisp, and I hate Windows. This seems to be a perfect "medicine" for my frustration with it.

avindrag|9 months ago

That UI hinting feature is killer. Is something similar available outside of this repo?

accrual|9 months ago

I agree, it's impressive. It brings me back to early Windows when keyboard control was a first class citizen in the UI, and most functions had dedicated alt key combos per dialog.

bsnnkv|9 months ago

Jwno is great, agentkilo is kind, Lisp is magic :)

agentkilo|9 months ago

Thanks for the kind words! It means a lot coming from you :)

TeMPOraL|9 months ago

Long-time StumpWM user, before I switched back to Windows a few years ago. This is super-exciting to see, and I'm going to take it for a spin. It might just address my major frustrations with arranging windows and switching between them; my monitor seems just the right shape/resolution for the standard Windows splits to be suboptimal.

(Browsers, in particular, I use full-screen less and less. That annoying trend of squeezing everything into short lines "because readability" is just wasting too much screen space; zooming in makes everything too big, and I'm getting tired of writing userstyles or userscript to fix it for every other page I open, so I'm back to keeping 2 or 3 columns of windows running.)

Also, any excuse to use more Lisp is good in my book. Based on the screenshots, it looks stellar; if it works half as well as it comes across, I'll switch over instantly.

agentkilo|9 months ago

A fellow StumpWM user!

My StumpWM is heavily customized though, and I mostly modeled Jwno's behavior after my own config, so it may not be what you expected at all.

But that's one of the reasons I like Lisp and things built in Lisp: They are so flexible, you can sometimes build something based on the original thing, while it feels completely different from the original.

> my monitor seems just the right shape/resolution for the standard Windows splits to be suboptimal

Do you use an ultra-wide? In that case, Jwno has no OOTB ultra-wide support, but there's a section for adjusting it in the cookbook[1].

[1]: https://agent-kilo.github.io/jwno/cookbook/adjust-top-level-...

entropie|9 months ago

I recently tried hyprland after using xmonad for like 10+ years and wondered about the decision to bind workspaces to displays. I didnt like that. How does Jwno handle multiple monitors? I have looked at the docs and didnt see it mention anywhere.

agentkilo|9 months ago

Sorry for the confusion. Multi-monitor support is only briefly mentioned in the docs[1] and the interactive tutorial[2].

Jwno's internal data structure has these levels (higher-level comes first):

Root - Virtual Desktops - Monitors - Normal Frames - Windows

So monitors are part of a virtual desktop, and every virtual desktop has the same layout that reflects your physical monitor arrangement. When you switch virtual desktops, all monitors switch to the new desktop at the same time.

[1]:https://agent-kilo.github.io/jwno/frame-tree/frame-nodes.htm...

[2]: https://github.com/agent-kilo/jwno/blob/master/example/tutor...

pona-a|9 months ago

What kinds of automation are possible with having a scripting language inside your WM, rather than Sway-style IPC? I heard the new Windows WMs were where most pure workflow advances happen, so I wonder if they can be replicated on Linux.

packetlost|9 months ago

This might be the coolest project I've seen using Janet yet!

wodenokoto|9 months ago

What resource did you use to learn Janet? And did you already know lisp before? Comming from Python and php I found the "Janet for mortals" very difficult. It expected me to know what closures and macros are.

harryvederci|9 months ago

I'm not the one you asked, but maybe this is helpful:

I learnt Janet after learning Clojure, and it all felt very natural. So a possible approach is to grab a beginner Clojure book/tutorial first, run some of the examples, and then see how far you get with Janet.

Not everything is the same, but you'll find that out along the way, and the people in the Janet Zulip chat are always super helpful.

Also check out https://janetdocs.com for some examples.

-__---____-ZXyw|9 months ago

So amazing. I might have to use Windows soon, against my will, and this could sweeten the deal for me considerably!

jackemerson|9 months ago

Looks very good! This one is what I need

xtiansimon|9 months ago

Does your project have any influence on Windows focus stealing?

pjerem|9 months ago

Oh ! That looks cool :)

ang_cire|9 months ago

Custom windows shells (I know this is just a window manager, but still) in the year of our lord 2025? This takes me back to the days of installing bb4win and litestep in XP. I'm a kid again!

scbrg|9 months ago

flashback, 2001. I'm 25, sitting in the office with litestep installed (which honestly was the only alternative to Linux or resignation). My five years younger colleague steps up to my desk and says "hey, cool desktop!"

I start explaining, very carefully, like I'm talking to a child, that this is an alternative shell, which replaces the standard Windows Explorer et cetera, und so weiter... it's very complicated you know...

Guy says, "cool... hey, why don't you check out this URL?". I do. It's the litestep contributor page. His nick is on it. Near the top.

Ow.

wredcoll|9 months ago

Is it just me or did not a single one of those "l33t haxker shells" ever produceable a single ui innovation that lasted?

I mean, I remember there being a whole ton of wildly customized windows shells with menus and floating terminals and so on, but not a single thing stuck around?

philsnow|9 months ago

Sloop manager for replacing progman.exe in windows 3.1, for me..

piskov|9 months ago

Oh shit yes: Rainlendar

pbohun|9 months ago

This is so cool! It's funny because open source devs are making Windows better while MS is actively making it worse. If MS removed all telemetry and AI (and restored win10 functions in context menus), I would probably move back to it.

I've recently started playing around with Janet, and it's a great language. I think it's inspired by Clojure and Lua, and somehow manages to be better than both (in my opinion).

agentkilo|9 months ago

> I think it's inspired by Clojure and Lua, and somehow manages to be better than both

This is exactly how I feel about Janet too. I don't think I have enough experience on Clojure or Lua to comment on them, but I got attracted to Janet almost immediately.

Working on Jwno also confirms my first impression on Janet: It's really a practical language. The tooling has some room for improvement, but the language itself can get things done - usually fast and easily.

qingcharles|9 months ago

This is a fantastic replacement for Windows Explorer which is about 10X faster/lighter:

https://filepilot.tech/

(it's beta so it has a few little annoyances still)

roxolotl|9 months ago

Tangential but I’ve been writing a lot of Janet recently using Joy[0], web framework, to build a small web app. Would love to hear what you learned about Janet from doing this work and how you feel about the language afterwards.

The one thing I’ve noticed is that it seems like Janet had a burst of interest 2020-2022 but it has since slowed down. Would love to see it become popular again. The main reason I’m using it is because I like how it’s both powerful and lightweight. I’d use clojure but I don’t want Java. I’m tempted to also try Common Lisp but so far Janet has been great.

[0]: https://github.com/joy-framework/joy

agentkilo|9 months ago

I think Janet is quite...liberal? It's a practical language, but doesn't force a specific paradigm on you. There're "escape hatches" in different levels of the language, and I like that.

Maybe the most "opinionated" things in Janet are the ev stuff and fibers. I think they're done right though, you just need to be careful with the event loop when embedding Janet.

Pfeil|9 months ago

I always disliked the chaos that happens quickly with application windows, and loved the idea of tiling. But none of them really worked for me practically until I found PaperWM around a year ago or so (gnome extension). It has few core shortcuts and feels more natural. Like you would really arrange applications directly on your desk. It does not limit itself by your screen width and has the nice default that a new window appears to the right of the current window (configurable). You seldomly have the need to re-arrange windows, because the default just fits 99% of all cases. In addition, you still have the comfort of gnome. No hacky config files just to get wifi working or so. For work we have OSX, and I am really missing it there (I am using rectangle there instead). https://github.com/paperwm/PaperWM?tab=readme-ov-file#usage

modzu|9 months ago

scrolling window management is a new paradigm for me - really liking paper so far, thanks for sharing! (for what its worth, traditionally my approach has been fixed window positions for all applications, and enough screen real estate to support that. but that doesnt work in wayland with any mainstream compositor afaik)

MisterKent|9 months ago

How does it compare to komorebi? I've been using it for about 5 months with great success. I'm a Hyprland user when I'm on my personal machine, but for windows Komorebi has let me keep my muscle memory and workflow largely intact.

agentkilo|9 months ago

I think these are the most obvious differences between the two:

* By default, Komorebi uses dynamic tiling, while Jwno uses manual tiling.

* Komorebi has workspaces, Jwno works with Windows native virtual desktops instead.

* Komorebi uses IPC and native system command line to send commands, while Jwno usually operates all by itself.

There are definitely other details that are important to you, but these are the things that immediately came to my mind. I don't run Hyprland so can't really comment on that.

piskov|9 months ago

Just in case someone new is looking, komorebi is great:

https://github.com/LGUG2Z/komorebi

bsnnkv|9 months ago

komorebi dev here - Jwno is awesome and I highly recommend people give it a try (especially people who enjoy writing Lisp!)

The Windows tiling window manager development scene is a very kind, relaxed and collaborative space where we all take inspiration from and support each other

agentkilo|9 months ago

Definitely! I got great inspirations from both of the Komorebi and GlazeWM communities. People who like tidy desktops are definitely nice people :)