Removing bloatware features from Sway

yujiri8 profile image Ryan Westlund ・1 min read

The Sway window manager is amazing. It has much more functionality than dwm, my previous fav. The biggest sadness is that dwm is 2000 lines of C while Sway is about 42000.

So I got to thinking, it shouldn't take that many times as much code to make a few additions and improvements, right? Sway is actually based on i3, another high-featured tiling window manager with a similar line count. While a lot of the things they add over dwm are big improvements for me, many seem like silly bloatware features, like gaps between windows. And that was the one I chose. I decided to see how many lines are dedicated to this particular bloatware feature.

Perhaps surprisingly, I was able to remove the feature pretty easily despite not being familiar with the Sway codebase or knowing much C. The answer is about 500.

Makes me wonder what other bloatware features there are and how many lines of code are being spent on them. How much C would it actually take to provide just the functionality I care about?

It's probably not a possibility I'll explore with Sway because if I maintained a window manager, I wouldn't want it to be in C. I would sooner look into Smithay. But it was an interesting experiment.


Editor guide