dwm

I was using the Cinnamon desktop environment in Linux Mint around 2019. After reading about tiling window managers, i tried dwm.

Even though i was able to use dwm and i appreciated the simplicity of suckless philosophy , due to my lack of skill, i was constantly having difficulties. I was having great difficulties when reapplying patches after version upgrades.

So i tried to use swaywm in Linux Mint. Since the latest version of Sway was available only in Arch , i installed it.

Installation

I followed the steps in document steps_in_moving_to_dwm. Installed the packages required for compiling dwm.

apt-get install build-essential libx11-dev libxinerama-dev

Install from sources

$ mkdir sources
$ cd sources/
$ git clone https://git.suckless.org/dwm
$ git clone https://git.suckless.org/dmenu
$ git clone https://git.suckless.org/st

From within dmenu,dwm and st folders, run the below command to install each of them:

$ sudo make clean install

Configuration

Icons

Downloaded dwm.desktop and dwm.png from dwm deb package based on the below steps in a manual way:

https://askubuntu.com/questions/37156/how-to-restore-a-single-file-from-a-package/ ↗

sudo apt-get download dwm
mkdir dwm_deb
dpkg-deb -x dwm_6.1-5_amd64.deb dwm_deb/
sudo cp xsessions/dwm.desktop /usr/share/xsessions/
sudo cp icons/dwm.png /usr/share/icons/

Bluetooth

To use bluetooth adapter in dwm and pulseaudio, need to make the below change

cat /etc/pulse/system.pa
...
load-module module-bluetooth-policy
load-module module-bluetooth-discover
...

Restart dwm once.

Bluetoothctl is the best tool and it works great to configure…

The following is needed for a bluetooth adapter. Not sure why the default given in the above webpage is not working

static const char *upvol[ ] = { "/usr/bin/pactl", "set-sink-volume", "bluez_sink.11_58_02_C8_02_64.a2dp_sink", "+5%", NULL };
static const char *downvol[ ] = { "/usr/bin/pactl", "set-sink-volume", "bluez_sink.11_58_02_C8_02_64.a2dp_sink", "-5%", NULL };
static const char *mutevol[ ] = { "/usr/bin/pactl", "set-sink-mute", "bluez_sink.11_58_02_C8_02_64.a2dp_sink", "toggle", NULL };

Check https://wiki.archlinux.org/title/bluetooth#Console/ ↗

Followed below document for remapping volume keys in keyboards without special Fn key

https://gist.github.com/palopezv/efd34059af6126ad970940bcc6a90f2e/ ↗

#include <X11/XF86keysym.h>
/* Add somewhere in your constants definition section */
static const char *upvol[ ] = { "/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL };
static const char *downvol[ ] = { "/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL };
static const char *mutevol[ ] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL };

/* If you have a small laptop keyboard or don't want to spring your fingers too far away. */

static Key keys[ ] = {
{ MODKEY, XK_F11, spawn, {.v = downvol } },
{ MODKEY, XK_F9, spawn, {.v = mutevol } },
{ MODKEY, XK_F12, spawn, {.v = upvol } },
};

Resolution for suspend and Resume problem

https://askubuntu.com/questions/848698/wake-up-from-suspend-using-wireless-usb-keyboard-or-mouse-for-any-linux-distro ↗

grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/1-2/product:USB2.0 WLAN
/sys/bus/usb/devices/2-1/product:Usb Mouse
/sys/bus/usb/devices/3-1/product:USB Keyboard
/sys/bus/usb/devices/usb1/product:EHCI Host Controller
/sys/bus/usb/devices/usb2/product:UHCI Host Controller
/sys/bus/usb/devices/usb3/product:UHCI Host Controller
/sys/bus/usb/devices/usb4/product:UHCI Host Controller
/sys/bus/usb/devices/usb5/product:UHCI Host Controller
prabu@onepc:~$ grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/2-1/power/wakeup:disabled
/sys/bus/usb/devices/3-1/power/wakeup:enabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled
/sys/bus/usb/devices/usb3/power/wakeup:disabled
/sys/bus/usb/devices/usb4/power/wakeup:disabled
/sys/bus/usb/devices/usb5/power/wakeup:disabled
root@onepc:~# echo enabled > /sys/bus/usb/devices/usb3/power/wakeup
prabu@onepc:~$ grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/2-1/power/wakeup:disabled
/sys/bus/usb/devices/3-1/power/wakeup:enabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled
/sys/bus/usb/devices/usb3/power/wakeup:enabled
/sys/bus/usb/devices/usb4/power/wakeup:disabled
/sys/bus/usb/devices/usb5/power/wakeup:disabled

Test the resume feature from keyboard

prabu@onepc:~$ sudo pm-suspend

On confirming that the feature is working, make it permanent.

prabu@onepc:~$ cat /etc/rc.local
echo enabled > /sys/bus/usb/devices/usb3/power/wakeup

The alast part related to making this permanent did not work. Alternate approach

https://forums.linuxmint.com/viewtopic.php?t=277163 ↗

$sudo tee /lib/systemd/system-sleep/K100_Sigmachipkb_enable_wakeup
<<'EOB'
#!/bin/sh
case $1 in
pre)
echo enabled > /sys/bus/usb/devices/usb3/power/wakeup
;;
esac
EOB

Then make that file executable

$sudo chmod +x /lib/systemd/system-sleep/K100_Sigmachipkb_enable_wakeup

To enable a shortcut in dwm for suspend, the following lines were added. Shift+Super+s

 static const char *suspend[] = { "/usr/bin/systemctl", "suspend", NULL
};
{ MODKEY|ShiftMask, XK_s, spawn, {.v = suspend } },

Fonts

Installed the Hack font.

$ sudo apt install fonts-hack-ttf

References:


© Prabu Anand K 2020-2026