Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Grid-based window tiling for X11 with powerful keyboard controls (github.com/jakebian)
69 points by dbranes on June 7, 2017 | hide | past | favorite | 45 comments


I have a workflow that I believe is far superior to all these window managers.

Quake-style terminals have always been popular. I used to use Yakuake on KDE which was very convenient.

The convenience its not that those terminals open up with an animation (which is quite annoying). It was because there was a dedicated keyboard shortcut for them. You memorized that and you never ever think about managing the window of that application again.

So for years I have keyboard shortcuts assigned to my applications.

F1 opens Browser

F2 opens File manager

F3 opens Text Editor

F4 opens Chat App (Telegram)

F6 opens Email client

F7 opens ICR Client

F9 opens Terminal

F10 opens Music Player (Although Spotify on Linux has a bug that doesn't allow this to work)

Ever since I adopted this scheme I simply have a better quality of life during the time I'm using my computer. If there was a CPU usage for my brain, I'm sure its dropped. I strongly suggest you to try it out.

Because the shortcuts become muscle memory and you don't even think about them anymore. You know what you want and your fingers just know how to open it up.

I'm not quite sure which window managers allow this, but I'm using KWin and it allows me to arrange these shortcuts.


Wait a second. That's exactly how Windows taskbar binding works.


I pipe a list of installed programs into dmenu and have it run whichever one I select. I have this bound to Mod+p. dmenu has fuzzy search, so if I want to open firefox I can just type `Mod+p fox <cr>`. Not quite as fast as having dedicated hotkeys, but it also covers all installed programs on the system (or some small subset if I want).

Having programs available from anywhere with just a few keystrokes makes everything feel very accessible. Whenever I want to run something I just need to type a few characters of the binaries name to launch it.

I use a similiar set up for ssh, where I pipe the Hosts from my ~/.ssh/config into dmenu and only need to type part of the hostname to connect.

[dmenu] http://tools.suckless.org/dmenu/


dmenu takes 2 seconds to open on my computer. It's horrible. But I use it too little to worry about changing it.

My question is: how do you open ssh from dmenu? I can't open terminal applications from dmenu, it should open a terminal automatically, I guess, but it doesn't do anything. Is that controlled by some other Linux configuration? I'm on Ubuntu with i3.


You'd need either write a special dmenu script to run it in an xterm, or add a simple script to your path:

#!/bin/sh

exec xterm -e ssh user@hostname


So this is pretty much like Windows Win+Number shortcut, when you have apps pinned to taskbar.


And this is pretty much the same as the i3 window manager's Mod1+Number to switch workspaces, when you have one app per workspace.

This is of course customizable to use other keystrokes if you prefer.


I lucked into this pattern when I used ratpoison. Window 0 was always my terminal emulator (running tmux), window 1 was always Firefox. Additionally, tmux window 0 was always my IRC client. Getting between those apps quickly became muscle memory. I use a more conventional window manager now and it's noticeably clumsier.


Not seeing how this is relevant. The tool linked here just helps you manage how much space different windows take up on your screen, it doesn't really care about how you open these windows.


Not really relevant. It just makes my life easier and people in this topic are interested in window managers so I thought I'd share maybe someone finds it useful :)


You can bind keys to operations including more complex operations than 1key -> command in any window manager or de. If your environment of choice doesn't allow this you can use xbindkeys or sxhkd.

Wayland excluded because in wayland this feature is either provided/enabled by the environment or impossible to implement for securities sake.

If you haven't already got it may I suggest you implement some sort of raise or run functionality so that say F6 could open your email client or focus it if its already open.


Have Hammerspoon do this for me on macOS, except the shortcuts are more like Caps Lock+T is Terminal, etc.


Wow. This is amazing, perfect keybindings.

Lots of keys combined with Meta(alt)+Control key, the optimum keybinding for window manager, those two keys are always unused in user programs. Its really perfect for emacs, no-one has imagined to use those two keys with some random key, on any of emacs packages or modes.

Poor me have binded my windowmanager commands with Super(windows) + (what ever command key I use for it.


I use my align_window3 utility on Windows: https://github.com/tom-seddon/align_window3

It divides the screen into halves and thirds horizontally and vertically, with one keypress setting size and position on one dimension. (The recommended key settings are vaguely mnemonic, but of course you can pick pretty much anything and then get used to it through practice.)

I can't remember the last time I felt the need for a finer grid, but the 4x3 grid here has got me thinking that maybe it could do with an update...


What's the advantage of this over a tiling window manager like i3?


None its somewhat less work than manually arranging windows but a lot more work than having them tiled in either manual or automatic tiling. In fact with tiling wm the most useful arrangements are incredibly simple and involve 1-4 windows on a single monitor/workspace.

People only make complicated arrangements for screenshots.


I use a tiling window manager (spectrwm) and I am almost always using a single window in fullscreen. Apart from the browser most of my workspace exists inside the terminal where I'm very liberal with using multiple panes/windows/sessions in tmux. This fills a similiar role for me with regards to tiling, but for almost everything else I prefer having only a single application front-and-center at a time, with tiling available for rare occasions.

What I like about the tiling wm is that I can launch an application and have it immediately fill the entire screen (without annoying decorations). Then opening and closing windows, changing windows, moving workspaces, etc, is all just a hotkey away.

This same setup would be possible with openbox I think, but it all comes "out of the box" with most tiling window managers.


This is a pretty cool idea that would really help make use of huge monitors, without the hassle of dual monitors.

How much would would it be to let the user custom define their grid? Ie, it's 4 * 3 by default, could we have 3 * 2 for laptop users?, or 4 * 2 for monitors turned sideways?


Great suggestion & definitely something I was thinking about, will put on the roadmap. I hacked this up for my own use on my 3840 x 2160 display, and the philosophy is will add fancier features & customizations only if there is interest.


Strongly second being able to customize the grid. I'd actually like 6*4, spanning keys 1-6 at the top to z-n at the bottom


For OS X, I use Optimal Layout: http://most-advantageous.com/optimal-layout/

Here's a screenshot of it in action: http://i.imgur.com/2N8czFR.jpg It took about five keystrokes to get the windows arranged like this. No mouse.

It's a product which has gotten far too little love financially compared to the value it produces. It's become an integral part of my OS X usage, and I can't imagine spending a day without it.

I have it set up like this:

Alt-1: Stretch the current window as wide and tall as possible. (Fill all available space.)

Alt-2: Make the current window occupy the left-half of the screen. Press Alt-2 again to occupy the right half.

Alt-3: Make the current window occupy the top-half of the screen. Press Alt-3 again to occupy the bottom half.

Alt-4: Occupy the top-right quarter of the screen. Pressing Alt-4 multiple times moves the window clockwise: bottom-right, bottom-left, upper-left, upper-right.

Alt-5: Center the current window, fill all vertical space, and fill 75% of total horizontal space.

Alt-Tab: http://i.imgur.com/SRFb16t.png Better version of Cmd-Tab. Pressing Alt-Tab once will go to the most recently active window. Twice goes to the second-most-recently active, and so on. Note that this is by window, not application. This alone is a massive improvement.

Alt-F: Search for a window whose title contains the specified string.

Remarkably, these hotkeys have never conflicted with any apps I use, and I've been using it for like two or three years.

The free version works just fine, but pops up a nag screen every day or so.

I wish it defaulted to these shortcuts, because it takes some work to set it up as I've described above. There's also no easy way for me to export and share my configuration with you. But once you've set it up this way, you'll never want to go back. OS X's maximize button is very inconsistent and it's remarkable that there's no hotkey to make the current window fill all available space.


This is neat but I have a hard time seeing it being worth money since it seems like it could on linux be recreated with shell scripts in aprox 20 minutes. I don't know much about os x but I don't imagine it would be that much harder to resize windows and calculate the size of the screen real estate.

Kwin has a similar functionality. When I used that I prefered to bind super+numbers to these operations. I used the numbers on the num pad that corresponded with the desired location. Example 8 toggled between top half top third and Top 2/3. 7 used the top left quarter etc. I think having some mapping between the physical layout and the layout on screen is useful.


So don't pay for it :) The free version works flawlessly, forever.


Can't imagine permanently running nagware on my machine I would rather work while sitting on a tack.


It's an amazing piece of software. If you can't afford two cups of coffee for it then you can afford to let it nag you once a day with a popup that can be instantly closed.


I don't desire to discourage you from helpfully promoting software that others may enjoy and benefit. I also think if you like it more than you like the 10 bucks you should buy it but I have two logical issues with your posts.

You can argue that its worth the money but its silly to argue that it can be had for free when its under terms that nobody including the developer expects you to accept! Its not supposed to be free you are supposed to buy it or delete it.

The specious cup of coffee argument. A cup of coffee at a coffee house is itself overpriced its 15c of coffee prepared with 25c of labor. The fact that people like Starbucks are as successful as they are at turning 40c into $5 is amazing. Anyway this emotional appeal doesn't even work on an emotional level if you think about it. I say this as I drink my own delicious 15c cup of coffee.


I believe it should be easy to integrate this into xmonad by creating a few functions for that, which is the real beauty of it. The xmonad-contrib package [1] is a collection of such extensions, this one could very much join them.

[1]: https://hackage.haskell.org/package/xmonad-contrib


Every time I see something awesome like this I have to rethink my dedication to OS X. I might have to dual-boot my next laptop.


An actual tiling window manager is actually far more useful because it automatically places new windows in the layout and doesn't require you to manually mess with much.


The extra level of multi nested grids etc is cool, but honestly I get by just fine with Spectacle.


Moom can/could do this on OS X.


I've been using quicktile (https://github.com/ssokolow/quicktile) for years to add tiling to desktop environments which don't provide it ootb. Also in python, and works very well.


yea i discovered this a couple of months ago and though i've never used a tiling window manager i can't imagine what value one would add over quicktile


This is pretty cool. Is there anything similar for OSX? The corner specification would come in handy on 40inch 4K monitor

(Currently using Hammerspoon, but use qtile on Linux)


I have loved using Divvy for ages - http://mizage.com/divvy/


I like Divvy, too. I wonder how hard it would be to snap Divvy's GUI overlay onto these Linux tools. I frequently want to arrange windows not just in halves of the screen, but in thirds. I find that gets cumbersome with keyboard shortcuts alone.


Seen Divvy, never tried it. I'll have to look into it.

This might be what I'm looking for http://www.hammerspoon.org/docs/hs.grid.html


i used divvy for one thing: making a window take up the full screen. on my laptop, i dont ever want to use half a screen... or at least i dont think i do. so dumb that i need to use divvy for this one thing. or maybe i dont? havent checked in forever.


ShiftIt is alright: https://github.com/fikovnik/ShiftIt

It's rather limited - make window fill quarter/half screen, make window fill whole screen, move window to next monitor - but it's very easy to configure, and supports XQuartz windows.


Why isn't there a good, non-bloated, free one for Windows?

I try to use Windows 10's tiling, but it'll only do 4 quadrants (with variable sizes)


I wrote a little tool that uses the Ctrl plus the numeric Keyboard to subdivide the desktop into 3x3 quadrants: https://github.com/nafest/winpad_layout

Its basically a ripoff of the macOS tool https://github.com/janten/keypad-layout


I guess it's because people who care about customizing their OS generally don't want anything to do with Windows.


> Merge branch 'shit'


This is a great idea. But it seems like a job for C, since it'll be running in the background all the time and will bind to Xlib. Shouldn't be more than 200 lines of code, right? Someone should attempt this!


This is awesome!




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

Search: