Setting up DWM and Suckless tools

Da Window Manager aka the Dynamic one

Requirements

apt install build-essential libx11-dev libxft-dev libxinerama-dev
    apt install acpi acpid acpi-support
acpi -V

We don’t need to modify dmenu, install it as-is already

apt install suckless-tools
dpkg -L suckless-tools | grep bin

Grab the official tarballs from suckless.org and some additional merged patches

wget https://dl.suckless.org/st/st-0.8.4.tar.gz
wget https://st.suckless.org/patches/scrollback/st-scrollback-20200419-72e3f6c.diff
wget https://st.suckless.org/patches/scrollback/st-scrollback-mouse-20191024-a2c479c.diff
wget https://st.suckless.org/patches/clipboard/st-clipboard-0.8.3.diff

wget https://dl.suckless.org/dwm/dwm-6.2.tar.gz
wget https://dwm.suckless.org/patches/attachaside/dwm-attachaside-20180126-db22360.diff
wget https://dwm.suckless.org/patches/inplacerotate/dwm-inplacerotate-6.2.diff
wget https://dwm.suckless.org/patches/pertag/dwm-pertag-6.2.diff
wget https://dwm.suckless.org/patches/systray/dwm-systray-6.2.diff
#wget https://dwm.suckless.org/patches/fancybar/dwm-fancybar-6.2.diff
wget https://pub.nethence.com/bin/dwm/dwm-fancybar-6.2.after-systray.diff.txt
mv dwm-fancybar-6.2.after-systray.diff.txt dwm-fancybar-6.2.after-systray.diff

git clone git://git.suckless.org/slstatus

and configs from nethence

wget https://pub.nethence.com/bin/dwm/dwmconfig.h.txt
wget https://pub.nethence.com/bin/dwm/slconfig.h.txt

Prepare a customzed terminal. Cannot mix openclipboard with clipboard patches.

tar xzf st-0.8.4.tar.gz 
cd st-0.8.4/
patch -p1 < ../st-scrollback-20200419-72e3f6c.diff
patch -p1 < ../st-scrollback-mouse-20191024-a2c479c.diff
patch -p1 < ../st-clipboard-0.8.3.diff
cp config.def.h config.h
vi config.h

-wchar_t *worddelimiters = L" ";
+wchar_t *worddelimiters = L" `'\"()[]{}‘’";

-char *termname = "st-256color";
+char *termname = "xterm";

-       { XK_ANY_MOD,           Button2, selpaste,       {.i = 0},      1 },
+       { XK_ANY_MOD,           Button3, clippaste,      {.i = 0},      1 },

make clean
make install
cd ../

Prepare a customzed window manager.

tar xzf dwm-6.2.tar.gz
cd dwm-6.2/
patch -p1 < ../dwm-attachaside-20180126-db22360.diff
patch -p1 < ../dwm-inplacerotate-6.2.diff
patch -p1 < ../dwm-pertag-6.2.diff
patch -p1 < ../dwm-systray-6.2.diff
patch -p1 < ../dwm-fancybar-6.2.after-systray.diff
diff -bu config.def.h ../dwmconfig.h 
ln -s ../dwmconfig.h config.h
make clean
make install
cd ../

Prepare a better upper status bar. Show current keymap in systray.

cd slstatus/
diff -bu config.def.h ../slconfig.h 
ln -sf ../slconfig.h config.h
make clean
make install
cd ../

Multi-screen

   Mod1-Shift-,
          Send focused window to previous screen, if any.

   Mod1-Shift-.
          Send focused window to next screen, if any.

[Solved] dwm - move/toggle current window to second screen/projector https://bbs.archlinux.org/viewtopic.php?id=179227

Ready go to

Enable for both X and Xsession

as root

vi /usr/share/xsessions/custom.desktop

[Desktop Entry]
Name=Xsession
Exec=/etc/X11/Xsession

apt install adwaita-icon-theme-full gnome-tweaks
# gnome-tweak-tool gnome-shell-extensions

as user

vi .xinitrc

#!/bin/bash

xrandr --output HDMI-A-1-0 --auto --right-of eDP
xsetroot -solid black

#conky -d
#gnubiff --systemtray &
#xautolock -notify 10 -notifier 'notify-send "Screen will lock in 10 seconds"' \
    #       -time 5 -locker "xtrlock" &
    #       -time 5 -locker "xlock" &

slstatus &
exec dwm
#exec gnome-session

ln -s .xinitrc .xsession
gnome-tweaks # --> Appearance...
rm -rf .config/gtk-3.0/
rm -rf .config/gtk-4.0/

Additional notes

For the record, Terminator’s selection delimiters are

" -,./?%&#:_"

You will still be able to reach the Ubuntu settings as such

gnome-control-center

More on slstatus

Every 5 seconds to ease that iostat call, hence removing seconds from the date

vi config.h

const unsigned int interval = 5000;
static const char unknown_str[] = "n/a";
#define MAXLEN 2048

static const struct arg args[] = {
        /* function format              argument */
        { load_avg, "%s ",              NULL },
        { cpu_perc, "CPU:%2s%% ",       NULL },
        { ram_perc, "RAM:%2s%% ",       NULL },
        { run_command, "I/O:%s ",       "iostat -x -p /dev/sda | grep '^sda ' | awk '{print $NF}'" },
        { netspeed_tx, "TX:%6s ",       "eth0" },
        { netspeed_rx, "RX:%6s ",       "eth0" },
        { datetime, "%s",               "%F %H:%M" },
};

Resources

https://wiki.ubuntu.com/CustomXSession

https://dwm.suckless.org/tutorial/

https://medium.com/hacker-toolbelt/dwm-windows-manager-in-ubuntu-14958224a782

https://github.com/algiuxass/dwm-dotfiles

layout state

https://unix.stackexchange.com/questions/12072/how-do-i-get-current-keyboard-layout https://github.com/grwlf/xkb-switch https://github.com/nonpop/xkblayout-state

https://gist.github.com/sergeykish/765118/017d4d7d31d0be5d26cfd67a976a8e874171016d

https://bbs.archlinux.org/viewtopic.php?id=46581 http://members.dslextreme.com/users/jbromley/files/ruby-xkb.tar.bz2 https://sourceforge.net/projects/xxkb/

got showlayout.sh from there! https://superuser.com/questions/1300091/show-current-keyboard-layout