Skip to content

zootedb0t/dwm

Repository files navigation

dwm - dynamic window manager dwm

dwm is an extremely fast, small, and dynamic window manager for X. This build aims to remain close to base dwm and be functional at the same time, so only limited patches have been applied. I try to keep it updated with latest commits from suckless.

Look

Screenshot_2023-07-03-04-51-49_1920x1080

Screenshot_2023-06-26-03-17-12_1920x1080

Screenshot_2023-02-22-10-45-34_1920x1080

Requirements

In order to build dwm you need the Xlib header files.

  • Nerd Font - I personally like JetBrains font. You can use whatever you like. Don't use monospace fonts they tend to make icon smaller.
  • picom - Compositor for X11 window.
  • xwallpaper - For setting wallpaper.
  • dmenu - A suckless program that can be used as application launcher and has been used in various scripts. Check my build.
  • st - Default terminal. Change termcmd value in config.def.h to change default terminal.
  • slstatus - For statusbar in dwm. Check my build.
  • pywal - A tool that generates a color palette from the dominant colors in an image. Allows dwm to change colors according to wallpaper.
  • sxhkd - For external keybindings.
  • xmenu - Menu utility for X.
  • xclickroot - xclickroot runs a command every time a given mouse button is pressed on the root window.
  • Xcb Header Files - The X protocol C-language Binding (XCB) for window swallowing.
  • Imlib2 - Library that does image file loading and saving as well as rendering, manipulation, arbitrary polygon support needed for winicon patch.

Features

  • Various layout have been added like spiral, dwindle, deck, bstack, horizgrid, gaplessgrid, centerdmaster, centeredfloatingmaster, etc. Right click on layout icon and you get a list of all layouts to choose from. Change layout order by editing layoutmenu.sh. Make sure this script is in your path.
  • Read .Xresources colors, so dwm changes colors according to wallpaper without compiling or restarting the dwm.
  • Window swallowing. If a program starts from terminal, the program will temporarily take its place to save space. This behavior is controlled through isterminal and noswallow values in config.def.h
  • Gaps are allowed across all layouts.
  • Support actual fullscreen for any window using single keybindings and fake fullscreen the ability to have windows go fullscreen within the size and position the window is currently in.
  • Both mfact and cfact can be changed. This provides the ability to assign different weights to clients in their respective stack.
  • Statusbar can be made transparent while keeping text opaque. Just change baralpha to your liking in config.def.h.
  • DWM bar support system-tray. So wifi, bluetooth, vpn can be managed from statusbar.
  • Support scratchpad.
  • Floating clients always open in center.
  • Floating window can be resized, moved from keyboard.
  • Supports right click on root window to get a menu. Menu entries are defined in a shell script.
  • Support drawing window icon on bar.

Keybindings

Action Key
Open Terminal super+shift+enter
Open Dmenu super+p
Kill Client super+shift+c
Toggle Gaps super+ctrl+0
Fullscreen super+f
Fake Fullscreen super+shift+f
Toggle Scratchpad super+shift+s
Non-vacant-tags(next) super+]
Non-vacant-tags(previous) super+[
Move window(next) super+shift+]
Move window(previous) super+shift+[
Next Layout super+/
Previous Layout super+shift+/
Increase mfact super+l
Decrease mfact super+h
Increase cfact super+\
Decrease cfact super+shift+\
Move Floating Window super+ctrl+k,j,l,h
Resize Floating Window super+ctrl+shift+k,j,l,h
Restart dwm super+shift+q

For more keybindings see config.def.h.

Running dwm

Installation

git clone https://github.com/zootedb0t/dwm
cd dwm
make
sudo make install

In scripts directory there is autostart script this is used to autostart app and dwm itself. Symlink this autostart script to ~/.config/dwm/autostart. Like this: ln -s ~/dwm/scripts/autostart ~/.config/dwm/autostart.

Edit config.mk to match your local setup (dwm is installed into the /usr/local namespace by default).

With startx

Add the following line to your .xinitrc to start dwm using startx:

exec ~/.config/dwm/autostart

With display manager

Copy dwm.desktop into /usr/share/xsessions/dwm.desktop Make sure to give Exec your autostart script path.

Configuration

The configuration of dwm is done by editing config.def.h. After editing use make clean and recompile the program using sudo make install. If you want dwm to change colors according to your wallpaper. Then include pywal colors in Xresources file.

Misc notes

Bar

The bar is slstatus. All the script used in slstatus can be found in scripts directory. My slstatus build.

Menu

Menu is generated using xmenu. Entries are written in shell script.

patches

All applied patches can be found in patches directory.

Click to view
  • dwm-alpha-systray - Add tranparency to systray and dwm bar.
  • dwm-center - Center floating client window.
  • dwm-cfacts-vanitygaps - This patch differentiates between inner and outer gaps as well as horizontal and vertical gaps.
  • dwm-cyclelayouts - Cycles through all avaiable layouts.
  • dwm-fullscreen-compilation - Fake fullscreen and acutal fullscreen patch.
  • dwm-inplacerotate - This patch provides keybindings to perform 'in place' rotations.
  • dwm-moveresize - This allows you to move and resize dwm's floating clients using keyboard bindings.
  • dwm-pertag - This patch keeps layout, mwfact, barpos and nmaster per tag.
  • dwm-status2d - Status2d allows colors and rectangle drawing in your dwm status bar.
  • dwm-statuspadding - This makes the amount of horizontal and vertical padding in the status bar into configurable options.
  • dwm-swallow - Clients marked with isterminal in config.h swallow a window opened by any child process.
  • dwm-xrdb - Allows dwm to read colors from xrdb `.Xresources` at run time.
  • dwm-scratchpad - Allows you to spawn or restore a floating terminal window.
  • dwm-layoutmenu - This patch adds a context menu for layout switching. Right click on layout icon to bring a menu prompt, and switches to selected one.
  • dwm-restartsig - dwm can now be restarted via `MOD+CTRL+SHIFT+Q` or by `kill -HUP dwmpid`.
  • dwm-winicon - This a patch that enables dwm to show window icons.
  • dwm-statusbutton - Adds a clickable button to the left hand side of the `statusbar`.
  • dwm-reorganizetags - Shifts all clients per tag to leftmost unoccupied tags.

picom

To prevent picom from drawing shadow on your statusbar add this to your picom.conf

shadow-exclude = [
    "class_g *= 'dwm'",
    "name *= 'dwm'"
]

If you have blur-background = true then add these to prevent picom from blurring dwm bar "class_g = 'dwm'"