Skip to content

dwl

dwl installation

# dwl + everything you need for a minimal desktop experience
sudo pacman -S wlroots wayland-protocols xorg-xwayland kitty keyd wmenu slurp grim wl-clipboard \
        fcft tllist libnotify dunst tesseract-data-eng ranger python-pillow ttf-sarasa-gothic noto-fonts noto-fonts-emoji \
            xdg-desktop-portal-gtk polkit mpv ffmpegthumbnailer doublecmd-qt5
cd ~
# The ~/bin dir contains scripts that are called by dwl keybindings
lftp -c 'mirror --parallel=100 https://configs.vectorspace.xyz/bin; exit'
chmod +x ~/bin/*
cd ~/admin
lftp -c 'mirror --parallel=100 https://configs.vectorspace.xyz/dwl; exit'
cd dwl
# First install the fonts
paru -Bi ./iosevka-term-ss12-nerd
# Now perform the usual dwl install
make
sudo make install

someblocks installation

lftp -c 'mirror --parallel=100 https://configs.vectorspace.xyz/someblocks; exit'
cd someblocks
chmod +x blocks/*
chmod +x scripts/route-monitor.sh

Setup these files for battery monitoring:

/etc/udev/rules.d/90-battery-monitor.rules
1
2
3
4
5
6
7
# Rule for when switching to battery
ACTION=="change", SUBSYSTEM=="power_supply", ATTRS{type}=="Mains", ATTRS{online}=="0", \
    RUN+="/bin/sh -c 'pgrep someblocks >/dev/null && pkill -SIGRTMIN+10 someblocks || true'"

# Rule for when switching to AC
ACTION=="change", SUBSYSTEM=="power_supply", ATTRS{type}=="Mains", ATTRS{online}=="1", \
    RUN+="/bin/sh -c 'pgrep someblocks >/dev/null && pkill -SIGRTMIN+10 someblocks || true'"

Reload udev:

sudo udevadm control --reload-rules
sudo udevadm trigger

Setup these files for default ip interface/route monitoring:

~/.config/systemd/user/route-monitor.service
[Unit]
Description=Monitor IP route changes
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=%h/admin/someblocks/scripts/route-monitor.sh
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
~/.config/systemd/user/route-monitor.sh
#!/bin/bash
# Save as route-monitor.sh

ip monitor route | while read line; do
    # Check if the line contains information about the default route
    if [[ "$line" == *"default"* ]]; then
        echo "Default route changed: $line" | logger -t route-monitor

        # Add your commands here
        # For example, to send a signal to someblocks:
        pgrep someblocks >/dev/null && pkill -SIGRTMIN+15 someblocks

        # Or run any other script/command:
        # /path/to/your/script.sh
    fi
done

startup command

From the console:

dbus-run-session sh -c 'someblocks -p | dwl'
someblocks -p | dwl

logs

check out dwl-logs


Comments