Fork me on GitHub

bars and waves

caprice blog

bars and waves

Must have special(3) - tiled window management xmonad

A long time ago, when I just graduated, I used windows for development. Terminals, line breaks, docker, environment variables, and so on were all big pits and small pits. Soon I changed to centos, which is a comfort. If you do n’t toss, you will die. I made a terrible impression on Gentoo, experienced all kinds of ups and downs, installed it, and was dumbfounded. I turned on a terminal, and installed a window manager. Awesome, i3, dwm, and so on. The development environment is worthy of the word "perfect".

What the hell is this?


Tile window manager. Users of common windows and macos may hear this word for the first time. Their native window managers are floating, that is, you can drag the window with the mouse, drag One window covers another window, this is called a floating window manager. Popular distributions of ubuntu, centos, etc. also come with floating window managers. Correspondingly, the tile type can not be dragged at will, Can not cover each other, the windows must be arranged exactly flat, covering the entire screen. You can also drag and arrange the windows under windows, it will look like a tiled window.

The tile type can not freely display the window, only the keyboard can be used to manipulate the window. It seems that the tile type only has a lot of restrictions, but the duality of things tells us that restraint can also bring freedom. Compared to the mouse, it is pure The keyboard control is extremely efficient. Open, close, move windows, switch focus, switch desktop and other operations are controlled by the universal keyboard. The smoothness brought by this operation method is somewhat like evolution from nano to vim.


There are many tiled windows. Take xmonad as an example. Install directly under ubuntu / debian: ` apt update apt install xmonad After installation, restart and enter dm (display manager), which is the login interface. There will be a button to select wm (window manager), select the xmonad you just installed, and then log in. Some dm bugs will lead to the entry. Wm, you can edit the $ home / .xsessionrc file at this time, fill in `` exec xmonad `` ` For details, please refer to the file .xsessionrc in my repository

After logging in, the screen is blank. Do n’t panic at this time. You did n’t install the book badly, anyway, I was a little bit panic when I installed it for the first time. Type ctrl + shift + enter to create a new terminal window, ok you are done . Next take a few minutes to [official tutorial] ( familiarize yourself with common operations.

One hundred feet head closer

There are only one terminal window on the empty screen.Of course, xmonad also supports adding various components, such as imitating the taskbar in the lower part of windows. The degree of customization is extremely high, provided that it has a little Haskell.

In addition to opening the terminal, we also need to open firefox to access the Internet, open mplayer to watch videos, and open various applications. Take firefox as an example. After typing firefox in the terminal, firefox is opened, but the original terminal does not disappear, and the firefox output log is displayed. We want the terminal to close automatically after opening firefox. Nohup firefox & doesn't work, redirecting output is useless. At this time, the disown command comes in handy.Firefox & >> / dev / null & disown && exitPerfect solution to pain points.

The Chinese input method fcitx needs to be started when xmonad is started, and the screen yellowing software redshift must also be started. These need to be written into some configuration files. For details, please refer to my repository [ config] ( The files,, xinitrc, etc.

The configuration is complete! Get up early, press the power, enter the account to log in, ctrl + shift + enter to open the terminal,firefox to open the browser, use Tridactyl to surf the flowers. Ctrl + 2 cut to the desktop 2 and run a few Command again ctrl + 1 back to firefox. Another nice morning.


Later I abandoned my favorite gentoo, favored ubuntu, and finally invested in the embrace of kali. But I always give up on xmonad.