dotfiles/.config/bspwm/bspwmrc
Sarthak f341989335 Sakura Line: retheme the whole desktop from the wallpaper
Palette sampled from bspwm/wallpaper/wallpaper.jpg and applied per-role
(not per-hex, so terminal green stays green and nvim's LineNr/Comment
stay recessive) across st, kitty, polybar, rofi, dunst, nvim, qt5ct/qt6ct
and GTK 2/3/4.

Also:
- rofi drun centred, icons enabled
- polybar translucent (true ARGB) and rounded; picom corner-radius, with
  the desktop layer and fullscreen windows excluded
- fix qt5ct color_scheme_path pointing at a nonexistent /home/carrie
- export QT_QPA_PLATFORMTHEME so qt6ct is actually consulted
- point GTK at an icon theme that exists on this system
- add .config/rice: one-shot install.sh (--dry-run supported), package
  list, vendored st config.h (gitignored upstream) and the particles
  wallpaper-layer source, so a clone reproduces the rice

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn3dHfbgNYdbZvzb1b3GQt
2026-09-04 00:19:36 +05:30

99 lines
3.5 KiB
Bash
Executable file

#! /bin/bash
# Qt apps follow qt6ct, which reads ~/.config/qt6ct/colors/dc.conf
export QT_QPA_PLATFORMTHEME=qt6ct
# Start sxhkd if it's not already running
pgrep -x sxhkd >/dev/null || sxhkd -c ~/.config/bspwm/sxhkdrc &
# Start picom
picom --config $HOME/.config/bspwm/picom.conf &
# Set window manager name to LG3D to fix some Java applications display issues
wmname LG3D
# Vars
export XDG_CURRENT_DESKTOP="bspwm"
sh -c 'function shenv() { export "$1=$2"; }; source ~/.env;'
# Workspaces Configuration
bspc monitor DisplayPort-0 -d 1 2 3 4 5 6 7 8
# Enable window focus follow mouse pointer
bspc config focus_follows_pointer true
# Auto set monitor
monitor=$(xrandr --query | grep " connected" | awk '{ print $1 }' | head -n 1)
resolution=$(xrandr --query | grep -A1 "^$monitor" | grep -Eo '[0-9]+x[0-9]+' | sort -V | tail -n 1)
refresh_rate=$(xrandr --query | grep -A1 "^$monitor" | grep -Eo '[0-9]+\.[0-9]+' | sort -V | tail -n 1)
if [[ -n $monitor && -n $resolution && -n $refresh_rate ]]; then
xrandr --output "$monitor" --mode "$resolution" --rate "$refresh_rate"
fi
# Set the border colors for focused and normal windows
bspc config focused_border_color "#92b9ea"
bspc config normal_border_color "#201b30"
bspc config active_border_color "#3d3752"
bspc config presel_feedback_color "#b483c0"
bspc config border_width 2
bspc config borderless_monocle true
# Set mouse cursor to left pointer
xsetroot -cursor_name left_ptr
# Configure gaps and window gap size
bspc config gapless_monocle false
bspc config window_gap 10
# Configure actions for moving and resizing floating windows with the mouse (mod4 = Super/Windows key)
bspc config pointer_modifier mod4
bspc config pointer_action1 move
bspc config pointer_action2 resize_side
bspc config pointer_action3 resize_corner
# Rules
bspc rule -a feh state=floating
bspc rule -a '*:sun-awt-X11-XWindowPeer' manage=off
bspc rule -a 'vlc' state=floating center=true
bspc rule -a 'Blueman-manager' state=floating center=true
bspc rule -a 'qt5ct' state=floating rectangle=900x600+0+0 center=true
bspc rule -a 'qt6ct' state=floating rectangle=900x600+0+0 center=true
bspc rule -a 'ark' state=floating center=true
bspc rule -a 'Xarchiver' state=floating center=true
bspc rule -a 'pavucontrol' state=floating center=true
bspc rule -a 'Yad' state=floating center=true
bspc rule -a 'Blueman-manager' state=floating center=true
bspc rule -a 'Gnome-calculator' state=floating rectangle=360x500+0+0 center=true
bspc rule -a 'loupe' state=floating rectangle=1200x800+0+0 center=true
bspc rule -a 'pavucontrol' state=floating rectangle=920x450+0+0 center=true
bspc rule -a 'gamescope' desktop=11
bspc rule -a 'legcord' desktop=10
# Resources and Utilities
# DISPLAY/XAUTHORITY must reach systemd-user + D-Bus or graphical portal backends
# (xdg-desktop-portal-gtk, used by browser file pickers) fail with "cannot open display".
systemctl --user import-environment DISPLAY XAUTHORITY XDG_CURRENT_DESKTOP
dbus-update-activation-environment --systemd DISPLAY XAUTHORITY XDG_CURRENT_DESKTOP
xrdb merge $HOME/.Xresources
xsettingsd &
dunst &
flameshot &
sh $HOME/.config/polybar/launch.sh
sh $HOME/.config/scripts/polkitkdeauth.sh
sh $HOME/.config/scripts/set-wallpaper.sh
# Clipboard sync
if command -v clipnotify >/dev/null 2>&1 && command -v xclip >/dev/null 2>&1 && command -v cliphist >/dev/null 2>&1; then
(
while clipnotify; do
xclip -o -selection c | cliphist store
done
) &
fi
# Apps to open on startup
legcord &
xset s off &
xset s noblank &
xset dpms 0 0 0 &