Repository navigation
fix(menubar): show Keep Awake on Macs without a battery - #13
Merged
Merged
Conversation
- Add a keepAwake module shown only while Keep Awake is on - Show the cup in the combined item in the user's chosen order - Give it a ⌘-draggable individual item like other modules - Remove the fallback status item and the battery badge - Keep at least one module that doesn't depend on Keep Awake - Reuse status items still wanted instead of recreating all
- Let Macs without a battery turn on Keep Awake from the menu bar - Update the settings footer and README to match
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.
On a Mac without a battery, the Keep Awake cup never made it into the combined menu bar item, and it couldn't be reordered. The cup was drawn as a badge on the battery widget. When there was no battery widget, Barometry added a separate status item for it outside the module system. Hiding the Battery module on a laptop caused the same problem.
Keep Awake is now a regular menu bar module that appears only while Keep Awake is on:
⌥-clicking any Barometry item now toggles Keep Awake. It used to work only on the battery item, so Macs without a battery could only turn Keep Awake on from the dashboard.
Testing
swift testinPackages/BarometryKitpasses. New tests cover when Keep Awake is shown, its position in the module order, and that it can't be the last module left visible.