
Show HN: Grid-based window tiling for X11 with powerful keyboard controls - dbranes
https://github.com/jakebian/snaptile/tree/master
======
emilsedgh
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.

~~~
okbake
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/](http://tools.suckless.org/dmenu/)

~~~
fiatjaf
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.

~~~
tmearnest
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

------
osmala
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.

------
to3m
I use my align_window3 utility on Windows: [https://github.com/tom-
seddon/align_window3](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...

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

~~~
michaelmrose
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.

~~~
okbake
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.

------
lacampbell
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?

~~~
dbranes
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.

------
sillysaurus3
For OS X, I use Optimal Layout: [http://most-advantageous.com/optimal-
layout/](http://most-advantageous.com/optimal-layout/)

Here's a screenshot of it in action:
[http://i.imgur.com/2N8czFR.jpg](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](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.

~~~
michaelmrose
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.

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

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

~~~
sillysaurus3
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.

~~~
michaelmrose
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.

------
infinisil
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](https://hackage.haskell.org/package/xmonad-contrib)

------
adrianpike
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.

~~~
wmf
Moom can/could do this on OS X.

------
rufugee
I've been using quicktile
([https://github.com/ssokolow/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.

~~~
ice109
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

------
mharrison
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)

~~~
samratjp
I have loved using Divvy for ages -
[http://mizage.com/divvy/](http://mizage.com/divvy/)

~~~
goerz
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.

------
cyberjunkie
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)

~~~
nafest
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](https://github.com/nafest/winpad_layout)

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

------
_JamesA_
> Merge branch 'shit'

------
vortico
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!

------
kapauldo
This is awesome!

