#!/usr/bin/env bash# bspwmrc — pentest-env Rose Pine BSPWM rice.# Deployed to ~/.config/bspwm/bspwmrc (symlinked from the repo by setup-wm.sh).# Executable: bspwm runs this on startup and every `bspc wm -r` reload.## Palette mirrors config/config.sh (Rose Pine):# base #191724 surface #1f1d2e overlay #26233a muted #6e6a86# text #e0def4 love #eb6f92 gold #f6c177 rose #ebbcba# pine #31748f foam #9ccfd8 iris #c4a7e7 hl_high #524f67# --- helpers ----------------------------------------------------------------# run CMD... : start CMD once, killing any stale instance first (idempotent# across reloads so we don't stack duplicate picom/sxhkd/polybar processes).run(){ pgrep -x "$(basename "$1")" >/dev/null ||"$@" & }# --- monitors & desktops ----------------------------------------------------# Six desktops, named numerically; Polybar maps each number to a Nerd-Font# glyph (see polybar/config.ini). Robust if the icon font is missing.# Spread desktops across every connected monitor (handles Parallels resize).mons=$(bspc query -M --names)i=1for m in$mons; docase$iin1) bspc monitor "$m" -d 123456 ;;
*) bspc monitor "$m" -d 7890 ;;
esaci=$((i+1))done# --- global layout ----------------------------------------------------------bspc config border_width 2bspc config window_gap 10bspc config split_ratio 0.50
bspc config borderless_monocle truebspc config gapless_monocle truebspc config single_monocle falsebspc config focus_follows_pointer truebspc config pointer_follows_monitor true# floating-polybar clearance: reserve space at the top so tiled windows sit# BELOW the detached bar (struts aren't reserved when the bar width < 100%).# ≈ bar offset-y(6) + height(30) − window_gap(10) + a little breathing room.# Tune this if you change the bar's height/offset in polybar/config.ini.bspc config top_padding 30# --- borders (Rose Pine) ----------------------------------------------------bspc config normal_border_color "#26233a"# overlay — unfocusedbspc config active_border_color "#403d52"# hl_med — focused, other monitorbspc config focused_border_color "#c4a7e7"# iris — focused windowbspc config presel_feedback_color "#9ccfd8"# foam — preselection# --- window rules -----------------------------------------------------------# desktop assignment for common pentest / daily apps; floaters for tools that# behave badly when tiled. `bspc rule -a CLASS:INSTANCE ...`bspc rule -a Alacritty desktop='^1'bspc rule -a firefox desktop='^2'bspc rule -a Firefox-esr desktop='^2'bspc rule -a Chromium desktop='^2'bspc rule -a 'Code'desktop='^3'bspc rule -a 'burp-StartBurp'desktop='^4'state=tiled # Burp Suite (JDK class)bspc rule -a 'Burp Suite Community Edition'desktop='^4'bspc rule -a Wireshark desktop='^4'bspc rule -a Thunar desktop='^5'bspc rule -a Pcmanfm desktop='^5'# floatersbspc rule -a Pavucontrol state=floating follow=on
bspc rule -a Blueman-manager state=floating
bspc rule -a Nm-connection-editor state=floating
bspc rule -a Lxappearance state=floating
bspc rule -a feh state=floating
bspc rule -a Galculator state=floating
bspc rule -a 'Xfce4-appfinder'state=floating
bspc rule -a Yad state=floating center=on
# --- autostart --------------------------------------------------------------# kill leftovers from a previous session, then (re)launch the stack.pgrep -x sxhkd >/dev/null && pkill -x sxhkd
run sxhkd # hotkey daemon (sxhkdrc)run picom --config "$HOME/.config/picom/picom.conf"# compositorrun dunst # notifications# clipboard:# • Parallels Tools user agents = Mac<->VM shared clipboard inside a bare WM# (no DE to fire their XDG-autostart entries). Needs Parallels Tools installed# (sudo pt-install). Harmless no-ops if the binaries aren't present.# • clipmenud = local clipboard *history* daemon, popped via super+c (sxhkd).for _prl in prlcc prldnd prlcp prlst; docommand -v "$_prl" >/dev/null 2>&1&& run "$_prl"donecommand -v clipmenud >/dev/null 2>&1&& run clipmenud
# system-tray agents (populate the polybar tray) + GUI polkit auth agentcommand -v nm-applet >/dev/null 2>&1&& run nm-applet --indicator
command -v lxpolkit >/dev/null 2>&1&& run lxpolkit
# idle / suspend / manual screen lock via xss-lock -> i3lock (betterlockscreen if present)ifcommand -v xss-lock >/dev/null 2>&1; then xset s 3005# blank/lock after 5 min idle_locker="i3lock -n -c 191724"command -v betterlockscreen >/dev/null 2>&1&&_locker="betterlockscreen -l" run xss-lock -- $_lockerfi# wallpaper: prefer a user-dropped image, else a clean Rose Pine base fill.ifcommand -v feh >/dev/null 2>&1&& ls "$HOME/.config/bspwm/wallpaper".* >/dev/null 2>&1; then feh --no-fehbg --bg-fill "$HOME"/.config/bspwm/wallpaper.* &
elsecommand -v xsetroot >/dev/null 2>&1&& xsetroot -solid '#191724'fi# hide the mouse cursor when idle (optional, no hard dep)command -v unclutter >/dev/null 2>&1&& run unclutter --timeout 3# status bar last (needs bspwm socket up)"$HOME/.config/polybar/launch.sh" &