initial commit

This commit is contained in:
2026-09-14 15:31:20 -05:00
commit 438546d84f
44 changed files with 3292 additions and 0 deletions
+318
View File
@@ -0,0 +1,318 @@
; ==========================================================================
; polybar — Catppuccin Macchiato
; Font: Inconsolata Nerd Font
; Docs: https://github.com/polybar/polybar/wiki
;
; Hardware-specific values (battery, adapter, network interfaces, backlight)
; are injected as environment variables by launch.sh, with sane fallbacks.
; ==========================================================================
[colors]
rosewater = #f4dbd6
flamingo = #f0c6c6
pink = #f5bde6
mauve = #c6a0f6
red = #ed8796
maroon = #ee99a0
peach = #f5a97f
yellow = #eed49f
green = #a6da95
teal = #8bd5ca
sky = #91d7e3
sapphire = #7dc4e4
blue = #8aadf4
lavender = #b7bdf8
text = #cad3f5
subtext1 = #b8c0e0
subtext0 = #a5adcb
overlay2 = #939ab7
overlay1 = #8087a2
overlay0 = #6e738d
surface2 = #5b6078
surface1 = #494d64
surface0 = #363a4f
base = #24273a
mantle = #1e2030
crust = #181926
background = ${colors.base}
background-alt = ${colors.surface0}
foreground = ${colors.text}
primary = ${colors.mauve}
secondary = ${colors.lavender}
alert = ${colors.red}
disabled = ${colors.overlay0}
transparent = #00000000
; --------------------------------------------------------------------------
; Bar
; --------------------------------------------------------------------------
[bar/main]
monitor = ${env:MONITOR:}
monitor-strict = false
override-redirect = false
width = 100%
height = 30pt
radius = 0
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
border-size = 0pt
border-color = ${colors.transparent}
padding-left = 1
padding-right = 1
module-margin = 1
separator = "│"
separator-foreground = ${colors.surface2}
font-0 = Inconsolata Nerd Font:style=Regular:size=11;2
font-1 = Inconsolata Nerd Font:style=Bold:size=11;2
font-2 = Symbols Nerd Font Mono:size=13;3
font-3 = Noto Color Emoji:scale=10;2
modules-left = i3 xwindow
modules-center = date
modules-right = ${env:MODULES_RIGHT:filesystem memory cpu temperature pulseaudio systray}
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
wm-restack = i3
; --------------------------------------------------------------------------
; Modules
; --------------------------------------------------------------------------
[module/i3]
type = internal/i3
pin-workspaces = true
show-urgent = true
strip-wsnumbers = true
index-sort = true
enable-click = true
enable-scroll = true
wrapping-scroll = false
reverse-scroll = false
fuzzy-match = true
format = <label-state> <label-mode>
label-mode = %mode%
label-mode-padding = 1
label-mode-background = ${colors.peach}
label-mode-foreground = ${colors.crust}
label-focused = %name%
label-focused-background = ${colors.surface0}
label-focused-foreground = ${colors.mauve}
label-focused-underline = ${colors.mauve}
label-focused-padding = 1
label-unfocused = %name%
label-unfocused-foreground = ${colors.overlay1}
label-unfocused-padding = 1
label-visible = %name%
label-visible-foreground = ${colors.lavender}
label-visible-padding = 1
label-urgent = %name%
label-urgent-background = ${colors.red}
label-urgent-foreground = ${colors.crust}
label-urgent-padding = 1
[module/xwindow]
type = internal/xwindow
label = %title:0:80:...%
label-foreground = ${colors.subtext0}
label-empty =
[module/date]
type = internal/date
interval = 1
date = %a %d %b
time = %H:%M
date-alt = %A, %d %B %Y
time-alt = %H:%M:%S
format-prefix = " "
format-prefix-foreground = ${colors.lavender}
label = %date% %time%
label-foreground = ${colors.text}
[module/filesystem]
type = internal/fs
interval = 60
mount-0 = /
warn-percentage = 85
format-mounted-prefix = " "
format-mounted-prefix-foreground = ${colors.green}
format-warn-prefix = " "
format-warn-prefix-foreground = ${colors.peach}
label-mounted = %percentage_used%%
label-warn = %percentage_used%%
label-unmounted =
click-left = kitty --class kitty-float -e btop
[module/memory]
type = internal/memory
interval = 3
warn-percentage = 90
format-prefix = " "
format-prefix-foreground = ${colors.yellow}
format-warn-prefix = " "
format-warn-prefix-foreground = ${colors.red}
label = %percentage_used%%
label-warn = %percentage_used%%
label-warn-foreground = ${colors.red}
[module/cpu]
type = internal/cpu
interval = 3
warn-percentage = 90
format-prefix = " "
format-prefix-foreground = ${colors.blue}
format-warn-prefix = " "
format-warn-prefix-foreground = ${colors.red}
label = %percentage:2%%
label-warn = %percentage:2%%
label-warn-foreground = ${colors.red}
[module/temperature]
type = internal/temperature
interval = 5
thermal-zone = 0
base-temperature = 20
warn-temperature = 80
units = true
format = <ramp> <label>
format-warn = <ramp> <label-warn>
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.red}
ramp-0 =
ramp-1 =
ramp-2 =
ramp-3 =
ramp-0-foreground = ${colors.sky}
ramp-1-foreground = ${colors.green}
ramp-2-foreground = ${colors.yellow}
ramp-3-foreground = ${colors.peach}
[module/backlight]
type = internal/backlight
card = ${env:BACKLIGHT:intel_backlight}
use-actual-brightness = true
enable-scroll = true
format = <ramp> <label>
label = %percentage%%
ramp-0 =
ramp-1 =
ramp-2 =
ramp-3 =
ramp-foreground = ${colors.yellow}
[module/pulseaudio]
type = internal/pulseaudio
use-ui-max = false
interval = 5
format-volume = <ramp-volume> <label-volume>
label-volume = %percentage%%
label-muted = " muted"
label-muted-foreground = ${colors.overlay0}
ramp-volume-0 =
ramp-volume-1 =
ramp-volume-2 =
ramp-volume-foreground = ${colors.teal}
click-right = pavucontrol
scroll-up = ~/.local/bin/volume up
scroll-down = ~/.local/bin/volume down
[module/wlan]
type = internal/network
interface = ${env:WLAN_IFACE:}
interface-type = wireless
interval = 5
format-connected = <ramp-signal> <label-connected>
format-disconnected = <label-disconnected>
label-connected = %essid:0:14%
label-connected-foreground = ${colors.text}
label-disconnected = " offline"
label-disconnected-foreground = ${colors.overlay0}
ramp-signal-0 =
ramp-signal-1 =
ramp-signal-2 =
ramp-signal-3 =
ramp-signal-foreground = ${colors.sapphire}
click-left = kitty --class kitty-float -e nmtui
[module/eth]
type = internal/network
interface = ${env:ETH_IFACE:}
interface-type = wired
interval = 5
format-connected = <label-connected>
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.green}
format-disconnected =
label-connected = %local_ip%
[module/battery]
type = internal/battery
full-at = 98
low-at = 15
battery = ${env:BATTERY:BAT0}
adapter = ${env:ADAPTER:AC}
poll-interval = 5
format-charging = <animation-charging> <label-charging>
format-discharging = <ramp-capacity> <label-discharging>
format-full = <label-full>
format-low = <animation-low> <label-low>
label-charging = %percentage%%
label-discharging = %percentage%%
label-full = " full"
label-full-foreground = ${colors.green}
label-low = %percentage%%
label-low-foreground = ${colors.red}
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
ramp-capacity-0-foreground = ${colors.red}
ramp-capacity-1-foreground = ${colors.peach}
ramp-capacity-2-foreground = ${colors.yellow}
ramp-capacity-3-foreground = ${colors.green}
ramp-capacity-4-foreground = ${colors.green}
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
animation-charging-foreground = ${colors.green}
animation-charging-framerate = 750
animation-low-0 =
animation-low-1 =
animation-low-foreground = ${colors.red}
animation-low-framerate = 500
[module/systray]
type = internal/tray
format-margin = 6pt
tray-spacing = 8pt
tray-background = ${colors.background}
; --------------------------------------------------------------------------
; Global settings
; --------------------------------------------------------------------------
[settings]
screenchange-reload = true
pseudo-transparency = false
+85
View File
@@ -0,0 +1,85 @@
#!/usr/bin/env bash
# ---------------------------------------------------------------------------
# Launch one polybar instance per connected monitor.
# Hardware-specific values are detected here and passed to polybar as
# environment variables, so config.ini stays machine-independent.
# ---------------------------------------------------------------------------
set -uo pipefail
CONFIG="$HOME/.config/polybar/config.ini"
LOG="${XDG_CACHE_HOME:-$HOME/.cache}/polybar.log"
mkdir -p "$(dirname "$LOG")"
# --- stop any running instances and wait for them to die -------------------
pkill -x polybar >/dev/null 2>&1 || true
for _ in {1..20}; do
pgrep -x polybar >/dev/null || break
sleep 0.1
done
# Anything still alive gets the hammer.
pgrep -x polybar >/dev/null && pkill -9 -x polybar
# --- hardware detection ----------------------------------------------------
# Battery + AC adapter
BATTERY="$(ls -1 /sys/class/power_supply 2>/dev/null | grep -m1 '^BAT' || true)"
ADAPTER="$(ls -1 /sys/class/power_supply 2>/dev/null | grep -m1 -E '^(AC|ADP|ACAD)' || true)"
export BATTERY="${BATTERY:-BAT0}"
export ADAPTER="${ADAPTER:-AC}"
# Backlight device (intel_backlight, amdgpu_bl0, nvidia_0, …)
BACKLIGHT="$(ls -1 /sys/class/backlight 2>/dev/null | head -n1 || true)"
export BACKLIGHT="${BACKLIGHT:-intel_backlight}"
# Network interfaces: wireless ones have a /sys/class/net/*/wireless dir
WLAN_IFACE=""
ETH_IFACE=""
for iface in /sys/class/net/*; do
name="$(basename "$iface")"
[[ "$name" == "lo" ]] && continue
if [[ -d "$iface/wireless" ]]; then
[[ -z "$WLAN_IFACE" ]] && WLAN_IFACE="$name"
else
[[ -z "$ETH_IFACE" ]] && ETH_IFACE="$name"
fi
done
export WLAN_IFACE ETH_IFACE
# --- module pruning --------------------------------------------------------
# Desktops have no battery/backlight; leaving those modules enabled makes
# polybar spam the log, so build the right-hand module list dynamically.
MODULES_RIGHT="filesystem memory cpu temperature"
[[ -d "/sys/class/backlight/$BACKLIGHT" ]] && MODULES_RIGHT+=" backlight"
MODULES_RIGHT+=" pulseaudio"
[[ -n "$WLAN_IFACE" ]] && MODULES_RIGHT+=" wlan"
[[ -n "$ETH_IFACE" ]] && MODULES_RIGHT+=" eth"
[[ -d "/sys/class/power_supply/$BATTERY" ]] && MODULES_RIGHT+=" battery"
MODULES_RIGHT+=" systray"
export MODULES_RIGHT
# --- launch ----------------------------------------------------------------
{
echo
echo "=== polybar launch $(date -Is) ==="
echo "battery=$BATTERY adapter=$ADAPTER backlight=$BACKLIGHT wlan=${WLAN_IFACE:-none} eth=${ETH_IFACE:-none}"
echo "modules-right=$MODULES_RIGHT"
} >>"$LOG"
if command -v polybar >/dev/null && polybar --list-monitors >/dev/null 2>&1; then
# The tray can only live on one bar; give it to the primary monitor.
primary="$(polybar --list-monitors | grep -m1 '(primary)' | cut -d: -f1)"
while IFS= read -r line; do
m="${line%%:*}"
[[ -z "$m" ]] && continue
if [[ -n "$primary" && "$m" != "$primary" ]]; then
MONITOR="$m" MODULES_RIGHT="${MODULES_RIGHT/ systray/}" \
polybar --reload main --config="$CONFIG" >>"$LOG" 2>&1 &
else
MONITOR="$m" polybar --reload main --config="$CONFIG" >>"$LOG" 2>&1 &
fi
done < <(polybar --list-monitors)
else
polybar --reload main --config="$CONFIG" >>"$LOG" 2>&1 &
fi
echo "polybar launched" >>"$LOG"