Skip to content

feat(armada-store): add Gleipnir, an 80% battery charge ceiling for the AYN Thor - #677

Open
venatrix-ritz wants to merge 1 commit into
armada-os:mainfrom
venatrix-ritz:feat/armada-store-gleipnir
Open

venatrix-ritz wants to merge 1 commit into
armada-os:mainfrom
venatrix-ritz:feat/armada-store-gleipnir

Conversation

@venatrix-ritz

@venatrix-ritz venatrix-ritz commented Oct 9, 2026 •

Copy link
Copy Markdown

Adds Gleipnir to the Armada Store's plugins category.

Gleipnir is a Decky plugin that holds the AYN Thor's battery at 80 %. It clamps the battery manager's constant_charge_current limit (Armada kernel patch 0903) at 80 %, releases it at 77 % or when the charger is unplugged, and clamps just before a suspend so the cap also holds through native sleep (the Thor then does not charge while asleep). A setting in the plugin panel chooses between that (default), clamping from 70 % up, or off; the panel shows Armada's sleep type and hides the setting in fake sleep, where the daemon keeps running. Source: https://github.com/venatrix-ritz/Gleipnir (MIT).

  • The entry points at the repo's GitHub releases; the asset is Gleipnir.zip (one top-level gleipnir/ folder, as the Store's installer requires). v0.2.0 is published as a pre-release; it is the first release with the sleep clamp.
  • It declares the root flag, like armada-control and armada-store.
  • It does nothing to charging until its own safety test passes on the running kernel (gleipnir --test --run, charger plugged in); until then it only watches.
  • Tested on one Thor (build 20261006.9c7dd3e, kernel 7.2.6): the clamp at 80 %, a game under load, charger swaps, release at 77 %, charging resuming, and sleeps at 60, 76, 79 and 80 % with the charger in before or during the sleep. Other builds and other devices are untested; the README and docs/evidence.md say so.
  • No icon yet ("icon": "").

I ran tests/armada-store-test.sh on a Thor with only decky/armada-store and tests/ copied over: the catalog checks pass (32 apps, valid kinds and categories, unique ids, asset regexes compile); it stops later at a check that needs files from the rest of the repo (the flatpak tmpfiles rule). I also checked that the new entry resolves to the Gleipnir.zip asset of the live v0.2.0 release.

@winghugs

Copy link
Copy Markdown

Gleipnir adds a charge limit of 1000 which is below the safe minimum for these kinds of devices. If you set the limit that low and measure wattage, it fluctuates wildly between values between 0.2w and 5w. The minimum safe value to use on the Thor is 100000 - lower can cause issues, especially with less intelligent chargers. The lowest in official spec is 500000.

Ideally we should be looking into a kernel patch that allows for changing charge_control_end_threshold - this kind of thing a fine solution for now, but I would also recommend updating the low charge value so that batteries don't get excessive wear.

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.

2 participants