Dwm: Difference between revisions

From Alpine Linux
(changed sentence, fixed headings, moved alpine suck from Alpine Linux:Listings page)
Line 1: Line 1:
{{DISPLAYTITLE:dwm}}[https://dwm.suckless.org/ dwm] is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts.
{{DISPLAYTITLE:dwm}}[https://dwm.suckless.org/ dwm] is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. This page covers installing the binary packages and installing from source along with dependencies for dwm (dynamic window manager), dmenu (dynamic menu) and st (simple terminal) along with configuration information.  


This guide covers:
== Prerequisites ==


* Installing dependencies for the [https://suckless.org suckless] tools and installing firefox
* Installing from source or from repository dwm (dynamic window manager), dmenu (dynamic menu), st (simple terminal)
* Configuring the new profile to run dwm at login.
== Prerequisites ==
{{:Include:Desktop prerequisites}}
{{:Include:Desktop prerequisites}}
* [[Alpine_setup_scripts#setup-xorg-base|Install Xorg]]
* [[Alpine_setup_scripts#setup-xorg-base|Install Xorg]]
== Installation ==
== Installation ==


Install dwm binary packagaes {{Pkg|dwm}}, {{Pkg|dmenu}} and {{Pkg|st}}:{{Cmd|# apk add dwm dmenu st}}
Alpine Linux provides  binary packages for dwm (dynamic window manager), dmenu (dynamic menu), st (simple terminal). This allows new users to experience dwm without compiling software. To install the following binary packages {{Pkg|dwm}}, {{Pkg|dmenu}} and {{Pkg|st}}, issue the command:{{Cmd|# apk add dwm dmenu st}}


== Installing from source  ==
Proceed to [[#Configuration|configuration]] to configure and start using dwm immediately with default settings. If you are new to dwm, refer to the [https://dwm.suckless.org/tutorial/ official dwm tutorial].


=== Installing dependencies ===
To customize dwm, the source code must be edited and compiled for the changes to take effect. Refer [[#Installing from source|Installing from source]] for complete instructions.
{{Note|'''git make gcc g++ libx11-dev libxft-dev libxinerama-dev ncurses''' are needed to install suckless tools from source.


'''dbus-x11''' is needed for the dbus system (enables firefox running in dwm to open in a tile)
=== Installing from source  ===


The last three '''adwaita-gtk2-theme adwaita-icon-theme font-dejavu''' are optional, but recommended for a nicer looking firefox.}}
==== Install dependencies ====


The command to install the dependencies:
The following Alpine Linux packages are needed to install and compile suckless tools.
{{cmd|# apk add {{pkg|git}} {{pkg|make}} {{pkg|gcc}} {{pkg|g++}} {{pkg|libx11-dev}} {{pkg|libxft-dev}} {{pkg|libxinerama-dev}} {{pkg|ncurses}} {{pkg|dbus-x11}} {{pkg|firefox-esr}} {{pkg|adwaita-gtk2-theme}} {{pkg|adwaita-icon-theme}} {{pkg|font-dejavu}} {{pkg|libxft-dev}}}}
{{pkg|git}} {{pkg|make}} {{pkg|gcc}} {{pkg|g++}} {{pkg|libx11-dev}} {{pkg|libxft-dev}} {{pkg|libxinerama-dev}} {{pkg|ncurses}} {{pkg|libxft-dev}}  


=== Installing suckless tools ===
{{pkg|dbus-x11}} package is needed for the dbus system as it enables Firefox running in dwm to open in a tile.
Change to the {{Path|/tmp directory}}.
 
{{cmd|$ cd /tmp}}
The {{pkg|adwaita-gtk2-theme}} {{pkg|adwaita-icon-theme}} {{pkg|font-dejavu}} are optional, but recommended for a nicer looking firefox.
then execute:
 
{{cmd|# git clone https://git.suckless.org/dwm}}
The command to install all the dependencies:
Once downloaded, go to the dwm directory
{{cmd|# apk add {{pkg|git}} {{pkg|make}} {{pkg|gcc}} {{pkg|g++}} {{pkg|libx11-dev}} {{pkg|libxft-dev}} {{pkg|libxinerama-dev}} {{pkg|ncurses}} {{pkg|libxft-dev}}  {{pkg|dbus-x11}} {{pkg|firefox-esr}} {{pkg|adwaita-gtk2-theme}} {{pkg|adwaita-icon-theme}} {{pkg|font-dejavu}}}}
{{cmd|# cd dwm}}
 
To install, run:
==== Installing suckless tools ====
{{cmd|# make clean install}}
 
Next, go up one directory level
Create a directory {{Path|/usr/src}} directory using the command: {{Cmd|# mkdir -p /usr/src/suckless}}
{{cmd|# cd ..}}
{{Note| The {{Path|/tmp}} directory can be used if you want to keep the downloaded files in tmpfs filesystem.}}
to install dmenu:
Change to the {{Path|/usr/src/suckless directory}}:{{cmd|$ cd /usr/src/suckless}}
{{cmd|# git clone https://git.suckless.org/dmenu
Download and install {{ic|dwm}}: {{cmd|# git clone https://git.suckless.org/dwm
# cd dwm
# make clean install}}
Next, go up one directory level {{cmd|# cd ..}}
Download and install {{ic|dmenu}} launcher: {{cmd|# git clone https://git.suckless.org/dmenu
# cd dmenu
# cd dmenu
# make clean install}}
# make clean install}}
Finally, go up one more directory level
Finally, go up one more directory level: {{cmd|# cd ..}}
{{cmd|# cd ..}}
Download and install {{ic|st}} terminal: {{cmd|# git clone https://git.suckless.org/st
to install st:
{{cmd|# git clone https://git.suckless.org/st
# cd st
# cd st
# make clean install}}
# make clean install}}


== Setting up your profile ==
== Configuration ==
Change to your home directory:
{{cmd|$ cd ~}}
Create or edit {{Path|.xinitrc}} with at least the following:
{{cat|~/.xinitrc|exec dwm}}
Save the file and exit vi.


Next, create or edit {{Path|.profile}} with at least the following:
=== Set up your profile ===
{{cat|~/.profile|startx}}
 
Change to your home directory:{{cmd|$ cd ~}}
Create or edit {{Path|.xinitrc}} with at least the following: {{cat|~/.xinitrc|exec dwm}}
Next, create or edit {{Path|.profile}} with at least the following: {{cat|~/.profile|startx}}


{{Note|If you install additional programs that call your `$SHELL` with the POSIX `-l` login flag, you'll need to make launching `startx` conditional, otherwise X will attempt to launch every time your shell is called with the login flag.
{{Note|If you install additional programs that call your `$SHELL` with the POSIX `-l` login flag, you'll need to make launching `startx` conditional, otherwise X will attempt to launch every time your shell is called with the login flag.
Line 69: Line 64:


== See also ==
== See also ==
 
* [https://dwm.suckless.org/ Official dwm website]
* [https://sr.ht/~bt/alpine-suck/ Alpine Suck] Desktop installer for Alpine Linux based on the suckless philosophy
* [https://wiki.gentoo.org/wiki/Dwm gentoo wiki page on dwm]
* [https://wiki.gentoo.org/wiki/Dwm gentoo wiki page on dwm]
* [https://wiki.archlinux.org/title/Dwm Dwm - Archwiki page on dwm]
* [https://wiki.archlinux.org/title/Dwm Dwm - Archwiki page on dwm]

Revision as of 16:09, 23 June 2025

dwm is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. This page covers installing the binary packages and installing from source along with dependencies for dwm (dynamic window manager), dmenu (dynamic menu) and st (simple terminal) along with configuration information.

Prerequisites

Installation

Alpine Linux provides binary packages for dwm (dynamic window manager), dmenu (dynamic menu), st (simple terminal). This allows new users to experience dwm without compiling software. To install the following binary packages dwm, dmenu and st, issue the command:

# apk add dwm dmenu st

Proceed to configuration to configure and start using dwm immediately with default settings. If you are new to dwm, refer to the official dwm tutorial.

To customize dwm, the source code must be edited and compiled for the changes to take effect. Refer Installing from source for complete instructions.

Installing from source

Install dependencies

The following Alpine Linux packages are needed to install and compile suckless tools. git make gcc g++ libx11-dev libxft-dev libxinerama-dev ncurses libxft-dev

dbus-x11 package is needed for the dbus system as it enables Firefox running in dwm to open in a tile.

The adwaita-gtk2-theme adwaita-icon-theme font-dejavu are optional, but recommended for a nicer looking firefox.

The command to install all the dependencies:

# apk add git make gcc g++ libx11-dev libxft-dev libxinerama-dev ncurses libxft-dev dbus-x11 firefox-esr adwaita-gtk2-theme adwaita-icon-theme font-dejavu

Installing suckless tools

Create a directory /usr/src directory using the command:

# mkdir -p /usr/src/suckless

Note: The /tmp directory can be used if you want to keep the downloaded files in tmpfs filesystem.

Change to the /usr/src/suckless directory:

$ cd /usr/src/suckless

Download and install dwm:

# git clone https://git.suckless.org/dwm # cd dwm # make clean install

Next, go up one directory level

# cd ..

Download and install dmenu launcher:

# git clone https://git.suckless.org/dmenu # cd dmenu # make clean install

Finally, go up one more directory level:

# cd ..

Download and install st terminal:

# git clone https://git.suckless.org/st # cd st # make clean install

Configuration

Set up your profile

Change to your home directory:

$ cd ~

Create or edit .xinitrc with at least the following:

Contents of ~/.xinitrc

exec dwm

Next, create or edit .profile with at least the following:

Contents of ~/.profile

startx
Note: If you install additional programs that call your `$SHELL` with the POSIX `-l` login flag, you'll need to make launching `startx` conditional, otherwise X will attempt to launch every time your shell is called with the login flag.

Contents of ~/.profile

if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ]; then startx fi

Log out or reboot. dwm will run the next time you log in. Press Alt+p to launch dmenu. Type firefox then press enter. Firefox will load and run in tile 9.

See also