Skip to content

elken/dwm

Repository files navigation

DWM - Dynamic Window Manager

dwm is an extremely fast, small and dynamic window manager for X.

This repository exists as my fork of dwm (currently just 6.1), and as such has references and links to my own config.

CAVEAT EMPTOR

Requirements

I mostly use Arch Linux, as such package names/file paths will be tied to Arch’s. If you wish to fork this, it should be quite simple to get working.

Dependencies

The following packages are needed to build:

  • libx11
  • libxft
  • libxinerama

A full running version also depends on the following packages:

  • xorg-xsetroot (for status and dwm needs it)
  • xorg-setxkbmap (for startup)
  • xorg-xset (for startup)
  • nitrogen (setting wallpaper)
  • network-manager-applet (network management)
  • dunst (notification daemon)
  • picom (compositor)
  • gnome-screensaver (for screen lock)

And for the status:

  • sysstat
  • acpi

Installation

You might have to modify config.mk to match any local changes (although I haven’t had to). This is also currently where the theme flags are specified.

After making any changes, run sudo make install clean to install dwm and create a dwm.desktop file for working with login managers.

Running DWM

This dwm setup depends on a number of other utilities which get run from the Startup and Status scripts.

It also assumes it’s being run through a login manager, but passing the Startup script to xinit should work.

Customisation

For simplicity, my dwm.c is already patched with everything in patches/ but all the ordered patches should apply from a base 6.1.

There also exists a number of themes (shown below)

assets/nord.pngassets/gruvbox.pngassets/solarized_dark.pngassets/solarized_light.png
Nord (-DNORD)Gruvbox (-DGRUVBOX)Solarized Dark (-DSOLARIZED_DARK)Solarized Light (-DSOLARIZED_LIGHT)

Which can be displayed with the associated flag in config.mk. All included themes also styles clients appropriately, as well as dmenu.

Adding a theme

If you wish to contribute your own theme, add an appropriate #IFDEF THEMENAME block in config.h to specify the colours, and further down for dmenu.

You also need to adjust the block in dwm.c within updatesystray to specify the background.

Status

The status area is a simple script with a number of functions, currently just CPU, RAM, time, speaker status and battery (unless full).

It relies on xsetroot to echo a large formatted string. I accept that this isn’t the best way to write this however programmers are lazy.

Screen Locking

I use gdm as my login manager because it’s simple, clean and it just works.

Along with the below config, closing the lid locks and suspends the computer.

/etc/systemd/logind.conf:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=ignore