Skip to content

Migrate existing waybar configs to pin battery to BAT0#5369

Merged
dhh merged 2 commits intodevfrom
lewis/waybar-battery-bat0-migration
Apr 20, 2026
Merged

Migrate existing waybar configs to pin battery to BAT0#5369
dhh merged 2 commits intodevfrom
lewis/waybar-battery-bat0-migration

Conversation

@lewispb
Copy link
Copy Markdown
Member

@lewispb lewispb commented Apr 20, 2026

Follow-up to #4918.

That PR pinned "bat": "BAT0" in the default waybar template, which fixes new installs.

This migration patches existing configs in place.

Tested

Follow-up to #4918: that PR updated the default template, but
existing users keep their copy at ~/.config/waybar/config.jsonc
and won't pick up the fix without running omarchy-refresh-waybar
(which wipes local customizations). Patch the existing file in
place and restart waybar.
Copilot AI review requested due to automatic review settings April 20, 2026 08:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new migration to update existing user Waybar configs so the battery module is pinned to BAT0, preventing Waybar crashes caused by transient HID power supplies (e.g., Logitech/Apple devices disconnecting).

Changes:

  • Introduce a migration that inserts "bat": "BAT0" into ~/.config/waybar/config.jsonc when missing.
  • Restart Waybar after applying the config change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/1776674079.sh Outdated
Comment thread migrations/1776674079.sh Outdated
Per Copilot review: grep/sed patterns now match "battery" : {,
"battery":{, and "bat" : "..." variants that hand-edited configs
may use. Also only restart waybar when a battery block actually
exists to edit.
@dhh dhh merged commit a9baa8f into dev Apr 20, 2026
3 checks passed
@dhh
Copy link
Copy Markdown
Member

dhh commented Apr 22, 2026

#5386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants