Back to Projects

Linux & Window Management ·

bspwm Dotfiles: Custom bspwm Configuration & Scripts

A vanilla-compatible rebuild of gh0stzk's bspwm-dotfiles, reconfigured for laptop compatibility with custom shell integrations for power-profile and refresh-rate switching.

BSPWM Desktop Rice Preview
BSPWM Desktop Rice Preview
BSPWM Desktop Rice Preview

Minimalist and clean desktop interface featuring a custom EWW status bar, system information panel, resource graphs, workspace navigation, and hardware sliders.

Overview & Problem Statement

A custom "rice" (personalized desktop environment) on a lightweight window manager like BSPWM is often visually striking but notoriously fragile. Most pre-configured setups depend heavily on custom third-party package repositories (like gh0stzk-dotfiles or chaotic-aur) that clutter package lists and compromise system stability during core upgrades.

Furthermore, generic BSPWM configurations rarely address laptop-specific needs out-of-the-box, such as visual telemetry, battery throttling alerts, dynamic backlight polling, and responsive network transitions.

This project is a complete, vanilla-compatible rebuild and reconfiguration of gh0stzk's bspwm-dotfiles, designed specifically for laptop users. It strips away all third-party package requirements, migrating dependencies to official Arch Linux and AUR channels, while adding custom shell functions for active performance switching (such as power profiles and screen refresh rates) and debloating the system by removing unnecessary dependencies .


Architectural Breakdown

The entire desktop environment is composed of modular, UNIX-philosophical utilities coordinated through configuration scripting:

1. BSPWM (Binary Space Partitioning Window Manager)

Unlike traditional tiling window managers, BSPWM does not maintain a complex internal state layout engine. Instead, it represents windows strictly as leaves of a binary tree, where each internal node splits a container horizontally or vertically.

  • IPC Management: Managed entirely via bspc, which sends command sockets to the daemon.
  • Autostart Orchestration: Controlled via .config/bspwm/bspwmrc, a standard executable shell script that sets desktop splits, border widths, focus rules, and initializes system services.

2. EWW (Elkowar's Wacky Widgets)

The visual centerpiece is the top/side status bar and slide-out control center, reconfigured and optimized for laptop telemetry.

  • Markup Layer: Inherited and customized using Yuck (a Lisp-like declarative syntax) to build and streamline widgets.
  • Styling Layer: Tailored using vanilla CSS/SCSS to maintain modern glassmorphism backdrops and clean glowing accents.
  • Dynamic Pollers: Fine-tuned to use non-blocking background polling intervals (e.g. 1s for CPU/RAM, 10s for network state, and 5s for battery) to keep UI rendering asynchronous, preventing any block on input threads while saving precious battery cycles.

3. Keyboard Shortcut Layer (sxhkd)

Keybindings are handled externally by sxhkd (Simple X Hotkey Daemon). This decouples hotkeys from the window manager itself, meaning that if the window manager crashes, shortcuts still process signals. It executes bspc instructions directly, managing window nodes, layouts, focus movement, and resizing.


Themes & Instant Rice Swapper

The original gh0stzk project is renowned for its modular theme engine. This configuration inherits and streamlines that Rice Switcher, enabling hot-swapping between two highly polished setups: z0mbi3 (an ultra-minimal monochrome layout) and andrea (a colorful, widget-heavy layout) with a single CLI call or UI widget tap.

Rather than forcing an X server restart (which closes active applications), the inherited switcher script performs a seamless layout reload:

  1. Config Modification: Rewrites symlinks for ~/.config/eww, ~/.config/rofi, and ~/.config/dunst to point to the selected theme directory.
  2. EWW Reinitialization: Kills existing EWW bar instances, clears variables, and respawns the new widgets layout instantly.
  3. BSPWM/sxhkd Reload: Fires a bspc wm -r signal to re-read window rules and forces sxhkd to reload its config keymaps.

Laptop Power & Performance Integrations

To solve the laptop-specific challenge of balancing battery life and performance, this configuration introduces custom system controls directly integrated into the shell environment (.zshrc):

  • Dynamic Refresh Rate Handlers: Implemented shell functions (60hz and 144hz) that query the active primary display (e.g., eDP or eDP-1) via xrandr and dynamically adjust display timings and refresh rates.
  • Unified Hardware Profiles: Created custom command aliases (performance and battery) to orchestrate multi-layered hardware states:
    • Performance Mode: Sets the system power governor to performance via powerprofilesctl and simultaneously pumps the display refresh rate to 144Hz for buttery-smooth interaction.
    • Battery Saver Mode: Throttles the system power governor to power-saver and drops the display to 60Hz instantly, dramatically extending laptop battery longevity.
  • Intelligent Debloating: Stripped away unnecessary background daemons and reduced the 18 default themes down to 2 core presets.

Core Dependencies & Config Files

To reproduce this environment on a vanilla Arch Linux system, only standard upstream packages are required:

ComponentStandard PackagePurpose
Window ManagerbspwmCore binary tree window layouts
Hotkey DaemonsxhkdKeybinding mapping and custom script execution
Widget EngineewwStatus bar, system panel, calendar widgets
Notification DaemondunstLightweight, CSS-stylable desktop notifications
Launcher / MenurofiUnified application launcher and power menu (inherited and reconfigured)
Audio Controlpipewire-pulse, pamixerSound engine configuration and CLI keys mapping
Backlight CLIbrightnessctlFast, rootless display brightness adjustments

Project Outcome

This configuration is a personal, iterative project aimed at tailoring the window manager and shell experience to my exact hardware needs and workflow preferences, rather than relying on a generalized template that carries design decisions or components I don't use. By rebuilding it from vanilla sources and debloating the environment specifically removing redundant modules, unused themes and dependencies like Polybar. I was able to achieve a highly optimized, clean and completely reliable setup that strikes a perfect balance for daily use on a laptop.