Skip to content

Add charging providers#5533

Open
spencerbull wants to merge 9 commits intobasecamp:devfrom
spencerbull:add-charging-providers
Open

Add charging providers#5533
spencerbull wants to merge 9 commits intobasecamp:devfrom
spencerbull:add-charging-providers

Conversation

@spencerbull
Copy link
Copy Markdown
Contributor

Summary

  • Adds omarchy-battery-policy as the packaged backend for battery charging controls.
  • Adds Setup > Power > Battery Charging when supported battery controls are available.
  • Installs the new package for existing users via migration and includes it for fresh installs.
  • Removes the temporary dev-only battery policy test helper from the PR.

Notes

  • Battery charging controls are hidden when no supported battery policy provider is available.
  • Custom charge limits are only applied when the Custom profile is selected; other profiles ignore stored custom limits.

Testing

  • Verified omarchy-menu shell syntax with bash -n.
  • Verified package script syntax with bash -n.
  • Verified git diff --check.
  • Confirmed migration installs omarchy-battery-policy when missing.

Dependent on: omacom-io/omarchy-pkgs#88
Ref: #5144

CC: @spaceXrace @dhh

Copilot AI review requested due to automatic review settings May 1, 2026 16:23
@spencerbull
Copy link
Copy Markdown
Contributor Author

image image

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

This PR integrates battery charging controls by packaging omarchy-battery-policy, adding a Setup UI entry for battery charging when supported, and ensuring the package is installed for both new installs and existing users via migration.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Add omarchy-battery-policy to the base install package set and install it for existing users via a new migration.
  • Update Setup menu to group power-related items under “Power” and conditionally show “Battery Charging”.
  • Harden a couple of scripts by adding early-exit guards and improving PipeWire mute-state detection.

Reviewed changes

Copilot reviewed 2 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
migrations/1776965163.sh Installs omarchy-battery-policy on existing systems when missing.
install/omarchy-base.packages Includes omarchy-battery-policy in the default package set for fresh installs.
bin/omarchy-migrate Improves quoting when iterating and executing migration scripts.
bin/omarchy-menu Adds Setup → Power submenu and conditionally surfaces Battery Charging entry.
bin/omarchy-hyprland-monitor-scaling-cycle Adds a guard intended to avoid operating when no active monitor is present.
bin/omarchy-hw-match Exits early when invoked without a match argument.
bin/omarchy-audio-input-mute-thinkpad Uses wpctl output to detect mute state after toggling.

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

@dhh
Copy link
Copy Markdown
Member

dhh commented May 2, 2026

This is excellent, but I'd like to expose the settings like we do with the power profile. So we can control the whole thing from within the omarchy menu instead of shelling out. So that means you expose a cli that can give us the options, current value, and ability to set. Just like do with the power profiles.

@spencerbull
Copy link
Copy Markdown
Contributor Author

Okay yea that makes sense. I will get it integrated into the menu.

@spencerbull
Copy link
Copy Markdown
Contributor Author

image image image

spaceXrace and others added 9 commits May 2, 2026 10:50
Move all battery charging policy scripts out of the omarchy bin/ into
the new omarchy-battery-policy package in omarchy-pkgs. Omarchy now
depends on the installed package; the menu integration is unchanged.
- Add migration to install omarchy-battery-policy package for existing users
- Quote $OMARCHY_PATH in omarchy-migrate to handle paths with spaces
- Guard empty $1 in omarchy-hw-match to prevent false positives
- Guard null/empty ACTIVE_MONITOR in monitor scaling cycle
- Use omarchy-swayosd-client wrapper in ThinkPad mic mute script
- Use wpctl to read mute state (same API as the toggle)
- Commit omarchy-dev-battery-policy-test with tombstone comment explaining
  why deleted scripts remain in FILES for live-install cleanup
@spencerbull spencerbull force-pushed the add-charging-providers branch from 17400b9 to becb25e Compare May 2, 2026 15:52
Copilot AI review requested due to automatic review settings May 2, 2026 15:52
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

Copilot reviewed 4 out of 9 changed files in this pull request and generated no new comments.


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

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.

4 participants