desktop-session: add startup logging and improve monitor/lid handling - #16
Merged
Merged
Conversation
Move user-level agent content into the harness-agnostic namespace, keep Claude integration separate, and make both install configs back up existing paths instead of forcing replacement.
Add public Woodinville monitor profiles with ACPI lid-aware auto-selection and scaled clamshell geometry, plus graphical-session diagnostics and cleanup-safe sxhkd watchdog behavior. Fix Polybar's network module to render the live Wi-Fi signal and SSID without literal environment expressions.
Polybar's built-in bspwm click action embeds the monitor name in the bspc selector, and MST output names such as DP-2.1 contain a '.' that bspc parses as modifier syntax, so clicks on those bars did nothing. Turn enable-click off and wrap each desktop label in an explicit `bspc desktop -f %name%` action instead. Set remove_disabled_monitors too, so disabling a display leaves no stale monitor window sitting above polybar and swallowing its clicks. network-env.sh now leaves NETWORK_LABEL unset on Wi-Fi instead of exporting the literal %essid%, which nothing has read since the network module became a custom script; the wired branch still exports the NetworkManager connection name. Update bspwm/CLAUDE.md to describe that split. Retitle bspwmrc's EXIT trap message, which fires when the config script finishes rather than when the session ends.
network-env.sh leaves NETWORK_LABEL unset on Wi-Fi, so the startup line logged a bare `NETWORK_LABEL=` that reads like a failed lookup rather than the wireless path. Name the case instead. Uses `-` rather than `:-` so an empty-but-set value still logs as empty, which would be a real fault.
shellcheck's SC2154 fires on `rc=$?` assigned inside a single-quoted trap body — it does not track that assignment, so the `$rc` beside it reads as unassigned and CI fails at `-S warning`. Move the handler into on_exit(), where `local rc=$?` is an assignment shellcheck can see. The status logged is unchanged for both an explicit exit and a failing final command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comprehensive graphical-session startup diagnostics and improve display configuration matching for laptop lids.
Summary
This change introduces a new
desktop-session-logutility to capture safe, local diagnostics for X11 session startup, and enhances the bspwm monitor-manager to intelligently handle laptop lid state when matching display profiles. It also refactors the polybar network module to use a custom script for better MST monitor name compatibility.Key Changes
New
bin/desktop-session-logscript: Captures session metadata, active window manager, monitor topology, relevant processes, failed systemd units, and filtered journal events. Logs are stored underXDG_STATE_HOME/desktop-session/organized by boot ID. Supports three modes:--startup(called from bspwmrc and GNOME autostart),--exit(logs session termination), and--diagnose(manual diagnostic capture).GNOME autostart integration: Added
desktop-environment/session/dotfiles-session-log.desktopto invoke the logger during GNOME graphical-session startup.bspwmrc integration: Calls
desktop-session-log --startup bspwmat startup and--exiton exit via trap handler. Also setsremove_disabled_monitors trueto prevent stale monitor windows from blocking polybar clicks.Monitor profile matching with lid state: Enhanced
ProfileServiceto read ACPI lid state from/proc/acpi/button/lid/*/stateand skip profiles with enabled laptop displays when the lid is closed. Falls back to checking for active Xrandr modes when lid state is unavailable. Includes new test cases for lid-closed and clamshell scenarios.New work-laptop profiles: Added
work-laptop-woodinville.yaml(with laptop fallback enabled) andwork-laptop-woodinville-clamshell.yaml(external monitors only, no laptop display).Polybar network module refactor: Replaced inline
internal/networkmodule withcustom/scriptcalling newnetwork-label.sh. The script renders wireless/wired icons with signal strength indicators and handles SSID/connection name display. Fixes MST monitor name compatibility issues where dots in output names (e.g.,DP-2.1) were misinterpreted as bspc modifier syntax.Polybar bspwm module: Disabled built-in click handlers (
enable-click = false) and added explicit label actions usingbspc desktop -f %name%to work around MST monitor naming issues.Documentation updates: Updated
CLAUDE.mdandREADME.mdto reflect new logging infrastructure and reorganized agent-config layout. Changed Dotbot link defaults fromforce: truetobackup: truefor safer installation.Implementation Details
umask 077for privacy and creates boot-ID-indexed logs to correlate multiple session starts within the same boot.nmcliandiwto determine connection type and signal strength, rendering appropriate Nerd Font icons.https://claude.ai/code/session_011WEQYKyt4zoh6XGG446RFG