DWM - minimalism in action

How it all began


Once upon a time, when there were still no laptops (that is, when they could not afford), I had a computer at my place - a Pentium somewhere, 64Mb of RAM, 2Gb HDD, a 14 "display.
KDE and Gnome could not have stubbornly ( even if they wanted to) run on such hardware, but I wanted to read the mail and even read the book on the Internet, I really wanted to read the book too. Having rummaged in the network, I set up IceWM, which worked pretty well on this equipment, Firefox started and mail

It started my hobby for fast and functional environments does not go away even a year so that I don’t yl something new. Today, I just want to tell you about DWM

In addition to working in DWM, there is little experience with awesome (a complicated config), xmonad (it’s also not easy to configure the first minimum, the default config is very simple), scrotwm (I don’t like the concept of supporting multiple monitors ). From the “fast” environments, I worked with IceWM, Fluxbox for a long time.

Pros DWM - Performance. Reliability. Simplicity.


Having a minimum of binary dependencies and not using anything extraneous, even the absence of a configuration file that is readable at runtime can be a plus: this increases the reliability of the system as a whole.

The gain in the speed of drawing and launching applications can really be determined by eye. There is a feeling that the computer is “flying” while on KDE the same computer is “functioning normally” at best.

Regarding simplicity, I want to say the following. Perhaps this is extreme - editing the config in config.h, but learning Lua (as in awesome), or haskell (like in xmonad) is also extremes: trying to build a normal
config using copy-paste in xmonad and awesome is a long and tedious thing,
learn a new programming language all the more.

In my opinion, of all minimalistic environments, DWM is one of the simplest window managers.
It is a single binary file, without a configuration file and any launch options. The configuration is carried out by editing the C include file.

In this case, the default configuration works immediately:
  1. tiling (modkey + t) and floating (Floating) modes (modkey + f)
  2. in tiling mode - increase / decrease the number of clients of the master window (modkey + i, modkey + d)
  3. resizing areas (modkey + h, + l)
  4. and other standard features of tiling mediators.


T e we have a minimum of necessary functionality of a tiling manager.

Custom keys are easy to configure. If this is a call to an external program, first you need to define a variable with its call, and then call it. Let’s say how I redefined the volume keys:

static const char * incr_sound [] = {"amixer", "set", "Master", "2dB +", NULL};
static const char * decr_sound [] = {"amixer", "set", "Master", "2dB-", NULL};
...
static Key keys [] = {
...
	{0, XF86XK_AudioRaiseVolume, spawn, {.v = incr_sound}},
	{0, XF86XK_AudioLowerVolume, spawn, {.v = decr_sound}},


To quickly launch programs - I installed dmenu.



static const char * dmenucmd [] = {"dmenu_run", "-fn", font, "-nb", colors [0] [2], "-nf",
				  colors [0] [1], "-sb", colors [1] [2], "-sf", colors [0] [1], NULL};
...
{Mod1Mask, XK_F2, spawn, {.v = dmenucmd}},


A little bit about my preferences and environment requirements


Working as a programmer involves several significant points in the configuration of the development environment.

Generally speaking, you can certainly work in any environment without changing the basic settings ...
... but then kilometers of mouse running around the table and often (subconscious) annoyance from boring multiple execution of the same type of actions are inevitable.

The topic of intensifying work and improving the functionality of development tools is very broad
and affects a lot of aspects and there are millions of possible configurations.

I personally need the following (at least I can not imagine how
these features can work ):

  • Quick opening on Hot Key of the most frequently used programs: text editor, terminal, browser: configured as dmenu, modkey + S + Enter, modkey + c
  • Quick transfer of these windows left / right, from screen to screen: configured as modkey + o
  • The ability to run other programs, preferably with auto-prompts and without brakes (as, for example, in KDE by Alt + F2): Alt + f2, Modkey + r
  • Launching programs at window manager startup: via .xinitrc
  • Display current date and time somewhere to be visible on the screen: via xsetroot in a loop
  • sys tray - a place on the screen where there will be icons from any messengers such as skype, network configuration, etc.: an external program stalonetray
  • many desktops, so that there is enough space to place all my working programs: included
  • Russification: means of xorg
  • current indication of processor load (sysload): your script + xsetroot
  • indication of the discharge of the battery, current time: your script + xsetroot


What is tiling-wm


You can read in more detail here: en.wikipedia.org/wiki/Tiling_window_manager

For me personally, I’ll briefly state how: Tiling is when you don’t have to look for a hidden window when there are a lot of them , or when you don’t need to spend time dragging the windows with the mouse here and there. Management of applications and their location on the screen occurs mainly from the keyboard. There is no need to long press Alt + Tab - all windows are in sight.

To amuse you, I’ll tell you a recent story about “window visibility”.
I worked at KDE ... I have two Monica - the one on the laptop and the one on the table.
Working in Skype + Tmux of a remote session with a colleague, I accidentally somehow moved the window wrong and then: __ could not find it__ !?

I already had this in KDE when moving the window it “fell through” to the neighboring desktop, but I couldn’t find it after that!

In general, the situation turned out to be strange, we had to interrupt our rally, since we had discussed almost everything. What about the window? It was found. By accident ... After ~ 2 hours - I found it in the "invisible" area between monitors, which was formed from the fact that the monitors were of different sizes and the virtual screen in KDE was rectangular. It rolled shorter in the lower right corner, there is a "dead" zone of 432 pixels in height. Here is such a story.

Morality: this would never have happened in Tiling mode since all the windows are in sight.

The specifics:

DWM is a minimalistic WM, while providing everything that I need for a successful and productive work.

  1. 10 pre-configured workspaces with modkey + n buttons
  2. 3 modes - tiling, floating, monocle
  3. full window title
  4. battery indication, date + time, sysload
  5. work in tiling mode: opening new windows, area sizes, increasing / decreasing the number of wizard clients
  6. task floating and location for specific applications. gimp as an example.
  7. dmenu - quick dynamic menu
  8. my scripts - display configuration, sleep, set-desktop-wallpaper


For items 1-8, see my video. I specifically drove the monitor into a lower resolution mode so that it was clearly visible on small monitors:



Cons & Deficiencies:


  • I think that the default configuration should be convenient for everyone. why, by default,
    the mode switch (modkey-t, modkey-f) occurs for all desktops I do not understand:
    this is inconvenient. had to install a patch: dwm.suckless.org/patches/pertag
  • my program for setting the date, etc. in the toolbar sometimes loses connection with the
    X server. I don’t know if DWM is to blame for this or if I have any problems with xorg.
    I had to enter a restart cycle.
  • all the same, the lack of config and restart is annoying. I think that for the C language
    this is a simple task to parse the file name / value. The cycle of changing config.h
    compilation had to go through 50 times until I completed everything that I needed.


conclusions



Perhaps for many DWM it will be too minimalistic for everyday work. But I can recommend one thing - by installing it once and adjusting it for myself, DWM will be a very reliable assistant in those situations when KDE or something else refuses to work correctly (long and dreary rebuilding packages in Gentoo is the most striking example of such force majeure).

External links



Also popular now: