You are not logged in.

#1 2021-05-05 17:43:26

Colonel Panic
Member
Registered: 2018-11-13
Posts: 283

Installing ST, DMENU and DWM in Arch Linux

Hi again. Further to the instructions I posted here for installing i3-gaps in Arch, I recently came across this guide for installing dwm in Arch (or any Arch-related distro, such as Manjaro or Arch Labs) and thought I'd share it on here.

Before actually installing anything you should (obviously) update the database and the system:

 sudo pacman -Syyu 

What follows is all written from the guide (David Sadler)'s viewpoint;

Continuing my Arch Linux installation I now have a user account for daily use. However this only provides me with a terminal. What I would like is a traditional multi-window desktop environment which will require me to install two things. A window system of some sort and a layout manager. For this installation I'm going with Xorg and dwm. For those that are not aware dwm is dynamic window manager for Xorg that has been developed by Suckless. Since by default dwm expects st to be installed as the system's terminal and also makes use dmenu to allow you to launch applications I will installed both of them in addition to dwm.

Install Dependencies

First off I need to install the dependencies required by st, dmenu and dwm. Since this is Arch Linux I use pacman to do this.

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

    base-devel: Since I will be installing from source this package contains various tools to compile software.
    git: Is needed to get the source code from the suckless git repositories.

    libx11 and libxft: Dependancies required by dwm otherwise it will fail when trying to compile it.

    xorg-server: Is the display server that provides the windows that dwm will manage.
    xorg-xinit: Allows us to start the display server.

    terminus-font: Dwm is configured to use a monospaced font and since I installed a barebones system I need to install such a font now.

Download Git Repositories

The source code for the software is available from the Suckless git repositories so I simply clone them.

 $ mkdir -p ~/.local/src 
 $ git clone git://git.suckless.org/st ~/.local/src/st
 $ git clone git://git.suckless.org/dmenu ~/.local/src/dmenu
 $ git clone git://git.suckless.org/dwm ~/.local/src/dwm

Install ST

I install st by first moving to the directory created when cloning the repository.

 $ cd ~/.local/src/st

Then it's as simple as compiling and installing the software with the below commands.

 $ make clean
 $ sudo make install

Configure and Install DMENU

Again move to the directory created earlier.

 $ cd ~/.local/src/dmenu

Before compiling, a small edit needs to be made to the file config.mk.

 $ nvim config.mk

Since I have not installed Xinerama on this system I need to comment out any flags that reference this, otherwise dmenu will fail during the compiling.

# XINERAMALIBS  = -lXinerama
# XINERAMAFLAGS = -DXINERAMA

Again compiling and installing is done with the below commands.

 $ make clean
 $ sudo make install

Configure and Install DWM

For the final time move to the directory created earlier.

 $ cd ~/.local/src/dwm

As with dmenu the same edit needs to be made to the file config.mk.

 $ nvim config.mk
# XINERAMALIBS  = -lXinerama
# XINERAMAFLAGS = -DXINERAMA

Compile and install as usual.

[Note; if you want to change the auxiliary key from Alt to Win, a good idea in my view, you have to change the auxiliary key in the config.h (or config.def.h if there's no config.h) file from Alt;

#define MODKEY Mod1Mask

to Win;

#define MODKEY Mod4Mask

]

Then you can install;

 $ make clean
 $ sudo make install

Starting DWM

Since I have installed xorg-xinit I need to create a .xinitrc in my home folder.

 $ nvim ~/.xinitrc

The contents of this file is just.

exec dwm

I can now start xorg and dwm with the below command.

 $ startx

davidtsadler.com

Last edited by Colonel Panic (2021-05-06 00:06:15)

Offline

#2 2021-05-05 18:09:39

Colonel Panic
Member
Registered: 2018-11-13
Posts: 283

Re: Installing ST, DMENU and DWM in Arch Linux

Postscript; since unlike David I don't use dwm as my main window manager, I haven't been able to add dwm to the lightdm login menu. I have to access it by booting into openbox and switching into dwm from the openbox menu.

BTW, I apologise if the above post is long winded and tedious to read through but all I can say is that it was even more so to edit and format. Still I feel it was worth it in the end.

Last edited by Colonel Panic (2021-05-05 18:23:58)

Offline

#3 2021-05-06 00:52:26

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 8,003
Website

Re: Installing ST, DMENU and DWM in Arch Linux

Colonel Panic wrote:

add dwm to the lightdm login menu

Something to try (I haven't tested this with dwm):
*) Check what command you need to start a dwm session - if there is a dwm-session or something, use that, otherwise plain 'dwm' might work...
*) Look in /usr/share/xsessions and use the .desktop files there (Openbox, BunsenLabs?) as templates to make a new one called "Dwm".

Log out (maybe have to reboot), and with any luck you might have a new Dwm login menu item.

EDIT: I just checked dwm with apt-file, and it looks as if there should already be a /usr/share/xsessions/dwm.desktop so dwm should be appearing in the LightDm login menu. vyJoYBP.gif

Last edited by johnraff (2021-05-06 00:56:17)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#4 2021-05-06 02:33:37

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,413

Re: Installing ST, DMENU and DWM in Arch Linux

^ Colonel Panic is installing dwm from source so he will need to create a dwm.desktop file in /usr/share/xsessions in order for dwm to show up in LightDm.

Last edited by PackRat (2021-05-06 02:36:06)


You must unlearn what you have learned.
    -- yoda

Offline

#5 2021-05-06 06:51:17

Colonel Panic
Member
Registered: 2018-11-13
Posts: 283

Re: Installing ST, DMENU and DWM in Arch Linux

Thanks (and johnraff too); I may try that next time.

Switching into a tiling manager from the menu of a stacking one isn't a big deal for me though; I do it all the time when I'm running Slackware. It's useful when I'm learning my way around a new (to me) tiling manager, to be able to get its key bindings page up in Firefox when I'm in Openbox or Blackbox, and then to switch into it so that I can learn how it operates from its wiki (the Arch wiki is always useful, as is Debian's wiki for most of them).

Last edited by Colonel Panic (2021-05-06 09:41:30)

Offline

#6 2021-05-14 20:02:04

Colonel Panic
Member
Registered: 2018-11-13
Posts: 283

Re: Installing ST, DMENU and DWM in Arch Linux

PackRat wrote:

^ Colonel Panic is installing dwm from source so he will need to create a dwm.desktop file in /usr/share/xsessions in order for dwm to show up in LightDm.

Thanks! I've just tried this (having copied the dwm.desktop file over from another distro) and can confirm that it works.

Last edited by Colonel Panic (2021-05-15 09:06:40)

Offline

Board footer

Powered by FluxBB