Skip to content

Instantly share code, notes, and snippets.

@kmatt
Last active March 19, 2024 10:37
Show Gist options
  • Save kmatt/7ed625d3efd0ab07d7678e7cb78c352d to your computer and use it in GitHub Desktop.
Save kmatt/7ed625d3efd0ab07d7678e7cb78c352d to your computer and use it in GitHub Desktop.
Dwm simple install
# http://dwm.suckless.org/
# s/dnf/rpm-ostree/ for Silverblue
# Xorg requirements
sudo dnf install xorg-x11-server-Xorg xorg-x11-drv-evdev xorg-x11-xinit xorg-x11-xinit-session xterm lightdm
# Build deps
sudo dnf install git make automake gcc gcc-c++
sudo dnf install libX11-devel libXft-devel libXinerama-devel libXrandr-devel
for r in dwm dmenu st slock slstatus
do
git clone https://git.suckless.org/${r}
cd ${r}
git checkout $(git tag | sort -n | tail -n 1)
cd ..
done
#for r in dwm dmenu st slock slstatus; do cp -v ${r}/config.def.h ${r}/config.h; done
sed -i 's/nogroup/nobody/' slock/config.h
# Edit config.h for other components as needed
for r in dwm dmenu st slock slstatus
do
cd ${r}
make && sudo make install
cd ..
done
# Replace .xsession with .xinitrc if not using GDM - startx from a console
#cat <<EOF > ~/.xsession
##!/bin/bash
## xrandr --output _ --mode _
## feh --bg-scale '/path/to/wallpaper.png' &
#exec slstatus &
#exec dwm
#EOF
#
#chmod +x ~/.xsession
# edit $HOME/.vnc/xstartup to launch under vncserver
# xsession for LightDM etc.
sudo cat <<EOF > /usr/share/xsessions/dwm.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Dwm
Comment=Dynamic window manager
Exec=dwm
Icon=dwm
Type=XSession
EOF
# reboot and choose "User Script" from GDM
# Add elements to status bar
head -n -1 config.def.h > config.h
# add ipv4 addresses
ip a | awk -F': ' '/^[0-9]:/ && $2 !~ /lo/ {print "\t{ ipv4, \" %s \",", "\"" $2 "\"},"}' >> config.h
echo "};" >> config.h
# example struct args[] for order in bar:
#
#static const struct arg args[] = {
# /* function format argument */
# { ram_perc, " %s%% mem ", NULL },
# { disk_perc, " %s%% disk ", "/" },
# { ipv4, " %s ", "ens33" },
# { datetime, "%s", "%F %T" },
#};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment