Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Offer Remove for a job its deleted app left loaded, on macOS 27
Țugui Dragoșaf5e1a3dbb5b
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex e30aa515..5d588583 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -148979,6 +148979,112 @@}}},+ "Take it out of launchd now: the app that added it is gone, and so is what it ran." : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ihned odebrat úlohu z launchd: aplikace, která ji přidala, už tu není a není tu ani to, co spouštěla."+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Dieses Objekt jetzt aus launchd entfernen: Die App, die es hinzugefügt hat, ist nicht mehr vorhanden, und das, was es ausgeführt hat, auch nicht."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Quítalo de launchd ahora: la app que lo añadió ya no está, y lo que ejecutaba tampoco."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Retirer maintenant cet élément de launchd : l’app qui l’a ajouté a disparu, tout comme ce qu’il exécutait."+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Toglilo ora da launchd: l’app che l’ha aggiunto non c’è più, e nemmeno ciò che eseguiva."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "今すぐlaunchdから取り除きます。これを追加したアプリはなくなっていて、実行対象もありません。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "지금 launchd에서 제거하십시오. 이 항목을 추가한 앱도, 이 항목이 실행하던 프로그램도 사라졌습니다."+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Haal het nu uit launchd: de app die het heeft toegevoegd, is er niet meer, en wat het uitvoerde ook niet."+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Usuń teraz tę rzecz z launchd: aplikacji, która ją dodała, już nie ma, podobnie jak tego, co ta rzecz uruchamiała."+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Retirar este item do launchd agora: o app que o adicionou não existe mais, nem o que ele executava."+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Scoateți‑l acum din launchd: aplicația care l‑a adăugat nu mai există, la fel și ceea ce rula."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Убрать его из launchd сейчас: приложения, которое его добавило, больше нет, как и того, что он запускал."+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Ta bort det ur launchd nu: appen som lade till det är borta, liksom det som det körde."+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bunu şimdi launchd’den çıkar: onu ekleyen uygulama da çalıştırdığı şey de artık yok."+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Вилучити його з launchd зараз: програми, яка його додала, уже немає, як і того, що він запускав."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "立即将此任务从launchd中移除:添加它的App已不存在,它运行的程序也已不存在。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "立即將它從launchd中移除:加入它的App已不存在,它所執行的程式也已不存在。"+ }+ }+ }+ },"Taken before a macOS update" : {"localizations" : {"cs" : {diff --git a/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swift b/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swiftindex 667c1c23..efa1f059 100644--- a/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swift+++ b/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swift@@ -53,6 +53,10 @@ public struct BackgroundItem: Sendable, Hashable, Identifiable {public var isOwnerInstalled: Bool { ownerURL != nil }+ /// True for a job an app submitted that is still loaded after the app went, with nothing left to run: the app+ /// that would unregister it is gone, so only taking it out of launchd removes it.+ public var isLeftByAGoneApp: Bool { source == .app && !isOwnerInstalled && isOrphan }+/// Includes the file's path, because two files can declare one label (a per-user copy beside the/// system-wide one), and each file needs a row of its own.public var id: String { "\(kind.rawValue)/\(label)/\(plistURL?.path(percentEncoded: false) ?? "")" }diff --git a/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swiftindex 956eae42..48d30a4f 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swift@@ -26,6 +26,22 @@ struct BackgroundItemActionsTests {#expect(try !#require(JobDefinition(["Label": "a"])).loadsOnlyInTheBackground)}+ @Test func knowsAJobItsGoneAppLeftLoadedWithNothingToRun() {+ let job = { (source: BackgroundItem.Source, owner: URL?, isOrphan: Bool) in+ BackgroundItem(+ label: "org.example.helper", kind: .agent, source: source, plistURL: nil, program: nil,+ runsAtLoad: false, keepsAlive: false, ownerBundleIdentifier: "org.example.app", ownerName: "Example",+ ownerURL: owner, isOrphan: isOrphan, state: .loaded, isDisabled: false+ )+ }+ let installed = URL(filePath: "/Applications/Example.app", directoryHint: .isDirectory)++ #expect(job(.app, nil, true).isLeftByAGoneApp)+ #expect(!job(.app, installed, false).isLeftByAGoneApp)+ #expect(!job(.app, nil, false).isLeftByAGoneApp)+ #expect(!job(.userLibrary, nil, true).isLeftByAGoneApp)+ }+@Test func aDisabledJobLaunchdDoesNotHaveIsEnabledFirst() {let plist = URL(filePath: "/Users/x/Library/LaunchAgents/com.example.agent.plist")let disabled = BackgroundItem(diff --git a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swiftindex 1f0347c3..ecafdc8a 100644--- a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift+++ b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift@@ -311,16 +311,24 @@ struct BackgroundItemDetailView: View {private var ownControls: some View {Group {- // No Start or Stop for a job Peel sees only while it is loaded: once stopped it would leave the list,- // and Peel could not start it again. For an app's job, System Settings also offers only a switch.- if !item.isSeenOnlyWhileLoaded {- let isRunning = if case .running = item.state { true } else { false }- Button(isRunning ? "Stop" : "Start", systemImage: isRunning ? "stop.fill" : "play.fill") {- Task { await backgroundItems.perform(isRunning ? .stop : .start, on: item) }+ // Stopping takes the job out of launchd, and nothing else removes one whose app is gone.+ if #available(macOS 27, *), item.isLeftByAGoneApp {+ Button("Remove", systemImage: "xmark.circle") {+ Task { await backgroundItems.perform(.stop, on: item) }+ }+ .help(Text("Take it out of launchd now: the app that added it is gone, and so is what it ran."))+ } else {+ // No Start or Stop for a job Peel sees only while it is loaded: once stopped it would leave the list,+ // and Peel could not start it again. For an app's job, System Settings also offers only a switch.+ if !item.isSeenOnlyWhileLoaded {+ let isRunning = if case .running = item.state { true } else { false }+ Button(isRunning ? "Stop" : "Start", systemImage: isRunning ? "stop.fill" : "play.fill") {+ Task { await backgroundItems.perform(isRunning ? .stop : .start, on: item) }+ }+ }+ Button(item.isDisabled ? "Enable" : "Disable", systemImage: item.isDisabled ? "checkmark.circle" : "minus.circle") {+ Task { await backgroundItems.perform(item.isDisabled ? .enable : .disable, on: item) }}- }- Button(item.isDisabled ? "Enable" : "Disable", systemImage: item.isDisabled ? "checkmark.circle" : "minus.circle") {- Task { await backgroundItems.perform(item.isDisabled ? .enable : .disable, on: item) }}}.disabled(isBusy || item.requiresPrivileges && !helper.canAct)diff --git a/SAFETY.md b/SAFETY.mdindex c30121ec..1ccd3b08 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -226,6 +226,7 @@ Some of what Peel does is not a move to the Trash. Each is here with how it is u| Remove Downloads frees this Mac's copy of a file in iCloud Drive | The file stays in iCloud and downloads again when you open it || Build Artifacts leaves a project's build folders out of Time Machine, when you ask it to | The same checkbox takes the mark off || A background item is stopped, started, disabled, or enabled | The same buttons in Background Items; a disabled item stays disabled after a restart until you enable it |+| A background job a deleted app left loaded is removed (`launchctl bootout`), on macOS 27 | Nothing to bring back: its app, and what the job ran, are gone || A tweak changes a setting of macOS, and the Dock, Finder, Control Center, or the window manager restarts to read it | Turning the tweak off, or Turn All Off, puts back what was there before, or leaves it to macOS || The Terminal page adds Peel's profiles and options to Terminal, makes `~/.hushlogin`, writes Peel's shell and ssh files, and changes Git's settings | Put Back, turning the setting off, or Turn All Off, as [Terminal's settings](#terminals-settings) says |