Dwm: Difference between revisions

From Alpine Linux
m (Use pkg template.)
Line 6: Line 6:
* Installing from source or from repository dwm (dynamic window manager), dmenu (dynamic menu), st (simple terminal)
* 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.
* Configuring the new profile to run dwm at login.
<br>


= Prerequisites =
= Prerequisites =
Line 14: Line 12:
* [[Repositories#Enabling_the_community_repository|Enable the Community repository]]
* [[Repositories#Enabling_the_community_repository|Enable the Community repository]]
* [[Alpine_setup_scripts#setup-xorg-base|Install Xorg]]
* [[Alpine_setup_scripts#setup-xorg-base|Install Xorg]]
<br>


== Installing from binary repository ==
== Installing from binary repository ==
Line 25: Line 21:


=== Installing dependencies ===
=== Installing dependencies ===
{{Note|
{{Note|'''git make gcc g++ libx11-dev libxft-dev libxinerama-dev ncurses''' are needed to install suckless tools from source.
'''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)
'''dbus-x11''' is needed for the dbus system (enables firefox running in dwm to open in a tile)
Line 33: Line 28:


The command to install the dependencies:
The command to install the dependencies:
{{cmd|# apk add git make gcc g++ libx11-dev libxft-dev libxinerama-dev ncurses dbus-x11 firefox-esr adwaita-gtk2-theme adwaita-icon-theme font-dejavu}}
{{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}}}}


=== Installing suckless tools dwm, dmenu, and st from source ===
=== Installing suckless tools dwm, dmenu, and st from source ===

Revision as of 18:09, 28 December 2023

dwm is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts.

This guide covers:

  • Installing dependencies for the 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

Installing from binary repository

# apk add dwm dmenu st

This will install dwm, dmenu and st

Installing from source

Installing dependencies

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)

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

The command to install the dependencies:

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

Installing suckless tools dwm, dmenu, and st from source

Change to the /tmp directory.

$ cd /tmp

then execute:

# git clone https://git.suckless.org/dwm

Once downloaded, go to the dwm directory

# cd dwm

To install, run:

# make clean install

Next, go up one directory level

# cd ..

to install dmenu:

# git clone https://git.suckless.org/dmenu

# cd dmenu

# make clean install

Finally, go up one more directory level

# cd ..

to install st:

# git clone https://git.suckless.org/st

# cd st

# make clean install

Setting up your profile

Change to your home directory:

$ cd /home/<yourusername>

Create .xinitrc:

$ vi .xinitrc

Add this line:

Contents of ~/.xinitrc

exec dwm

Save the file and exit vi.

Next, create .profile.:

$ vi .profile

Add this line:

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

See also