diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e848d64..61dce5a 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - name: Security vulnerability - url: https://github.com/tyldra-org/chargectl/security/advisories/new + url: https://github.com/tyldra/chargectl/security/advisories/new about: Report vulnerabilities privately. Never open a public issue. diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index a3f6670..8cfc325 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -28,7 +28,7 @@ concurrency: jobs: merge: name: merge - if: github.repository == 'tyldra-org/chargectl' + if: github.repository == 'tyldra/chargectl' runs-on: ubuntu-24.04 timeout-minutes: 10 permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8ab46f..078de48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ # publish only once both passed: the GitHub release with the zip, its # checksum and the Homebrew cask # homebrew opens a pull request with the new cask in -# tyldra-org/homebrew-tools, which merges itself once the tap's +# tyldra/homebrew-tools, which merges itself once the tap's # CI passes # A failed homebrew job can be rerun on its own; the release stays published. # @@ -192,7 +192,7 @@ jobs: with: client-id: ${{ vars.TAP_APP_CLIENT_ID }} private-key: ${{ secrets.TAP_APP_PRIVATE_KEY }} - owner: tyldra-org + owner: tyldra repositories: homebrew-tools # Only what opening and auto-merging the pull request needs, not every # permission of the app's installation. @@ -201,7 +201,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - repository: tyldra-org/homebrew-tools + repository: tyldra/homebrew-tools token: ${{ steps.token.outputs.token }} path: tap # The git push below uses these credentials; nothing in this job uploads the folder. diff --git a/App/AppModel.swift b/App/AppModel.swift index 7158ffd..09024d3 100644 --- a/App/AppModel.swift +++ b/App/AppModel.swift @@ -585,6 +585,7 @@ final class AppModel { let files = FileManager.default if files.isExecutableFile(atPath: brew.path), files.fileExists(atPath: "\(prefix)/Caskroom/chargectl") + || files.fileExists(atPath: "\(prefix)/Library/Taps/tyldra/homebrew-tools") || files.fileExists(atPath: "\(prefix)/Library/Taps/tyldra-org/homebrew-tools") { return brew diff --git a/CHANGELOG.md b/CHANGELOG.md index 1658fac..cf01fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ sees, with its pull request link. Credit outside contributors with ## [Unreleased] +### Changed + +- **Chargectl moved to github.com/tyldra.** The app checks for updates there, + and the Homebrew tap is now `tyldra/tools`: + `brew install --cask tyldra/tools/chargectl`. Installs from the old + `tyldra-org/tools` tap keep updating, and Uninstall removes either tap. + ([#115](https://github.com/tyldra/chargectl/pull/115)) + ## [0.3.4] - 2026-11-26 ### Added @@ -24,7 +32,7 @@ sees, with its pull request link. Credit outside contributors with out, every page shows it with Restart to Update and Later. Later puts it away and installs the update the next time you close the window, even with Update automatically off, and the status island says "Updated to" the version when - you open Chargectl again. ([#112](https://github.com/tyldra-org/chargectl/pull/112)) + you open Chargectl again. ([#112](https://github.com/tyldra/chargectl/pull/112)) ## [0.3.3] - 2026-11-26 @@ -35,7 +43,7 @@ sees, with its pull request link. Credit outside contributors with 30 times a second, and every frame updated the whole window: 9 to 17% CPU while you looked at it. macOS now plays these animations itself, at the same speed, so they cost Chargectl almost nothing. They still stop while the window is - hidden or another app is in front. ([#108](https://github.com/tyldra-org/chargectl/pull/108)) + hidden or another app is in front. ([#108](https://github.com/tyldra/chargectl/pull/108)) ## [0.3.2] - 2026-11-26 @@ -47,7 +55,7 @@ sees, with its pull request link. Credit outside contributors with change every second, so the open window used around half a CPU core, also behind other apps. Live readings now change in place, and the open dashboard uses about a tenth of what it did. The charge, the cycle count and your - settings still roll. ([#106](https://github.com/tyldra-org/chargectl/pull/106)) + settings still roll. ([#106](https://github.com/tyldra/chargectl/pull/106)) ## [0.3.1] - 2026-11-25 @@ -60,7 +68,7 @@ sees, with its pull request link. Credit outside contributors with the window is hidden, covered or behind another app, and the numbers only roll while you can see them. The menu bar item redraws only when its ring or percentage changes, not every second, and pointing at a card redraws only its - light, not everything inside it. ([#102](https://github.com/tyldra-org/chargectl/pull/102)) + light, not everything inside it. ([#102](https://github.com/tyldra/chargectl/pull/102)) ## [0.3.0] - 2026-11-25 @@ -72,20 +80,20 @@ limit from how you use your Mac.** - **Ageing avoided.** History › Battery health over time estimates how much battery ageing Chargectl has saved, from the charge and temperature each minute, against macOS charging to 100% whenever it is plugged in. Batteries - age faster at a high charge and when warm. ([#99](https://github.com/tyldra-org/chargectl/pull/99)) + age faster at a high charge and when warm. ([#99](https://github.com/tyldra/chargectl/pull/99)) - **Smart limit (beta).** Off unless you turn it on in Control › Charging. Instead of one number for every day, Chargectl records how much charge you use each time you unplug, and holds what you use on nine days in ten plus a 20% reserve, from 50% up to your limit. Weekdays and weekends are counted apart. It starts after 5 times unplugged and shows what it would hold before - you turn it on. ([#100](https://github.com/tyldra-org/chargectl/pull/100)) + you turn it on. ([#100](https://github.com/tyldra/chargectl/pull/100)) - **Charge to your limit before trips.** With the smart limit on, Chargectl can look in your calendar for flights, trains and trips in the next day and hold your full limit until they start. Calendar access is asked for only when you - turn this on, and events stay on your Mac. ([#100](https://github.com/tyldra-org/chargectl/pull/100)) + turn this on, and events stay on your Mac. ([#100](https://github.com/tyldra/chargectl/pull/100)) - **Cell balance.** Overview shows how far apart the battery's cells are, and Chargectl warns when they stay far apart at rest, which often comes before a - cell wears out. ([#99](https://github.com/tyldra-org/chargectl/pull/99)) + cell wears out. ([#99](https://github.com/tyldra/chargectl/pull/99)) ## [0.2.10] - 2026-11-25 @@ -95,7 +103,7 @@ limit from how you use your Mac.** 100%, Chargectl now asks macOS for a temporary override instead of switching macOS's charge limit off. macOS keeps your limit and puts it back by itself the next morning, even if Chargectl stops partway through. Where macOS - refuses the override, Chargectl switches the limit off as before. ([#97](https://github.com/tyldra-org/chargectl/pull/97)) + refuses the override, Chargectl switches the limit off as before. ([#97](https://github.com/tyldra/chargectl/pull/97)) ## [0.2.9] - 2026-11-25 @@ -107,10 +115,10 @@ limit from how you use your Mac.** Calibrate on a schedule: the first time the Mac is on the charger once it is due, the battery runs down to 15%, charges to 100%, rests for an hour and goes back to your limit. It is off unless you turn it on, and counts from - the last calibration, including one you started yourself. ([#95](https://github.com/tyldra-org/chargectl/pull/95)) + the last calibration, including one you started yourself. ([#95](https://github.com/tyldra/chargectl/pull/95)) - **A one-time tip for limits below 80%.** Below 80%, the battery's percentage can drift from its real charge. The Control page offers automatic - calibration once, with Not Now to dismiss it for good. ([#95](https://github.com/tyldra-org/chargectl/pull/95)) + calibration once, with Not Now to dismiss it for good. ([#95](https://github.com/tyldra/chargectl/pull/95)) ## [0.2.8] - 2026-11-25 @@ -123,7 +131,7 @@ loops between two points at the limit.** bar stops the background helper as well: wall power is reconnected and your own macOS charge limit and MagSafe light come back. Opening Chargectl again starts the helper and takes over. Closing the dashboard, logging out and - shutting down leave the helper running as before. ([#93](https://github.com/tyldra-org/chargectl/pull/93)) + shutting down leave the helper running as before. ([#93](https://github.com/tyldra/chargectl/pull/93)) ### Fixed @@ -135,12 +143,12 @@ loops between two points at the limit.** finish a charge up to two points past the limit and keeps the Mac on the charger there. Only a charge well past the limit, such as macOS's occasional charge to 100%, still cuts wall power. With automatic discharge off, the Mac - no longer runs on battery for those last points. ([#92](https://github.com/tyldra-org/chargectl/pull/92)) + no longer runs on battery for those last points. ([#92](https://github.com/tyldra/chargectl/pull/92)) - **Widgets are no longer empty after an update or a reinstall.** macOS kept running the widgets from the copy of Chargectl that was replaced or moved to the Trash, so the widget gallery and the widgets on the desktop showed blank cards until the Mac restarted. Chargectl now stops that old process - when it opens, and macOS starts the widgets from the new copy. ([#83](https://github.com/tyldra-org/chargectl/pull/83)) + when it opens, and macOS starts the widgets from the new copy. ([#83](https://github.com/tyldra/chargectl/pull/83)) ## [0.2.7] - 2026-11-11 @@ -153,13 +161,13 @@ offers Restart to Update.** replaces itself only with a helper carrying that signature and takes commands only from an app carrying it, and the updater accepts only such a release. Updates after this one no longer ask for the administrator - password; this one asks a last time, to install a signed helper. ([#67](https://github.com/tyldra-org/chargectl/pull/67)) + password; this one asks a last time, to install a signed helper. ([#67](https://github.com/tyldra/chargectl/pull/67)) ### Added - **Restart to Update in the menu bar.** When a new version is waiting, the menu bar panel shows **Restart to Update** under Settings, and Settings › - Updates has the same button. ([#73](https://github.com/tyldra-org/chargectl/pull/73)) + Updates has the same button. ([#73](https://github.com/tyldra/chargectl/pull/73)) ### Fixed @@ -167,7 +175,7 @@ offers Restart to Update.** that refreshed while the helper was restarting, for an update or after a macOS update, showed "needs the helper" for up to five minutes. Widgets now show the helper's last answer for up to 15 minutes, check again every - minute meanwhile, and refresh as soon as the app sees the helper again. ([#71](https://github.com/tyldra-org/chargectl/pull/71)) + minute meanwhile, and refresh as soon as the app sees the helper again. ([#71](https://github.com/tyldra/chargectl/pull/71)) ## [0.2.6] - 2026-11-11 @@ -179,18 +187,18 @@ limit and past it.** - **Changing macOS's limit below 80% no longer starts a charge.** Chargectl set such a limit by asking macOS for 80% first, and on the charger that started a charge toward 80% that macOS finished after the lower limit was - set. Limits below 80% are now changed directly. ([#60](https://github.com/tyldra-org/chargectl/pull/60)) + set. Limits below 80% are now changed directly. ([#60](https://github.com/tyldra/chargectl/pull/60)) - **Plugging in inside the sailing range no longer charges to the limit.** macOS started charging toward the limit the moment the charger was connected and kept going after Chargectl lowered its limit, while the status said "Sailing on the charger". On battery inside the range, macOS's limit now follows the charge, and a charge that starts anyway stops at the - level Chargectl is holding. ([#55](https://github.com/tyldra-org/chargectl/pull/55)) + level Chargectl is holding. ([#55](https://github.com/tyldra/chargectl/pull/55)) - **A charge that runs past the limit is no longer held there.** A moment without current in such a charge made Chargectl hold at whatever level it had reached, and the hold then rose with the charge. A hold now follows a rising charge only after the battery has rested for two minutes; until - then, charging past the limit cuts wall power. ([#61](https://github.com/tyldra-org/chargectl/pull/61)) + then, charging past the limit cuts wall power. ([#61](https://github.com/tyldra/chargectl/pull/61)) ## [0.2.5] - 2026-11-10 @@ -201,7 +209,7 @@ limit and past it.** root-owned copy was named after its launchd label, and Login Items shows that file's name. The copy is now `/Library/PrivilegedHelperTools/Chargectl Service`. Installing the helper again moves it right away; otherwise the helper moves - itself, which takes effect when the Mac next restarts. ([#40](https://github.com/tyldra-org/chargectl/pull/40)) + itself, which takes effect when the Mac next restarts. ([#40](https://github.com/tyldra/chargectl/pull/40)) ## [0.2.4] - 2026-11-09 @@ -214,25 +222,25 @@ shows as the next one.** large portrait join small and medium. They show the time left or the next full charge, a track of the hours until then (held at your limit, then charging), the week, the next few full charges with when each starts, and - Skip or Stop. ([#33](https://github.com/tyldra-org/chargectl/pull/33)) + Skip or Stop. ([#33](https://github.com/tyldra/chargectl/pull/33)) ### Fixed - **A skipped full charge no longer shows as the next one.** After Skip or Stop, the widgets, the Control Center control and the Control page kept showing the skipped time; they now show the one after it, and the widget marks the - skipped day. ([#33](https://github.com/tyldra-org/chargectl/pull/33)) + skipped day. ([#33](https://github.com/tyldra/chargectl/pull/33)) - **The Health widget and History's battery health chart work with an older helper.** They stayed empty until the helper was updated to the app's - version; every helper from 0.2.0 on has the daily record they need. ([#33](https://github.com/tyldra-org/chargectl/pull/33)) + version; every helper from 0.2.0 on has the daily record they need. ([#33](https://github.com/tyldra/chargectl/pull/33)) - **No history entry is lost after a crash.** An entry written right after a - line that a crash cut short was skipped together with it. ([#33](https://github.com/tyldra-org/chargectl/pull/33)) + line that a crash cut short was skipped together with it. ([#33](https://github.com/tyldra/chargectl/pull/33)) - **macOS's own limit is only reported as draining the battery when it is in - force.** A policy left from before the last restart could count. ([#33](https://github.com/tyldra-org/chargectl/pull/33)) + force.** A policy left from before the last restart could count. ([#33](https://github.com/tyldra/chargectl/pull/33)) - **The Time Left widget no longer says "Until you unplug" on battery** when - there is no estimate yet. ([#33](https://github.com/tyldra-org/chargectl/pull/33)) + there is no estimate yet. ([#33](https://github.com/tyldra/chargectl/pull/33)) - **The menu bar preview in setup and Settings keeps its clock current**, and - shows "—" instead of 0% before the battery is read. ([#33](https://github.com/tyldra-org/chargectl/pull/33)) + shows "—" instead of 0% before the battery is read. ([#33](https://github.com/tyldra/chargectl/pull/33)) ## [0.2.3] - 2026-11-08 @@ -244,13 +252,13 @@ shows as the next one.** Application Scripts folder, stops the widget extension before deleting its data, and makes a second pass after the app quits, because quitting wrote the preferences and caches again. If macOS protects the widgets' data, Chargectl - shows those folders in Finder so you can drag them to the Trash. ([#28](https://github.com/tyldra-org/chargectl/pull/28)) + shows those folders in Finder so you can drag them to the Trash. ([#28](https://github.com/tyldra/chargectl/pull/28)) - **Dragging the app to the Trash cleans up too.** The helper already handed charging back and removed itself when the app was deleted; it now also removes the app's preferences, caches, widget data, crash reports and Dock - tile for each user. ([#28](https://github.com/tyldra-org/chargectl/pull/28)) + tile for each user. ([#28](https://github.com/tyldra/chargectl/pull/28)) - **`brew uninstall --zap` removes the widgets' Application Scripts folder and - the WebKit data too.** ([#28](https://github.com/tyldra-org/chargectl/pull/28)) + the WebKit data too.** ([#28](https://github.com/tyldra/chargectl/pull/28)) ## [0.2.2] - 2026-11-08 @@ -265,19 +273,19 @@ shows as the next one.** shown, with Weekdays, Every day and Once as shortcuts; this replaces the Days option, which jumped back to Weekdays or Every day when the chosen days matched one of them. The card's caption shows the next one, such as "Next: - Tomorrow, 8:00 AM". ([#27](https://github.com/tyldra-org/chargectl/pull/27)) + Tomorrow, 8:00 AM". ([#27](https://github.com/tyldra/chargectl/pull/27)) ### Fixed - **Cards no longer stretch to match their neighbour.** Control and Settings stack their cards in two columns, each card as tall as its content, so cards like Helper, Updates, Charge control and Heat no longer end in empty space. - Settings' menu bar card now spans the page. ([#27](https://github.com/tyldra-org/chargectl/pull/27)) + Settings' menu bar card now spans the page. ([#27](https://github.com/tyldra/chargectl/pull/27)) - **The menu bar preview in Settings fits.** It drops menus before it cuts off - the percentage. ([#27](https://github.com/tyldra-org/chargectl/pull/27)) + the percentage. ([#27](https://github.com/tyldra/chargectl/pull/27)) - **Overview fits the default window width.** The Top Up, Discharge and Calibrate buttons no longer shorten their names, and the summary strip drops - its last facts instead of wrapping. ([#27](https://github.com/tyldra-org/chargectl/pull/27)) + its last facts instead of wrapping. ([#27](https://github.com/tyldra/chargectl/pull/27)) ## [0.2.1] - 2026-11-08 @@ -288,12 +296,12 @@ shows as the next one.** - **A new app icon.** It's the menu bar ring at Dock size: a green charge on a glass track that ends at your limit, with no lightning bolt. It's built in Icon Composer, so it follows System Settings › Appearance › Icon & widget - style: Default, Dark, Clear and Tinted. ([#23](https://github.com/tyldra-org/chargectl/pull/23)) + style: Default, Dark, Clear and Tinted. ([#23](https://github.com/tyldra/chargectl/pull/23)) ### Fixed - **The setup window no longer has a grey strip along its bottom.** The window - was a title bar taller than its content. ([#22](https://github.com/tyldra-org/chargectl/pull/22)) + was a title bar taller than its content. ([#22](https://github.com/tyldra/chargectl/pull/22)) ## [0.2.0] - 2026-11-08 @@ -309,28 +317,28 @@ fixed. without a password. Install Helper now copies the helper to `/Library/PrivilegedHelperTools`, owned by root, and launchd runs that copy. A helper installed by an earlier version moves itself there; this takes - effect when the Mac next restarts. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + effect when the Mac next restarts. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Releases can be signed with Chargectl's own certificate.** Once they are, the updater accepts only that signature, the helper takes commands only from an app signed with it, and updates replace the helper without a password. Until then, each update asks for the administrator password to update the - helper. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + helper. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Release builds no longer let other processes attach to them** (no `get-task-allow` entitlement), so nothing can speak to the helper as the app. - ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + ([#20](https://github.com/tyldra/chargectl/pull/20)) ### Highlights - **Widgets.** Charge, Power, Health, Today, Full by, Controls, Time left and Ring, several with buttons that change the limit or start Top Up without - opening the app. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + opening the app. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Full by.** Charges to 100% just in time for a time you set, then goes back - to your limit. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + to your limit. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Control Center controls** for charge control, Top Up, Discharge and Full - by. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + by. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **A redesigned dashboard and menu bar,** with a menu bar ring that ends at - your limit. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) -- **Other programs can no longer replace the root helper.** ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + your limit. ([#20](https://github.com/tyldra/chargectl/pull/20)) +- **Other programs can no longer replace the root helper.** ([#20](https://github.com/tyldra/chargectl/pull/20)) ### Added @@ -338,26 +346,26 @@ fixed. Large Portrait. Power, Health, Today, Full by, Controls and Time left come in Small and Medium, and Ring in Small. Each kind answers one question; Controls, Full by and the larger Charge sizes have buttons that change the limit, Top Up, - Discharge or skip a full charge without opening the app. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + Discharge or skip a full charge without opening the app. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Control Center controls** for charge control (showing your limit), Top Up, - Discharge and Full by, which can also sit in the menu bar. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + Discharge and Full by, which can also sit in the menu bar. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Full by.** Control › Full by charges to 100% just in time for a time you set, once, on weekdays, every day or on chosen days, then goes back to your limit. Charging starts only as early as the charge needs, so the battery isn't - kept full for hours. Stopping it skips that time. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + kept full for hours. Stopping it skips that time. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Battery health over time.** History keeps one summary a day for years: health, cycles, hours at 90% or more and the warmest moment. A new card shows - them over a month, three months, a year or everything. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + them over a month, three months, a year or everything. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Shortcuts actions.** Set the limit, turn charge control on or off, Top Up, Discharge, stop a job, charge to full by a time, turn Full by off, and get the - battery's charge. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + battery's charge. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Notifications** for problems (on), finished jobs (on) and the limit being - reached (off); Settings › Notifications. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + reached (off); Settings › Notifications. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **A warning when the charger is too weak.** Plugged in, yet the battery runs - down for a minute: Chargectl says the charger can't keep up. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + down for a minute: Chargectl says the charger can't keep up. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **A check that charge control works.** If the helper cuts wall power and the battery keeps charging for 30 seconds, Chargectl warns that a macOS or firmware - update may have changed how charging is controlled. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + update may have changed how charging is controlled. ([#20](https://github.com/tyldra/chargectl/pull/20)) ### Changed @@ -371,24 +379,24 @@ fixed. chart and one crosshair across all charts. Logs groups lines from the same second, splits them by day, marks helper restarts and adds search (⌘F) and Copy. Settings shows a menu bar preview and appearance as small windows, and - asks before removing the helper. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + asks before removing the helper. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **The menu bar ring shows your limit.** Its track ends at the charge limit, so a closed ring means the battery is held there, and a small symbol shows - charging, holding, discharging or a missing helper. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + charging, holding, discharging or a missing helper. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **A calmer setup window.** Each of the four steps shows one picture, a title, a sentence and only that step's controls. A diagram shows what the helper connects, the install checklist ticks off as it goes, the limit uses the same slider as Control, and the last step shows where Chargectl sits in the menu - bar. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + bar. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **The helper writes much less to disk and keeps more log.** History and log entries are appended one line at a time instead of rewriting the whole file every minute (about 280 MB a day at a full day of history), and the log keeps the last 2,000 lines instead of 300. Files from older versions are moved over - on the first start. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + on the first start. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **The app keeps hearing from the helper while macOS's battery service is slow.** Status, history and logs are answered without waiting for it, and the helper asks it for the charge limit once per check instead of up to four - times plus once for every status request. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + times plus once for every status request. ([#20](https://github.com/tyldra/chargectl/pull/20)) ### Fixed @@ -396,17 +404,17 @@ fixed. limit can't go as low as yours, or isn't available, the helper used to reconnect wall power before sleep, and the Mac could charge to macOS's limit or to full overnight. Now wall power stays cut while asleep when the charge is - at least at the lower bound and 30%, so it only drifts down a little. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + at least at the lower bound and 30%, so it only drifts down a little. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Wall power comes back when the battery cannot be read.** After three failed readings in a row the helper reconnects the charger instead of leaving the Mac - running down its battery. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + running down its battery. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **A limit below 80% no longer flickers wall power the first time macOS refuses it.** The helper now decides again at once, instead of applying the - old decision after switching to holding the limit with wall power. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + old decision after switching to holding the limit with wall power. ([#20](https://github.com/tyldra/chargectl/pull/20)) - **Plugging in inside the sailing range no longer charges.** With a 55% limit and 7% sailing, plugging in at 52% started charging to 55%. The charge is now held where it is, and charging starts only once it drifts down to 48%, the - same as after reaching the limit. ([#20](https://github.com/tyldra-org/chargectl/pull/20)) + same as after reaching the limit. ([#20](https://github.com/tyldra/chargectl/pull/20)) ## [0.1.10] - 2026-10-27 @@ -420,13 +428,13 @@ limit no longer discharges the battery.** system's daemons, so the helper's job was missing until the next restart. The helper now keeps a narrow sudoers rule that lets the app start it again without a password, and the app does so as soon as it sees the job missing. - Installs from 0.1.9 get the rule when the helper first runs 0.1.10. ([#15](https://github.com/tyldra-org/chargectl/pull/15)) + Installs from 0.1.9 get the rule when the helper first runs 0.1.10. ([#15](https://github.com/tyldra/chargectl/pull/15)) - **Discharging while holding above the limit.** After a restart the battery gauge can read a percent higher than before. The hold stayed at the old reading, so macOS's limit sat below the charge and discharged the battery at over 20 W. With macOS's limit available, the hold now follows the reading while the battery is not charging, and a starting helper forgets the old - hold. ([#15](https://github.com/tyldra-org/chargectl/pull/15)) + hold. ([#15](https://github.com/tyldra/chargectl/pull/15)) ## [0.1.9] - 2026-10-27 @@ -434,7 +442,7 @@ limit no longer discharges the battery.** - **Slow reopen after an automatic update.** The updated app now starts right away instead of after 30 seconds, and the helper no longer stops a copy that - started after the update. ([#14](https://github.com/tyldra-org/chargectl/pull/14)) + started after the update. ([#14](https://github.com/tyldra/chargectl/pull/14)) ## [0.1.8] - 2026-10-27 @@ -445,7 +453,7 @@ limit no longer discharges the battery.** closed. The helper restarts into the new version and reopens the app. Each download is checked against its published SHA-256 and code signature. On by default; turn it off, check now or install a waiting version in Settings › - Updates. The Homebrew cask is marked as updating itself. ([#13](https://github.com/tyldra-org/chargectl/pull/13)) + Updates. The Homebrew cask is marked as updating itself. ([#13](https://github.com/tyldra/chargectl/pull/13)) ## [0.1.7] - 2026-10-27 @@ -456,7 +464,7 @@ limit no longer discharges the battery.** switched it back on, macOS restored its 80% default, and Chargectl took that as a limit you had chosen in System Settings. Charging to 100% (Top Up, Calibrate, or a 100% limit) now switches macOS's limit off, and changes made - while a job runs are no longer taken as yours. ([#12](https://github.com/tyldra-org/chargectl/pull/12)) + while a job runs are no longer taken as yours. ([#12](https://github.com/tyldra/chargectl/pull/12)) ## [0.1.6] - 2026-10-21 @@ -465,15 +473,15 @@ limit no longer discharges the battery.** ### Fixed - **Dock tile.** Uninstall removes Chargectl from the Dock, whether pinned or - under recent apps, instead of leaving a question-mark icon. ([#11](https://github.com/tyldra-org/chargectl/pull/11)) + under recent apps, instead of leaving a question-mark icon. ([#11](https://github.com/tyldra/chargectl/pull/11)) - **Homebrew leftovers.** Uninstall also removes the cached download and the - `tyldra-org/tools` tap when nothing else from it is installed, along with - Homebrew's record of the cask. ([#11](https://github.com/tyldra-org/chargectl/pull/11)) + `tyldra/tools` tap when nothing else from it is installed, along with + Homebrew's record of the cask. ([#11](https://github.com/tyldra/chargectl/pull/11)) - **Crash reports.** Uninstall, `scripts/uninstall.sh` and `brew uninstall - --zap` remove the crash reports macOS wrote for the helper. ([#11](https://github.com/tyldra-org/chargectl/pull/11)) + --zap` remove the crash reports macOS wrote for the helper. ([#11](https://github.com/tyldra/chargectl/pull/11)) - **Homebrew commands.** Homebrew now loads casks from other taps only when they - are named in full, so the docs and the cask use `tyldra-org/tools/chargectl`. - ([#11](https://github.com/tyldra-org/chargectl/pull/11)) + are named in full, so the docs and the cask use `tyldra/tools/chargectl`. + ([#11](https://github.com/tyldra/chargectl/pull/11)) ## [0.1.5] - 2026-10-21 @@ -487,28 +495,28 @@ above the limit as it should.** through Login Items. macOS ties a Login Items approval to the exact build when an app has no Team ID, so after every update it refused to start the helper ("Launch Constraint Violation") and the app said the helper had stopped. Builds - signed with a team still use Login Items. ([#10](https://github.com/tyldra-org/chargectl/pull/10)) + signed with a team still use Login Items. ([#10](https://github.com/tyldra/chargectl/pull/10)) - **macOS's limit stays during restarts.** Shutting down, restarting or updating reconnects wall power but leaves macOS's charge limit at yours, so it holds until the helper runs again. Turning charge control off, removing the helper - and uninstalling still restore your own limit. ([#10](https://github.com/tyldra-org/chargectl/pull/10)) + and uninstalling still restore your own limit. ([#10](https://github.com/tyldra/chargectl/pull/10)) ### Fixed - **"The helper stopped" after a restart.** Right after the Mac starts, PowerUI can take a minute to answer, and the helper did not accept the app's connection until it had. It now answers at once and finishes starting in the - background. ([#10](https://github.com/tyldra-org/chargectl/pull/10)) + background. ([#10](https://github.com/tyldra/chargectl/pull/10)) - **Discharging above the limit with automatic discharge off.** After a restart, or when macOS stopped charging a percent past the limit, Chargectl cut wall power and discharged to the limit. It now holds the charge on the - charger; only charging past the limit cuts wall power. ([#10](https://github.com/tyldra-org/chargectl/pull/10)) + charger; only charging past the limit cuts wall power. ([#10](https://github.com/tyldra/chargectl/pull/10)) - **Misleading macOS limit notice.** "macOS's own charge limit is running the Mac on battery" appeared while the helper was starting. It now appears only when - no helper is installed. ([#10](https://github.com/tyldra-org/chargectl/pull/10)) + no helper is installed. ([#10](https://github.com/tyldra/chargectl/pull/10)) - **Deleting the app removes the helper.** The helper now hands charging back to macOS and deletes its launchd job and data once Chargectl.app has been gone - for 30 seconds, and `brew uninstall --zap` also removes the launchd job. ([#10](https://github.com/tyldra-org/chargectl/pull/10)) + for 30 seconds, and `brew uninstall --zap` also removes the launchd job. ([#10](https://github.com/tyldra/chargectl/pull/10)) ## [0.1.4] - 2026-10-21 @@ -519,20 +527,20 @@ above the limit as it should.** - **Reopen after an update.** When Chargectl was running, the helper stops any copy still running old code and reopens the new version once an update replaces the app, whether through Homebrew, `scripts/install.sh` or by hand. - ([#9](https://github.com/tyldra-org/chargectl/pull/9)) + ([#9](https://github.com/tyldra/chargectl/pull/9)) - **Old helper notice.** If the helper keeps running an older version, the app says so and opens Login Items, where turning Chargectl off and on restarts - it. ([#9](https://github.com/tyldra-org/chargectl/pull/9)) + it. ([#9](https://github.com/tyldra/chargectl/pull/9)) ### Fixed - **The helper follows the app again.** It never restarted into a new version and did not remove itself when the app was deleted, because it looked for its own executable at a relative path. Updating from 0.1.3 or earlier needs one - restart of the helper; the app shows how. ([#9](https://github.com/tyldra-org/chargectl/pull/9)) -- **Version in Settings.** It always showed 0.1.0. ([#9](https://github.com/tyldra-org/chargectl/pull/9)) + restart of the helper; the app shows how. ([#9](https://github.com/tyldra/chargectl/pull/9)) +- **Version in Settings.** It always showed 0.1.0. ([#9](https://github.com/tyldra/chargectl/pull/9)) - **Homebrew stops the app before an upgrade.** Chargectl turns Quit into - closing its window, so the cask now stops it with a signal. ([#9](https://github.com/tyldra-org/chargectl/pull/9)) + closing its window, so the cask now stops it with a signal. ([#9](https://github.com/tyldra/chargectl/pull/9)) ## [0.1.3] - 2026-10-20 @@ -543,14 +551,14 @@ significant energy.** - **Using Significant Energy.** A card on the Overview lists the apps using the most power, averaged over the last minute. A browser's helpers count for the - browser, and commands count for the terminal that started them. ([#8](https://github.com/tyldra-org/chargectl/pull/8)) + browser, and commands count for the terminal that started them. ([#8](https://github.com/tyldra/chargectl/pull/8)) ### Changed - **Time to where the charge is going.** The Estimate counts to your limit while charging to it ("until 70%"), to the lower bound while sailing, to the target while discharging, and to empty on battery, instead of always to full. While - holding, it says so. ([#8](https://github.com/tyldra-org/chargectl/pull/8)) + holding, it says so. ([#8](https://github.com/tyldra/chargectl/pull/8)) ## [0.1.2] - 2026-10-20 @@ -559,7 +567,7 @@ significant energy.** - **Uninstall clears Homebrew's record.** Settings › Uninstall Chargectl and `scripts/uninstall.sh` now also remove Homebrew's record of the cask. Before, the next `brew install` failed with "It seems the App source - '/Applications/Chargectl.app' is not there". ([#6](https://github.com/tyldra-org/chargectl/pull/6)) + '/Applications/Chargectl.app' is not there". ([#6](https://github.com/tyldra/chargectl/pull/6)) ## [0.1.1] - 2026-10-20 @@ -568,7 +576,7 @@ significant energy.** - **Holding above the limit after a change.** With automatic discharge off, lowering the limit below the charge or turning automatic discharge off while plugged in cut wall power and discharged to the limit. Chargectl now holds the - current charge on the charger, as it does when you plug in above the limit. ([#5](https://github.com/tyldra-org/chargectl/pull/5)) + current charge on the charger, as it does when you plug in above the limit. ([#5](https://github.com/tyldra/chargectl/pull/5)) ## [0.1.0] - 2026-10-20 @@ -597,33 +605,33 @@ MacBooks, from the menu bar.** sets your first limit, and opens again until setup is done. - **Clean uninstall.** Settings › Uninstall Chargectl or `scripts/uninstall.sh` hands charging back to macOS and removes every file Chargectl added. -- **Homebrew.** `brew install --cask tyldra-org/tools/chargectl`. - -[Unreleased]: https://github.com/tyldra-org/chargectl/compare/v0.3.4...HEAD -[0.3.4]: https://github.com/tyldra-org/chargectl/compare/v0.3.3...v0.3.4 -[0.3.3]: https://github.com/tyldra-org/chargectl/compare/v0.3.2...v0.3.3 -[0.3.2]: https://github.com/tyldra-org/chargectl/compare/v0.3.1...v0.3.2 -[0.3.1]: https://github.com/tyldra-org/chargectl/compare/v0.3.0...v0.3.1 -[0.3.0]: https://github.com/tyldra-org/chargectl/compare/v0.2.10...v0.3.0 -[0.2.10]: https://github.com/tyldra-org/chargectl/compare/v0.2.9...v0.2.10 -[0.2.9]: https://github.com/tyldra-org/chargectl/compare/v0.2.8...v0.2.9 -[0.2.8]: https://github.com/tyldra-org/chargectl/compare/v0.2.7...v0.2.8 -[0.2.7]: https://github.com/tyldra-org/chargectl/compare/v0.2.6...v0.2.7 -[0.2.6]: https://github.com/tyldra-org/chargectl/compare/v0.2.5...v0.2.6 -[0.2.5]: https://github.com/tyldra-org/chargectl/compare/v0.2.4...v0.2.5 -[0.2.4]: https://github.com/tyldra-org/chargectl/compare/v0.2.3...v0.2.4 -[0.2.3]: https://github.com/tyldra-org/chargectl/compare/v0.2.2...v0.2.3 -[0.2.2]: https://github.com/tyldra-org/chargectl/compare/v0.2.1...v0.2.2 -[0.2.1]: https://github.com/tyldra-org/chargectl/compare/v0.2.0...v0.2.1 -[0.2.0]: https://github.com/tyldra-org/chargectl/compare/v0.1.10...v0.2.0 -[0.1.10]: https://github.com/tyldra-org/chargectl/compare/v0.1.9...v0.1.10 -[0.1.9]: https://github.com/tyldra-org/chargectl/compare/v0.1.8...v0.1.9 -[0.1.8]: https://github.com/tyldra-org/chargectl/compare/v0.1.7...v0.1.8 -[0.1.7]: https://github.com/tyldra-org/chargectl/compare/v0.1.6...v0.1.7 -[0.1.6]: https://github.com/tyldra-org/chargectl/compare/v0.1.5...v0.1.6 -[0.1.5]: https://github.com/tyldra-org/chargectl/compare/v0.1.4...v0.1.5 -[0.1.4]: https://github.com/tyldra-org/chargectl/compare/v0.1.3...v0.1.4 -[0.1.3]: https://github.com/tyldra-org/chargectl/compare/v0.1.2...v0.1.3 -[0.1.2]: https://github.com/tyldra-org/chargectl/compare/v0.1.1...v0.1.2 -[0.1.1]: https://github.com/tyldra-org/chargectl/compare/v0.1.0...v0.1.1 -[0.1.0]: https://github.com/tyldra-org/chargectl/releases/tag/v0.1.0 +- **Homebrew.** `brew install --cask tyldra/tools/chargectl`. + +[Unreleased]: https://github.com/tyldra/chargectl/compare/v0.3.4...HEAD +[0.3.4]: https://github.com/tyldra/chargectl/compare/v0.3.3...v0.3.4 +[0.3.3]: https://github.com/tyldra/chargectl/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/tyldra/chargectl/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/tyldra/chargectl/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/tyldra/chargectl/compare/v0.2.10...v0.3.0 +[0.2.10]: https://github.com/tyldra/chargectl/compare/v0.2.9...v0.2.10 +[0.2.9]: https://github.com/tyldra/chargectl/compare/v0.2.8...v0.2.9 +[0.2.8]: https://github.com/tyldra/chargectl/compare/v0.2.7...v0.2.8 +[0.2.7]: https://github.com/tyldra/chargectl/compare/v0.2.6...v0.2.7 +[0.2.6]: https://github.com/tyldra/chargectl/compare/v0.2.5...v0.2.6 +[0.2.5]: https://github.com/tyldra/chargectl/compare/v0.2.4...v0.2.5 +[0.2.4]: https://github.com/tyldra/chargectl/compare/v0.2.3...v0.2.4 +[0.2.3]: https://github.com/tyldra/chargectl/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/tyldra/chargectl/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/tyldra/chargectl/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/tyldra/chargectl/compare/v0.1.10...v0.2.0 +[0.1.10]: https://github.com/tyldra/chargectl/compare/v0.1.9...v0.1.10 +[0.1.9]: https://github.com/tyldra/chargectl/compare/v0.1.8...v0.1.9 +[0.1.8]: https://github.com/tyldra/chargectl/compare/v0.1.7...v0.1.8 +[0.1.7]: https://github.com/tyldra/chargectl/compare/v0.1.6...v0.1.7 +[0.1.6]: https://github.com/tyldra/chargectl/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/tyldra/chargectl/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/tyldra/chargectl/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/tyldra/chargectl/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/tyldra/chargectl/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/tyldra/chargectl/compare/v0.1.0...v0.1.1 +[0.1.0]: https://github.com/tyldra/chargectl/releases/tag/v0.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 493c46c..31fe151 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ This guide explains how to propose a change and what makes it easy to accept. - Read the [Code of Conduct](CODE_OF_CONDUCT.md). It applies everywhere the project operates. -- Search [existing issues](https://github.com/tyldra-org/chargectl/issues) first. +- Search [existing issues](https://github.com/tyldra/chargectl/issues) first. - Every pull request starts from an issue. Find one or open one; for anything larger than a small fix, agree on the approach there before writing code. - Report security problems privately through [SECURITY.md](SECURITY.md), never @@ -20,7 +20,7 @@ You need an Apple silicon Mac on macOS 27, Xcode 27 and XcodeGen. ```sh brew install xcodegen -git clone https://github.com/tyldra-org/chargectl.git +git clone https://github.com/tyldra/chargectl.git cd chargectl ./scripts/check.sh ``` @@ -212,7 +212,7 @@ matches `project.yml`, runs the tests, and builds and attests `Chargectl-.zip`, while the cask check runs on another runner. Once both are done, it publishes the release with notes from the changelog, and opens a pull request that updates the cask in -[tyldra-org/homebrew-tools](https://github.com/tyldra-org/homebrew-tools). +[tyldra/homebrew-tools](https://github.com/tyldra/homebrew-tools). Running the workflow by hand from the Actions tab is a dry run: the same checks and signed build, with nothing published. `./scripts/package.sh` builds the same zip locally. diff --git a/README.md b/README.md index fcc5746..494aa39 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@

