Before building and using dwl, you’ll need to install the following dependencies:
- wayland, wayland-protocols
- wlroots_0_19 (dependency for dwl)
- foot (terminal emulator)
- base-devel (so we can compile dwl)
- git (to clone the 2 repos for dwl, and slstatus)
- wmenu (a dmenu clone for wayland)
- wl-clipboard (wayland clipboard tool)
- grim, slurp for screenshots
- swaybg (for wallpapers)
- firefox (web browser)
- ttf-jetbrains-mono-nerd (font)
sudo pacman -S wayland wayland-protocols wlroots_0_19 foot base-devel git wmenu wl-clipboard grim slurp swaybg firefox ttf-jetbrains-mono-nerdsudo emerge -av dev-libs/wayland dev-libs/wayland-protocols gui-libs/wlroots x11-terms/foot sys-devel/base-devel dev-vcs/git gui-apps/wmenu gui-apps/wl-clipboard media-gfx/grim gui-apps/slurp gui-apps/swaybg www-client/firefox media-fonts/jetbrains-monoAdd to your configuration.nix:
environment.systemPackages = with pkgs; [
wayland
wayland-protocols
wlroots_0_19
foot
git
wmenu
wl-clipboard
grim
slurp
swaybg
firefox
jetbrains-mono
];To customize the colors in dwl, you’ll need to edit the config.h file before compiling. This setup uses the TokyoNight color scheme.
The current configuration uses TokyoNight colors with 32-bit RGBA values:
/* TokyoNight colors (0xRRGGBBAA) */
static const uint32_t col_bg = 0x1a1b26ff; /* background */
static const uint32_t col_fg = 0xa9b1d6ff; /* foreground */
static const uint32_t col_blk = 0x32344aff; /* black (normal) */
static const uint32_t col_red = 0xf7768eff; /* red */
static const uint32_t col_grn = 0x9ece6aff; /* green */
static const uint32_t col_ylw = 0xe0af68ff; /* yellow */
static const uint32_t col_blu = 0x7aa2f7ff; /* blue */
static const uint32_t col_mag = 0xad8ee6ff; /* magenta */
static const uint32_t col_cyn = 0x0db9d7ff; /* cyan (highlight) */
static const uint32_t col_brblk = 0x444b6aff; /* bright black */These colors are used in different parts of the interface:
SchemeNorm(vacant tags): Usescol_fgoncol_bgwithcol_brblkbordersSchemeSel(selected tag): Usescol_cynoncol_bgwithcol_magbordersSchemeOcc(occupied tags): Usescol_cynoncol_bgwithcol_cynbordersSchemeUnder(underlines): Usescol_magoncol_bgwithcol_magborders
- Edit
config.hin your dwl source directory - Modify the color hex values (format: 0xRRGGBBAA where AA is alpha)
- Update the
colorsarray to use your preferred color combinations - Recompile dwl with
make clean && make - Reinstall with
sudo make install
Popular alternative color schemes:
- Gruvbox:
#282828,#3c3836,#ebdbb2,#fb4934 - Nord:
#2e3440,#3b4252,#eceff4,#88c0d0 - Dracula:
#282a36,#44475a,#f8f8f2,#bd93f9
slstatus is a status bar for dwl that displays system information like time, battery, CPU usage, etc. It uses the same TokyoNight colors for consistency.
git clone https://git.suckless.org/slstatus
cd slstatus
sudo make clean installEdit config.h to customize what information is displayed:
static const struct arg args[] = {
/* function format argument */
{ datetime, "%s", "%F %T" },
{ separator, " | " },
{ battery_perc, "%s%%", "BAT0" },
};The provided script starts both slstatus and dwl together, with slstatus feeding information to dwl’s status bar and swaybg setting a wallpaper.
#!/bin/sh
slstatus -s | dwl -s "sh -c 'swaybg -i /home/tony/walls/wall1.png &'"If you want to add this to your PATH for easy access:
mkdir ~/.local/bin
cp ~/start_dwl.sh ~/.local/bin/start_dwl
vim ~/.bashrc
# Add this line to ~/.bashrc:
export PATH="$HOME/.local/bin:$PATH"
source ~/.bashrcNow you can start your desktop environment by simply running start_dwl from anywhere.
Here are all the configured keybinds for this dwl setup. MODKEY is typically the Super/Windows key.
| Key Combination | Action | Description |
|---|---|---|
MODKEY + d | wmenu | Launch application menu |
MODKEY + Return | foot | Launch terminal |
| Key Combination | Action | Description |
|---|---|---|
Ctrl + F12 | snip script | Take screenshot (via script) |
MODKEY + s | /home/tony/scripts/snip.sh | Take screenshot |
MODKEY + Shift + S | Screenshot selection | Select area and copy to clipboard |
| Key Combination | Action | Description |
|---|---|---|
MODKEY + j | Focus next | Focus next window in stack |
MODKEY + k | Focus previous | Focus previous window in stack |
MODKEY + q | Kill client | Close focused window |
MODKEY + Return | Zoom | Move focused window to master |
MODKEY + Tab | View last tag | Switch to previously viewed tag |
MODKEY + e | Toggle fullscreen | Make window fullscreen |
MODKEY + Shift + Space | Toggle floating | Make window floating/tiled |
| Key Combination | Action | Description |
|---|---|---|
MODKEY + t | Tiled layout | Set layout to tiled |
MODKEY + f | Floating layout | Set layout to floating |
MODKEY + m | Monocle layout | Set layout to monocle |
MODKEY + Space | Toggle layout | Cycle through layouts |
MODKEY + h | Decrease master | Decrease master area size |
MODKEY + l | Increase master | Increase master area size |
MODKEY + i | Increase masters | Increase number of masters |
MODKEY + p | Decrease masters | Decrease number of masters |
| Key Combination | Action | Description |
|---|---|---|
MODKEY + b | Toggle bar | Show/hide status bar |
MODKEY + a | Toggle gaps | Enable/disable window gaps |
| Key Combination | Action | Description |
|---|---|---|
MODKEY + [1-9] | View tag | Switch to tag 1-9 |
MODKEY + Shift + [1-9] | Move to tag | Move window to tag 1-9 |
MODKEY + 0 | View all tags | Show windows from all tags |
MODKEY + Shift + ) | Tag all | Tag window with all tags |
| Key Combination | Action | Description |
|---|---|---|
MODKEY + , | Focus left monitor | Focus monitor to the left |
MODKEY + . | Focus right monitor | Focus monitor to the right |
MODKEY + Shift + < | Move to left monitor | Move window to left monitor |
MODKEY + Shift + > | Move to right monitor | Move window to right monitor |
| Key Combination | Action | Description |
|---|---|---|
MODKEY + Shift + Q | Quit dwl | Exit window manager |
Ctrl + Alt + Backspace | Terminate server | Force quit (emergency exit) |