Skip to content

A comprehensive guide to setting up the Dynamic Window Manager (DWM) on Arch Linux, tailored for a minimalistic and efficient desktop experience. This guide covers the installation of essential components like Xorg, DWM, dmenu, slstatus, and kitty terminal, along with detailed instructions for configuration and customization.

License

Notifications You must be signed in to change notification settings

codiwithsarthak/dwm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

showcase

Welcome to my DWM installation guide! This guide will walk you through setting up a minimal yet functional DWM (Dynamic Window Manager) environment after a clean install. We'll focus on simplicity, ensuring you get a lightweight, fast, and distraction-free desktop tailored to your needs. Whether you're new to tiling window managers or looking to refine your setup, this guide will help you achieve a sleek and efficient workflow with DWM.

In this setup, we'll rely on essential components like Xorg (the display server) and X11 (the windowing system) to establish the graphical foundation for your DWM environment. Xorg handles all graphical output and user input, while X11 facilitates communication between applications and the display server. These two work together as the core of your minimalistic setup, ensuring that DWM can manage windows with efficiency and speed. Alongside DWM, we’ll also be using dmenu for quick and simple application launching, and kitty as the terminal emulator of choice—offering more features and customization compared to the default st terminal. For additional functionality and we’ll integrate slstatus for a clean and customizable status bar. This combination results in a lightweight, flexible, and visually pleasing setup.

Installing Dependencies

First, we need to install the essential dependencies required for dwm, dmenu, and st. Since we're using Arch Linux, we'll use pacman to handle the installation.

$ sudo pacman -S base-devel git libx11 libxft libxinerama xorg-server xorg-xinit terminus-font

Here's a breakdown of each package:

  • base-devel: A collection of development tools needed to compile software from source, crucial for building DWM and its utilities.
  • git: Used to clone the source code from the official Suckless repositories.
  • libx11 and libxft: These libraries are critical for dwm to compile and run, providing the base functionality for window management and font rendering.
  • libxinerama: Required for multi-monitor setups, enabling dwm to handle multiple displays seamlessly.
  • xorg-server: The display server that manages graphical output, creating the windows that dwm will manage.
  • xorg-xinit: A utility that lets us start the Xorg server manually, essential for initializing your graphical environment.
  • terminus-font: Since dwm is configured to use a monospaced font, and this is a minimal installation, we need to install a font like Terminus to avoid font-related issues.

With these dependencies installed, you're set to build and run dwm with all the necessary components for a smooth and flexible experience.

Download Git Repositories

To begin, we need to download the source code for dwm, dmenu, and slstatus from the Suckless repositories, along with dwm-flexipatch from GitHub. Instead of manually applying patches to dwm, we’ll use dwm-flexipatch, which bundles multiple patches in one place. This allows us to enable or disable features through configuration, making the setup process easier and more flexible without needing to manually modify the source code.

Additionally, we’ll be using kitty as our terminal emulator instead of st for its modern features, GPU acceleration, and enhanced configurability. This makes kitty a more powerful alternative, while still maintaining the minimalistic philosophy we’re aiming for.

First, clone the repositories for dwm, dmenu, and slstatus:

$ git clone https://git.suckless.org/dmenu ~/.config/
$ git clone https://github.com/bakkeby/dwm-flexipatch ~/.config/
$ git clone https://git.suckless.org/slstatus ~/.config/

Now, let's install kitty using pacman:

$ sudo pacman -S kitty

Overview of the Components:

  • dmenu: A dynamic application launcher for X, designed to be lightweight and fast, integrating seamlessly with DWM.
  • dwm-flexipatch: A customizable version of dwm that includes numerous patches, allowing us to configure features without manually applying individual patches.
  • kitty: A fast, modern, and GPU-accelerated terminal emulator, providing enhanced functionality compared to st while maintaining a clean, minimalist feel.
  • slstatus: A lightweight status monitor that integrates with dwm, providing system information like CPU usage, memory stats, and more in a minimalistic format.

By using dwm-flexipatch, kitty, and slstatus, you’ll have a highly flexible, efficient, and performance-optimized desktop environment that remains true to the minimalist design philosophy.

Installing dmenu

To install dmenu, navigate to the directory where you cloned the dmenu repository (in this case, ~/.config/dmenu) and compile it from source. As with most Suckless software, compiling and installing dmenu is straightforward and follows a clean and simple process.

First, enter the dmenu directory:

$ cd ~/.config/dmenu

Next, run the following commands to clean any previous build files and install dmenu:

$ make clean
$ sudo make install
  • make clean: Removes any old or intermediate build files, ensuring that the software is compiled from a fresh state.
  • sudo make install: Compiles dmenu and installs it system-wide, making it available for use within your dwm environment.

Once installed, dmenu will be ready to launch applications quickly and efficiently in your minimalistic setup.

Installing Slstatus

