5.0 KiB
dwm (i3-like, compiled from source)
Versioned customisation for suckless dwm. This
directory is the source of truth; the installer
../scripts/single_use/features/setup_dwm.sh
clones upstream dwm master, copies these files on top, applies the two
dwm.c patches, and builds. Nothing here is a full fork of dwm — only the
files we actually change live in the repo, so upstream stays bleeding-edge.
How a build works
setup_dwm.sh runs, in order:
git clone/git reset --hard origin/masterinto~/.local/src/dwm(always the latest upstream).- Copy
config.hover the clone. heal_config— auto-merge any new upstream scalar knob (e.g.refreshrate) that the currentdwm.cneeds but ourconfig.hpredates.- Apply
patches/focus-on-click.patchandpatches/fullscreen-pointer-confine.patchtodwm.c— done withperlrewrites (robust against upstream line shifts), notgit apply. The.patchfiles are the human-readable record of exactly those changes. make && sudo make install.- Compile
pointer-confine.cand installbin/*to/usr/local/bin.
Because the clone is reset every run, the patches are re-applied each build, which is what keeps "always latest master" working.
Files
| Path | What it is |
|---|---|
config.h |
dwm config: Mod4, Dracula colours, 10 tags, bottom bar, vim-style focus/move, multi-monitor keys, media keys, movestack/togglefullscr defined inline so dwm.c needs no extra patch for them. |
pointer-confine.c |
Standalone helper: traps the X pointer on the current monitor with XFixes pointer barriers until killed. Used for fullscreen gaming so the cursor can't slide onto the other screen. |
patches/focus-on-click.patch |
No-ops enternotify/motionnotify so the pointer never changes focus or switches monitors — focus only changes on click or via keys. |
patches/fullscreen-pointer-confine.patch |
Hooks setfullscreen/unmanage to start/stop pconfine-auto so the cursor-lock turns on automatically when a window goes fullscreen. |
bin/dwm-session |
lightdm session launcher (autostart + dwmstatus + exec dwm). |
bin/dwmstatus |
Status feeder: CPU/GPU/board temps, RAM, load, volume, clock → root window name. dwmstatus once prints the line without xsetroot. |
bin/dwm-rebuild |
Recompile ~/.local/src/dwm in place (quick local rebuild). |
bin/switch-wm |
Flip the lightdm boot session between i3 and dwm. |
bin/pconfine-auto |
on/off single-instance control of the pointer-confine daemon (called by the dwm hooks and the panic key). |
Customising
- Permanent change: edit the file here (e.g.
config.h), then re-runsetup_dwm.sh. Log out / back in to apply (dwm has no live restart). - Quick experiment: edit
~/.local/src/dwm/config.hdirectly and rundwm-rebuild— but note the nextsetup_dwm.shrun overwrites it from here.
Notable bindings (Mod = Super)
Mod+Returnterminal,Mod+ddmenu,Mod+ffullscreen,Mod+Shift+qkill,Mod+Shift+eexit,Mod+Shift+rrecompile.- Multi-monitor:
Mod+,/Mod+.(orMod+Ctrl+←/→) focus the other screen;Mod+Shift+,/Mod+Shift+.(orMod+Ctrl+Shift+←/→) throw the window there. Mod+Shift+pforce-releases the fullscreen cursor-lock if a barrier sticks.
Dependencies
Build/runtime: libx11 libxft libxinerama gcc make dmenu terminator, plus
xorg-xsetroot for the status bar and libxfixes for pointer-confine
(present as a dep of Xorg). Install missing ones interactively — this system's
pacman is a wrapper that deadlocks when driven non-interactively.