- CI - Latest release + CI + Latest release License: Apache-2.0 macOS 27 Apple silicon @@ -53,11 +53,11 @@ working while the app is closed. | macOS | 27 or later | ```sh -brew install --cask tyldra-org/tools/chargectl +brew install --cask tyldra/tools/chargectl ``` You can also download `Chargectl-.zip` from -[Releases](https://github.com/tyldra-org/chargectl/releases/latest), or +[Releases](https://github.com/tyldra/chargectl/releases/latest), or [build it from source](#build-from-source). Then open **Chargectl** from Applications. A short welcome walks you through: @@ -298,18 +298,18 @@ macOS charge limit, then removes everything Chargectl added. Details are under ### Homebrew ```sh -brew install --cask tyldra-org/tools/chargectl # install -brew update && brew upgrade --cask tyldra-org/tools/chargectl # update -brew uninstall --zap --cask tyldra-org/tools/chargectl # remove everything +brew install --cask tyldra/tools/chargectl # install +brew update && brew upgrade --cask tyldra/tools/chargectl # update +brew uninstall --zap --cask tyldra/tools/chargectl # remove everything ``` Chargectl updates itself, so `brew upgrade` without a name skips it. Use the -full name `tyldra-org/tools/chargectl`: Homebrew only loads casks from -other taps when you name them, or after `brew trust tyldra-org/tools`. +full name `tyldra/tools/chargectl`: Homebrew only loads casks from +other taps when you name them, or after `brew trust tyldra/tools`. ### Download -Each [release](https://github.com/tyldra-org/chargectl/releases) has +Each [release](https://github.com/tyldra/chargectl/releases) has `Chargectl-.zip`, its SHA-256 checksum and a build provenance attestation. Unzip it and move Chargectl to Applications. Releases are not notarized, so macOS blocks the first launch of a downloaded copy: open it once, @@ -318,7 +318,7 @@ download: ```sh shasum -a 256 -c Chargectl-.zip.sha256 -gh attestation verify Chargectl-.zip --repo tyldra-org/chargectl +gh attestation verify Chargectl-.zip --repo tyldra/chargectl ``` ### Build from source @@ -327,7 +327,7 @@ Needs Xcode 27 and [XcodeGen](https://github.com/yonaskolb/XcodeGen) (`brew install xcodegen`). ```sh -git clone https://github.com/tyldra-org/chargectl.git +git clone https://github.com/tyldra/chargectl.git cd chargectl ./scripts/install.sh # build and install the app ./scripts/install.sh --logs # same, then follow the helper's log @@ -349,7 +349,7 @@ limit, and removes: - the Login Items entries, preferences, caches and saved state; - Chargectl's tile in the Dock, pinned or under recent apps; - Homebrew's record of the cask, its cached download, and the - `tyldra-org/tools` tap when nothing else from it is installed. + `tyldra/tools` tap when nothing else from it is installed. If the helper is not running, it asks for your password and does the same as an administrator. diff --git a/SECURITY.md b/SECURITY.md index e7d7844..fc8080c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,7 +11,7 @@ Do not report security vulnerabilities through public issues, discussions or pull requests. Report privately through -[GitHub private vulnerability reporting](https://github.com/tyldra-org/chargectl/security/advisories/new). +[GitHub private vulnerability reporting](https://github.com/tyldra/chargectl/security/advisories/new). If you cannot use GitHub, email yogeshprasad098@gmail.com. Include as much of the following as you can: diff --git a/Shared/UninstallCleanup.swift b/Shared/UninstallCleanup.swift index 6382d31..09d9894 100644 --- a/Shared/UninstallCleanup.swift +++ b/Shared/UninstallCleanup.swift @@ -9,7 +9,9 @@ nonisolated enum UninstallCleanup { static let bundleIdentifier = "com.tyldra.chargectl" static let widgetsIdentifier = "com.tyldra.chargectl.widgets" - static let tap = "tyldra-org/tools" + static let tap = "tyldra/tools" + /// The tap's name before the organization was renamed. Installs from then keep it. + static let oldTap = "tyldra-org/tools" /// The widget extension's process, which WidgetKit keeps running between timeline updates. static let widgetsProcess = "ChargectlWidgets" @@ -82,15 +84,19 @@ nonisolated enum UninstallCleanup { /bin/rm -f "$plist" """ - /// Removes Homebrew's record of the cask, its cached downloads, and the tap when nothing else - /// from it is installed. `$1` is brew. `--force` succeeds although the app is already - /// deleted; everything the cask's zap lists is already removed by then. + /// Removes Homebrew's record of the cask, its cached downloads, and the tap, under its current + /// or old name, when nothing else from it is installed. `$1` is brew. `--force` succeeds + /// although the app is already deleted; everything the cask's zap lists is already removed by + /// then. static let homebrew = """ if [ -n "$1" ]; then export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_ENV_HINTS=1 - "$1" uninstall --cask --force \(tap)/chargectl - "$1" cleanup --prune=all \(tap)/chargectl - "$1" list --full-name 2>/dev/null | /usr/bin/grep -q '^\(tap)/' || "$1" untap \(tap) + "$1" uninstall --cask --force chargectl + "$1" cleanup --prune=all chargectl + for tap in \(tap) \(oldTap); do + "$1" tap | /usr/bin/grep -qx "$tap" || continue + "$1" list --full-name 2>/dev/null | /usr/bin/grep -q "^$tap/" || "$1" untap "$tap" + done fi """ diff --git a/Shared/Update/AppRelease.swift b/Shared/Update/AppRelease.swift index 3643aff..6076787 100644 --- a/Shared/Update/AppRelease.swift +++ b/Shared/Update/AppRelease.swift @@ -8,7 +8,7 @@ nonisolated struct AppRelease: Equatable, Sendable { /// Chargectl-.zip.sha256 var checksum: URL - static let feed = URL(string: "https://api.github.com/repos/tyldra-org/chargectl/releases/latest")! + static let feed = URL(string: "https://api.github.com/repos/tyldra/chargectl/releases/latest")! /// nil for a draft or prerelease, a tag that is not vMAJOR.MINOR.PATCH, or a release without /// its zip and checksum. diff --git a/Tests/AppReleaseTests.swift b/Tests/AppReleaseTests.swift index 1d527f4..08f1ad3 100644 --- a/Tests/AppReleaseTests.swift +++ b/Tests/AppReleaseTests.swift @@ -7,7 +7,7 @@ import Testing { let names = assets ?? ["Chargectl-0.2.0.zip", "Chargectl-0.2.0.zip.sha256", "chargectl.rb"] let list = names.map { - #"{"name":"\#($0)","browser_download_url":"https://github.com/tyldra-org/chargectl/releases/download/\#(tag)/\#($0)"}"# + #"{"name":"\#($0)","browser_download_url":"https://github.com/tyldra/chargectl/releases/download/\#(tag)/\#($0)"}"# } return Data( #"{"tag_name":"\#(tag)","draft":\#(draft),"prerelease":\#(prerelease),"assets":[\#(list.joined(separator: ","))]}"# diff --git a/Tests/UninstallCleanupTests.swift b/Tests/UninstallCleanupTests.swift index 5360093..3498936 100644 --- a/Tests/UninstallCleanupTests.swift +++ b/Tests/UninstallCleanupTests.swift @@ -59,4 +59,15 @@ import Testing #expect(script.contains("$(section \(section))")) } } + + /// Homebrew cleanup covers the tap under its current name and the one from before the + /// organization was renamed, and scripts/uninstall.sh fills in both. + @Test func homebrewCleanupCoversBothTapNames() throws { + let script = try String( + contentsOf: Self.root.appendingPathComponent("scripts/uninstall.sh"), encoding: .utf8) + #expect(UninstallCleanup.homebrew.contains(UninstallCleanup.tap)) + #expect(UninstallCleanup.homebrew.contains(UninstallCleanup.oldTap)) + #expect(script.contains(#"s|\\(tap)|\#(UninstallCleanup.tap)|g"#)) + #expect(script.contains(#"s|\\(oldTap)|\#(UninstallCleanup.oldTap)|g"#)) + } } diff --git a/scripts/cask.sh b/scripts/cask.sh index 871c2f8..90aa134 100755 --- a/scripts/cask.sh +++ b/scripts/cask.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Prints the Homebrew cask for a Chargectl release. The release workflow writes it to -# Casks/chargectl.rb in tyldra-org/homebrew-tools. +# Casks/chargectl.rb in tyldra/homebrew-tools. # # ./scripts/cask.sh .zip> # @@ -17,16 +17,16 @@ sha256=$2 [[ "$sha256" =~ ^[0-9a-f]{64}$ ]] || { echo "cask.sh: bad SHA-256: $sha256" >&2; exit 2; } cat < Uninstall Chargectl, or run: - brew uninstall --zap --cask tyldra-org/tools/chargectl + brew uninstall --zap --cask tyldra/tools/chargectl EOS end CASK diff --git a/scripts/import-release-certificate.sh b/scripts/import-release-certificate.sh index 0dac8a0..3e02cd7 100755 --- a/scripts/import-release-certificate.sh +++ b/scripts/import-release-certificate.sh @@ -12,7 +12,7 @@ set -euo pipefail # SHA-1 of the certificate made with scripts/make-release-certificate.sh. Public; the private # key exists only in the secrets and the maintainer's backup. expected=653E52E5F86FE7D3F69BCAC212ABEFFC4DBCF82B -upstream=tyldra-org/chargectl +upstream=tyldra/chargectl if [[ -z "${CERTIFICATE:-}" ]]; then if [[ "${GITHUB_REPOSITORY:-}" == "$upstream" ]]; then echo "::error::The release certificate secrets are missing. A release signed ad hoc would make every user install the helper again." diff --git a/scripts/release-notes.sh b/scripts/release-notes.sh index 155903b..0d00f93 100755 --- a/scripts/release-notes.sh +++ b/scripts/release-notes.sh @@ -6,7 +6,7 @@ set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" changelog="$root/CHANGELOG.md" -repo=https://github.com/tyldra-org/chargectl +repo=https://github.com/tyldra/chargectl if [[ $# -ne 1 ]]; then echo 'Usage: release-notes.sh ' >&2 exit 2 @@ -61,10 +61,10 @@ cat < diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 46efc3d..62b773a 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -33,7 +33,7 @@ rm -rf "$app" # What Homebrew keeps of the cask, when it installed Chargectl. brew= for prefix in /opt/homebrew /usr/local; do - if [[ -x "$prefix/bin/brew" && ( -d "$prefix/Caskroom/chargectl" || -d "$prefix/Library/Taps/tyldra-org/homebrew-tools" ) ]]; then + if [[ -x "$prefix/bin/brew" && ( -d "$prefix/Caskroom/chargectl" || -d "$prefix/Library/Taps/tyldra/homebrew-tools" || -d "$prefix/Library/Taps/tyldra-org/homebrew-tools" ) ]]; then brew="$prefix/bin/brew" fi done @@ -45,7 +45,7 @@ section() { awk -v name="$1" '$0 ~ "static let " name " = \"\"\"" { take = 1; next } take && /^ """/ { exit } take { sub(/^ /, ""); print }' \ "$(dirname "$0")/../Shared/UninstallCleanup.swift" | sed -e 's/\\(bundleIdentifier)/com.tyldra.chargectl/g' -e 's/\\(widgetsIdentifier)/com.tyldra.chargectl.widgets/g' \ - -e 's/\\(widgetsProcess)/ChargectlWidgets/g' -e 's|\\(tap)|tyldra-org/tools|g' + -e 's/\\(widgetsProcess)/ChargectlWidgets/g' -e 's|\\(tap)|tyldra/tools|g' -e 's|\\(oldTap)|tyldra-org/tools|g' } cleanup="$(section files) $(section trash)