Before proceeding with the installation of slstatus, let's make some customizations to the configuration file (config.def.h) to tailor the status bar to our preferences. This configuration allows you to display system information like volume, CPU usage, memory usage, battery status, network speeds, and more in a clean, minimalistic format.

Here’s my personal configuration, which you can add to your config.def.h to enhance slstatus:

static const struct arg args[] = {
    /* function format          argument */
    { run_command, "[🎧 %s] ", "amixer sget Master | tail -1 | awk '{print $5 }' | sed 's@\\(\\[\\|\\]\\)@@g'" },	
    { cpu_perc,    "[⚡ %s%%] ",   NULL },
    { ram_perc,    "[🚀 %s%%] ",   NULL },
    { battery_state, "[🔌 %s] ",   "BAT1" },
    { battery_perc, "[🔋 %s%%] ",   "BAT1" },
    { wifi_essid,  "[🛜 %s] ",      "wlp0s20f3" },
    { netspeed_rx, "[🔻 %sB/s] ",   "wlp0s20f3" },
    { netspeed_tx, "[🔺 %sB/s] ",   "wlp0s20f3" },
    { datetime,    "[📅 %s]", "%F %r" }
};

Key Features in this Configuration:

  • 🎧 Audio Volume: Displays the current volume level.
  • ⚡ CPU Usage: Shows real-time CPU percentage.
  • 🚀 RAM Usage: Displays the current RAM usage as a percentage.
  • 🔌 Battery State and 🔋 Battery Percentage: Tracks the battery's charge and status.
  • 🛜 WiFi SSID: Displays the name of the connected Wi-Fi network.
  • 🔻/🔺 Network Speeds: Monitors download and upload speeds in real-time.
  • 📅 Date & Time: Displays the current date and time in a simple format.

Compiling and Installing Slstatus

Once you've made the necessary changes to config.def.h, navigate to the slstatus directory and compile it:

$ cd ~/.config/slstatus
$ make clean
$ sudo make install
  • make clean: Cleans out any previous build files to ensure a fresh build.
  • sudo make install: Compiles and installs slstatus system-wide.

After installation, slstatus will seamlessly integrate with your DWM setup, providing an informative and minimalist status bar that matches the aesthetics of your environment.

Compiling and Installing DWM-Flexipatch

Now it’s time to compile and install dwm-flexipatch, along with applying a few custom patches to enhance functionality and usability. Before proceeding, I recommend researching and selecting patches that best fit your workflow. Some popular patches include COOL_AUTOSTART_PATCH and ALT_TAB_PATCH, which can significantly improve your DWM experience.

Customizing Configuration

Before compiling, open config.def.h in your dwm-flexipatch directory and make the following adjustments:

  1. Set the Terminal Command: Since we are using kitty instead of st, modify the terminal command to ensure that dwm launches kitty. Find the line defining termcmd and change it to:

    static const char *termcmd[]  = { "kitty", NULL };
  2. Change the Modifier Key: To set the Super key to the Windows key instead of the Alt key, change the following line:

    #define MODKEY Mod4Mask

    This adjustment allows for more convenient keyboard shortcuts, especially for those accustomed to using the Windows key.

Compiling DWM-Flexipatch

Once you’ve made these modifications to config.def.h, you can compile and install dwm-flexipatch:

$ cd ~/.config/dwm-flexipatch
$ make clean
$ sudo make install
  • make clean: Cleans previous builds to ensure that you start from a fresh state.
  • sudo make install: Compiles dwm-flexipatch and installs it system-wide.

After installation, dwm-flexipatch will be fully operational, enhanced with the custom patches and configurations you selected, providing a tailored, efficient, and visually appealing desktop environment. Enjoy your newly configured DWM setup!

Starting DWM

With xorg-xinit installed, the next step is to create an .xinitrc file in your home directory, which will serve as the startup script for your X session. This file tells the system which window manager and status bar to launch when you start X.

To create the .xinitrc file, open it in your preferred text editor:

$ nvim ~/.xinitrc

In this file, add the following lines:

exec slstatus &
exec dwm

Here, the exec slstatus & command launches slstatus in the background, displaying system information on your status bar, while exec dwm tells the system to execute dwm as your window manager when X starts.

Launching Xorg, Slstatus, and DWM

Once your .xinitrc file is set up, you can start your X session along with slstatus and dwm using the following command:

$ startx

This command will initiate the X server and launch slstatus and dwm, providing you with a minimalistic and efficient desktop environment. Enjoy your new setup!

Links

For additional resources and further reading, check out the following links:

Email: [email protected]

⚖️ License

This project is licensed under the MIT License. For full details, please refer to the LICENSE file.


🎉 Enjoy your new window manager! Have fun exploring, and if you like it, don’t forget to ⭐️ the repo to show your support!

About

A comprehensive guide to setting up the Dynamic Window Manager (DWM) on Arch Linux, tailored for a minimalistic and efficient desktop experience. This guide covers the installation of essential components like Xorg, DWM, dmenu, slstatus, and kitty terminal, along with detailed instructions for configuration and customization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published