A tiling window manager written in Rust
github.com
github.com
So to continue the trend, I used to use tiling wm's until I learned about Emacs. Emacs lets me do away with tiling mostly because it itself supports it in a way, namely C-x 2 and C-x 3. I can run all my shells and gdb's right inside Emacs. Nowadays I usually either have one fullscreened Emacs window, Firefox, 1 external terminal, and maybe LibreOffice open on my laptop. I don't mess around with moving them around and resizing them. For me, it's enough to simply have workspaces to manage all of them (I use C-M-[np] to switch back and forth through them, Caps Lock is remapped to Control).
It's true though that the benefits of tiling window managers isn't just the tiling itself, but often that they're programmable and configurable through plain text files. There's also the benefit of lower resource consumption if you run it bare.
As for what I actually use? Xfwm4 gets the job done.
services.xserver.windowManager.xmonad.enable = true;
services.xserver.windowManager.default = "xmonad";
Then ran `nixos-rebuild --switch` to use the new config.As well as using C-x 2 and C-x 3, I've started using perspective.el (https://github.com/nex3/perspective-el), which means I can switch between different projects each with their own buffer set and window configuration, as well as switch to an IRC perspective. It's such a well-executed extension, definitely recommend it if you've never tried it.
> similar to workspaces in windows managers such as Awesome and XMonad (and somewhat similar to multiple desktops in Gnome or Spaces in OS X)
Similar to eclipse perspectives I'd say although it is hard to say from reading alone. Did I misunderstand?
(Also, why so few screenshots in the eclipse community? A few good images gives you a better feel without installing.)
(I use it rather rarely, because I have a small screen and generally have no more than 3 windows open at the same time; I jump between Emacs' "workspaces" with help of Elscreen)
OTOH I use urxvt with tmux for most command line stuff because it works better with zsh completions and colors and such. So I have three WM-level windows open (on separate virtual desktops, each maximized): urxvt, chrome and emacs with urxvt and emacs being further split into windows organized in a tiling manner. Works great for me :)
I set my window layout up once at the start of a multi-hour working session. Most of the time, that's either 1) a large MacVim window and a terminal or 2) that plus a browser. It takes ~10 seconds to get it how I like it. After that, cmd+tab works just fine.
Even on my 27" display, I usually prefer to have a little overlap where all three windows rest in such a way as to permit the most relevant bits to be visible simultaneously, while allowing for overall larger space when an individual app is focused. Tiling window managers tend to distort windows to less than ideal proportions, as they strictly eliminate overlap. That said, I utilize splits (ie tiling) within vim to great extent.
(1) Browser: pinned and now open (1 tab only). (2) Windows Explorer: pinned, open, several windows. (3) Windows media player, pinned, closed. (4) Notepad: not pinned, but open.
Win+1 will bring the browser to the front, unless it's already there, in which case it will minimize it.
Win+2 will bring a Windows Explorer window to the front, and if you keep pressing it will cycle between them.
Win+3 will obviously open Windows Media Player,
Win+4 will bring Notepad to the front.
Win + shift + number will start a new instance of the application in that taskbar position (multiple explorer windows, for example).
Win + shift + left/right will move the current focused window between monitors.
Often when I'm done working, I end up closing perhaps a dozen scratch terminal windows.
When I have some time to experiment, I'd like to look at replacing Optimal Layout with mjolnir[4] or one of the similar tools listed in mjolnir's README, under Mjolnir vs. other apps.[5] Amethyst[6] looks like another option worthy of consideration.
[1] http://most-advantageous.com/optimal-layout/
[2] http://robots.thoughtbot.com/a-tmux-crash-course
[4] https://github.com/sdegutis/mjolnir
[5] https://github.com/sdegutis/mjolnir#mjolnir-vs-other-apps
Another one you might want to look at is Witch[1]. I've tried it before but it never really "stuck" for me. Maybe I should give it another shot. Witch isn't a window manager though, it's only concerned with making it easy to switch between windows rather than laying them out.
Why do you use iTerm2? I've looked at it in the past, but it just feels non-native enough to bug me. I know they advertise tmux integration, but the one time I tried to find out what that actually entailed, it didn't seem to work for me (though I've been told it basically just uses iTerm2 native splits in place of tmux splits).
If you want to enable option-as-meta in Terminal.app, you select the Profile you want in preferences, go to the Keyboard tab, and there's a checkbox at the bottom. This is also where you can customize the bindings for various key sequences, if you think they're wrong.
For instance, my primary development workspace has four columns: three emacs and one terminal with tab support. I don't open/close new emacs windows or new terminal windows, in the same way that I don't open/close new browser windows: I just use tabs within a single window. Likewise, I use multiple open buffers within my emacs windows, and multiple tabs within my terminal windows. If I need a transient terminal, I switch to a different tab or add a new tab.
Opening/closing transient terminals is pure UX overhead, IMO.
(I accidentally killed my X session this morning; everything in tmux survived :) )
Also, scratch terminal windows are solved by TMUX and a single terminal.
wtftw is very interesting. I can't wait to give it a shot.
The problem is if I create a tab, I want it to be at least somewhat related to the other tabs in the window. And even then, I usually use new windows for scratch terminals because I want to see multiple different terminals side-by-side. I could use a vertical tmux split except that shrinks the original terminal, and I want both the original and new terminal to be at their natural size.
Sounds like your use case could be mapped by TMUX windows acting like Terminal tabs, and TMUX sessions acting like multiple Terminal windows. Except the benefit is that now you can use this workflow on any system with a posix compliant shell and a tmux binary (which I'm pretty certain is practically all the things at this point). Sessions and windows can be given labels which is a nice touch too.
If you are an Emacs user, it's also worth noting that TMUX totally works well with ansi-term. :) I normally have a TMUX session dedicated to an ansi-term buffer in Emacs. Even if I have iTerm or Konsole using another session.
"..but transient windows don't need splits"; well, in my universe transient windows are splits. :)
Anyway, I don't want you to think I'm trying to persuade you into adopting what I consider awesome and useful. Just clarifying my statement. It sounds like you already have a workflow, are happy with it, and don't see any need for alteration.
http://manytricks.com/moom/ http://mizage.com/divvy/ http://ianyh.com/amethyst/ http://spectacleapp.com/ https://github.com/fjolnir/xnomad https://itunes.apple.com/us/app/bettersnaptool/id417375580?m... https://github.com/sdegutis/mjolnir
On OS X, that's SizeUp (or Divvy, ...) with a custom grid to suit my screen and then I never have to use the mouse to move/resize windows.
On the other hand, Spectacle (also open source) is supported and it doesn't require XQuartz. That said, I don't like Spectacle default shortcuts (hard to remember for me and there's a conflict with Chrome switch-tab command). I now use http://spectacleapp.com, but with ShiftIt-inspired configuration:
https://raw.githubusercontent.com/fikovnik/ShiftIt/develop/d...
Haven't tried the new version of Hyrda yet.
This "manual tiling" approach is also probably the only viable option for tiling-like window management on OS X. While not nearly as powerful or productivity-promoting as the above-mentioned WMs or conventional tiling ones, the OS X program Spectacle (http://spectacleapp.com) makes life a lot easier on OS X for those of us who are used to the screen real estate and keyboard control afforded by tiling WMs.
Edit: Another commenter mentioned the non-free Optimal Layout (http://most-advantageous.com/optimal-layout) for OS X. I haven't downloaded the trial yet, but the website makes it look very promising.
I like tiling in general but doing it well requires a big monitor.
If I'm coding in Clojure, I have a vim window on the left, and a repl and a plain terminal (mostly for leiningen and git commands) stacked on the right. I could set this up in a traditional WM: but [a] it would take (a bit) more initial effort and [b] more importantly, with dwm I can temporarily bring in extra windows (e.g. a web browser) and then get rid of them again without having to restore my layout from scratch.
I agree with you about focus follow mouse (though it can be more trouble than it's worth if you have an overly sensitive trackpad).
I'd love to get into http://i3wm.org/ but can't find anything to push me over the ledge, so I keep resigning myself to checking out projects like the one in OP and thinking "Wouldn't that be nice..."
I just wish I could find a decent tilinging manager for OS X (divvy and amethyst do not fit my requirements)
If I feel like trying a tiling wm again, I think I'd go with xmonad. From reading, it seems to have decent defaults, and it'd a good opportunity to start playing with Haskell.
I wish integrating tiling wm's with regular DE's, even lightweight ones (lxde, xfce) would be more popular. When switching all out to awesome, I missed the conveniences like a tray with wifi and sound volume. I just want a DE, with tiling windows!
https://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_X...
apt-get install xmonad gnome-panel
a GNOME with Xmonad option will appear in your login screen. Then you have to create an xmonad configuration that works with GNOME like so import XMonad
import XMonad.Config.Gnome
main = do
xmonad $ gnomeConfig
in .xmonad/xmonad.hs and everything will work.The layout snapshots is really handy to jumpstart the day and put everything in place. Keyboard shortcuts allow resizing and moving windows around. It's highly configurable, so you can add or remove features as you see fit. I'd give the free trial a spin.
I wouldn't consider myself an expert and found the change (I'm otherwise a Gnome kind of guy) easy enough. Is there anything specific you have trouble with?
The nicest things about a tiling manager? You can control nearly everything from the keyboard. It's very quick and easy to set up side-by-side windows (or side/top-bottom, and so on), and resizing one automatically resizes the other. It really helps on smaller screens, since by default everything is full screen with minimal window decoration.
Some nice features of i3wm in particular - well developed manual control, most layouts can be expressed as the composition of simpler layouts, and the config file is just a config file, not a full fledged program.
Also, it's worth remembering that on Linux you can have multiple WMs installed at the same time. You can log in to i3wm, and if there's something you really can't figure out, you can log out and switch to gnome/kde/etc. I don't know if there's a way to switch WMs without shutting down the whole x session though. Would be interested to know if it's possible.
Some WM's support the '--replace' flag (Both the WM being replaced and the one you're starting have to support it). If you run a new WM with the '--replace' flag, the old WM will shutdown and the new WM will take-over all the windows it was handling. This is only switching WM's though, so you can't really switch into Gnome or KDE doing this and then switch-out. i3 doesn't support it though (It would have a bit of a hard time supporting it anyway), so you can't do it with i3.
If you can't do it that way though, then just have your X session start a terminal on screen instead of a WM. The X session will stay live as long as that terminal stays open, so you can start and kill any number of WM's as you want as long as your other programs don't mind it. Not everything shuts down very cleanly though, so you might not be able to start and close Gnome and then start KDE in the same session. You should be able to kill i3 and start openbox or xfwm though, for example.
Personally I'm still waiting for a tiling WM with mouse support - having used a few keyboard based WMs, and having used Eclipse, I find Eclipse to be by far the nicest. The only problem being that it's an application panel manager, not an X windows manager :(
The features I want from a WM: http://shimmie.shishnet.org/v2/_images/ae13a6ed6a5d725f34d10...
I can't go back to a non-tiling manager now!
Now I'm back to the default window manager of xfce4, which is ok since I tend to use only emacs and a browser, so I have have one workspace for each.
Just run "wmname LG3D" then restart any open Java programs.
LG3D is "Looking Glass 3D", a Java window manager http://en.wikipedia.org/wiki/Project_Looking_Glass . It's quite amusing that Java's UI toolkit contains special-cases to avoid breaking their demos.
I got same issues like you and here's my advice: install i3 and try to use it, after 2-3 days you'll be able to move windows, switch them or run apps with only keyboard (keybindings are pretty intuitive, but you need to try). Don't try to use it for every task or force yourself to use only it - I hate it when have to deal with some windows apps in wine, which are opening alerts and windows like shit, and then simply switch to gnome or sth. Don't try to customize everything at once, but rather slowly find your real needs and google around how to make your system your best tool.
Sure, they certainly do look snazzy, especially when coupled with the movie hacker-approved unified dark color scheme. New windows pop up and quickly assume their rightful space and everything just looks so darn tidy.
But for certain usage patterns, that doesn't get you a lot. Even if you're popping up disposable shell windows left and right, you might also do that within screen/tmux, where the window manager doesn't come into play at all (or have some drop-down quake-like console). Also, your running applications and especially their different configurations might not change that often, in which case you're really saving yourself some manual layout fiddling once. So a lot of people would perform pretty much the same with just alt-tab window cycling and virtual desktops (which seem orthogonal to the whole deal).
I mean, if you look at the vast majority of screenshots, you don't even see that much work. The obligatory IRC client, fake-GUI music players and/or file managers and probably an editor with the configuration file or some minor coursework open. It's not exactly Scotty and his Mac Plus.
Having said that, I'd add my vote to i3wm, as it isn't as ideologically pure as some others (you still have window titles if you want them, and the layout remains somewhat manual). Plus a rather readable configuration format, even if the default configuration is seemingly intended to drive vi-users mad.
My alternative would be bspwm, the binary space partitioning wm. A lot more minimal, but the automatic layout algorithm is rather tractable and one certainly wouldn't be confused with too many options.
Well, this applies to all WM screenshots ever, not just tiling window managers. The main problem with WM screenshots is that you want to show how it looks, show off some features, but my actual work is generally spread across many virtual desktops, each with just a few windows (mostly xterm)
I blame it more on the fact that many of the tiling wm crowd are quite young and don't do that much actual work with their machines, especially if they just switch to Linux because of other screenshots of said style.
Or just not being able to show e.g. proprietary code…
To be honest I like using tiling WMs because they're not magic, whizz-bang things. I could lay out my windows better with a stacking WM (eg. when badly-behaved apps make assumptions about their size and put buttons off the edge of the screen), but a tiling WM does just well enough that I really don't care about my window layout anymore. Whatever Xmonad does is usually fine.
Likewise, with a tiling window manager I really don't care about background pictures anymore. Before using tiling WMs I used to use chbg to cycle through a directory of images, and use (fake, then composited) transparency in terminals, etc. These days my machines boot straight into Xmonad with st and emacs open; my only "background" is a black screen for a couple of seconds while they start up.
Any screenshot I take would just advertise whatever fullscreen application I have open at the moment, along with a line of text at the top of the screen with a clock and counters for my unread email and failing tests.
Certainly. It's always hard to judge age on the 'net, but looking at the relevant discussions on reddit or linux forums, you'll find an astonishingly uniform spread of applications, and if you find any code that's not the configuration of the window manager, it'll be some kind of programming 101 material. This, along with the "just installed Linux, this is my new awesome desktop" makes me a bit biased towards assuming a large quantity of teenagers -- also more likely to generally proactively show their neat desktops.
This doesn't mean that every tiling wm user is that way (I certainly am not), just like pinterest isn't a good indicator about the prevalence of refurbished palettes in American bedrooms...
I would say that you probably have more in common with corporate windows users who have their apps running fullscreen all the time, too and that way don't ever changed their backgroudn from Napa valley, than with the "unix ricers" who regularly apply patches to their minimal wms that leave large borders around their windows, so that their background is still evident.
I like i3 a lot, but even as an Emacs user the first thing I did was to change the focus key bindings to something vi-like. Using JKL; instead of HJKL on anything meant for Unix users just seems devilishly perverse.
I've started to notice I often have i3 open with an xterm running screen in which I'm running vim with multiple buffers. I should start using ctrl-alt-F* so I have 4 layers of context switching...
My alternative would be bspwm, the binary space partitioning wm.
I like bspwm's approach to keyboard shortcuts: don't do them. Have an external socket through which external applications have complete control over window-manager tasks, and use an external hot-key manager (sxhkd, by the auther of bspwm) to send commands to it to handle windows.Are there any tiling WMs which support this layout style or can be easily configured to do so?
I'm thinking about trying the new Guile window manager that popped up here a few days back, it looks like it has a StumpWM-esque style and maybe Guile is a little more light-weight/less flaky than most Common Lisp implementations.
Thanks for bringing this to my attention! I'm a StumpWM fan too and it looks like Guile-WM has promise. Here's the homepage for anyone else interested:
The main advantage of it tho, is not the tiling window managing facilities... But the run-or-raise plugin.
It allows you to run (start) or raise (go to the window) of any application with an assigned shortcut.
Mine are: Mod+e - Emacs Mod+u - Browser (Conkeror) Mod+y - Browser (Chromium) Mod+k - Konsole Mod+. - Keepass Mod+x - Pidgin chat window Mod+i - Skype chat window
The choice of shortcuts may seen arbitrary, but I'm a Dvorak user and all the keys are easily accessible.
With this setup, from my editor I'm a Mod+u / Ctrl+g g to a search on google, and from there I'm a Mod+k from my terminal (from where I run tmux... ;P) and a Mod+e from Emacs.
I'm also using a dropdown terminal with another tmux where I have access, from any where on my system just pressing F1, to my MTA (mutt), file manager (mc), IRC (irssi), Music player (cmus) and a root shell.
Honestly... With this setup there is definetly no going back... Every thing on the tips of my fingers... Some shortcut away.
I almost feel part of the machine! :)
Less flippant answer; the usual arguments are that Rust is more memory safe, and hopefully less complex and with fewer gotchas compared to C++. It's still relatively complex - inherently, due to what it tries to do - but people seem to be of the opinion that it is much less complex than C++.
So while C++ is certainly improving, Rust has a fundamental advantage in the safety department.
But since the alternatives to C and C++ kind of faded away from mainstream and they are anyway the UNIX system languages, most developers seldom look for alternatives.
With Rust, Go, D, Haskell, OCaml, .NET Native/Mono AOT, Java AOT compilers, hopefully developers will eventually realize that not everything needs to be coded in C or C++.
Modula-2, Ada, Object Pascal were some of the alternatives without GC.
These are the ones I meant by "faded away".
Though if you're talking about applications in general, and not just WMs; yes, sure.
I've played with the Xlib libraries in Haskell and it wasn't the prettiest code I've ever written ;)
I started to get fed up with writing bindings to libraries not directly supported by Turbo Pascal and pure C was a no go for me.
Of course, it's not all moonpies and pennywhistles. XGB only supports basic extensions like RandR, Xinerama, Render and Composite. But it's missing Xinput and XKB (which are monstrous).
Good work!
Java AOT compilers? What Java AOT compilers?
I know about Excelsior JET ($$$$) and gcj (abandoned). Do you know of any free and good Java AOT compilers?
Most commercial JVMs like IBM Websphere for Real Time, Aonix and JamaicaVM, just to cite three examples, do offer AOT compilation.
Java on IBM i mainframes is translated to the same bytecode used by C and C++ (yes I really mean bytecode not Assembly, IBM i has a kernel JIT).
Then you have RoboVM, CodenameOne, JikesRVM, SubstrateVM.
SubstrateVM is done by the same Oracle Labs working on Graal.
RoboVM is how LibGDX guys are targeting iOS.
And Oracle is changing the OpenJDK to eventually support AOT compilation.
http://openjdk.java.net/jeps/197
Currently the only free on that might suit you, in case you only care about UNIX environments is RoboVM.
I'd love a Java AOT compiler that produces native binaries with no additional dependencies. (I'd even be okay if, as a side effect, some Java features were not supported, making it technically not-Java.)
For small tools and utilities, the JVM requirement is quite onerous, especially when one does not know if the end user has Java installed, or if they do, what version.
Alas, the company I work for will not budget for a Java AOT compiler, and for my hobby programming, the commercial Java AOT compilers are far too expensive to justify.
I'll just keep hoping a good and free (or inexpensive) Java AOT compiler becomes available some day. I would even donate money and/or code if a serious project started.
There some efforts in this direction with the OpenJDK.
As of Java 8 there is an application packager that brings everything together.
https://docs.oracle.com/javase/8/docs/technotes/guides/deplo...
And the size of the native runtime has been reduced.
http://openjdk.java.net/jeps/148
> I'll just keep hoping a good and free (or inexpensive) Java AOT compiler becomes available some day. I would even donate money and/or code if a serious project started.
If you are on GNU/Linux, Mac OS/X check RoboVM.
For the methods in window_manager.rs, they often depend on the window system, but that shouldn't be a problem as I could simply insert a dummy interface.
Tests will follow. Last weeks were just filled with thesis and preparations for my last exam. So I used the coding for relaxation and kinda omitted the tests. I know, I know...behaviour.
I do that by wrapping the C APIs into traits. I have some macros that generate both the proper implementations with ffi calls and mock implementations. Then I can write extensive tests for the high level binding's low level behavior using properly set up mocks.
The 2 exceptions are: loading of the config library. The config file is compiled to a dynamic lib at startup, and I need to read the symbol out of that library to access the configure function. The DynamicLibrary module is unfortunately unsafe. The second exception is in one of the default handler methods, managing the on-the-fly restart of the WM (akin to xmonad). This involves a call to execvp in the libc:: module, and therefore also unfortunately requiring an unsafe block (split into 2 unsafe block, for pointer handling and calling).
It's such a pleasure to look at compared to C++ (though nested generics are still a pain).
https://kintaro.github.io/rust/window-manager-in-rust-01/
Potential trend - instead of learning a new language with Hello World or blog/chat app, it's now via tiling wm.
Tell me, what does it bring to the table compared to other window managers ?
This kind of window managers are often coupled to a programming language and the end user is expected to modify the source to their liking. For example, dwm is written in C, Xmonad in Haskell, awesome in Lua and there's even ones written in Scheme and Common Lisp. In all of these, the idea is that the source code is the configuration, and you're expected to hack on it.
Of course there's some appeal in just doing it in another programming language, even if it has been done before. A tiling window manager is a few thousand lines of code, so it's a neatly sized practice project.
I wouldn't be surprised if this homebrewed WM didn't hold up in features or performance to alternatives like xmonad, dwm, Awesome, i3, etc.
However, the linked repo is an interesting way to showcase both a relatively new technology (Rust) and the innards of WMs, which most people don't look at very often. It gives non-Rust-users a glimpse into Rust's features and capabilities, and a glimpse at how simple (150 loc + 125 lines of config) a window manager can be.
I found it insightful.
The next issue, if we're talking about high-performance http is asynchronous I/O which Rust doesn't currently bundle with (now that Rust has dismantled it's green threading runtime and is now sticking with native threading). However, mio [2], a lower-level Rust library in providing proper I/O abstractions that support async apis and the like is progressing pretty well.
The awesome part about Rust is that you have full control over the system. This allows one to build something like mio even though Rust doesn't support async I/O or a more efficient threading model, etc...
[0]: https://github.com/hyperium/hyper [1]: https://github.com/servo/servo/pull/4198 [2]: https://github.com/carllerche/mio
It's still a bit buggy though. Works perfectly fine here. Been using it as my default WM for 2 weeks straight now. But some bugs do seem to creep up on other machines.
Thank you.
Regarding modularization, I tend to prefer Fowler's criterium that a component should contain code which is usually changed together. So, if you have one component where 95% change slowly and 5% change often, you should split it. However, if you have two components that you almost always have to change at the same time, you should merge them.
95% of the work is done in the core module. The main module is merely for the executable and rarely changes.
I've split it up because the xlib (and future wayland) modules need to refer to the core as a library, so the main module has nothing to do there.
Though I admit that part of the reason is earlier attempts with dynamic libraries, but that was more hassle than it needed to be.
I could merge the core back into the main module, but I'll wait a bit until I do that, just to be sure.
Wow, nice to see a tiling window manager working on that.