Skip to content

rapatao/btmgr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTManager

A macOS GUI tool written in Go for managing background tasks, login items, launch agents, and daemons — everything shown in System Settings → General → Login Items & Extensions.

Features

  • Lists all items from the BTM (Background Task Manager) database via sfltool dumpbtm
  • Shows full details: name, developer, team ID, identifier, executable path, URL, disposition, bundle IDs, generation, UUID
  • Filter by type (Login Item, Launch Agent, Daemon, App, Background App Refresh, Developer Tool, QuickLook, Spotlight) and search by name/identifier/developer
  • Enable/disable items (uses launchctl for agents/daemons, pluginkit for login items)
  • Remove items — deletes the plist file from disk and unloads the service
  • Inline plist viewer — when an item URL points to a .plist file, displays its content in the detail panel
  • Visual enabled/disabled status indicator per item in the list
  • Keyboard navigation in the item list
  • Dark theme UI

Requirements

  • macOS 13 (Ventura) or later
  • Go 1.22+
  • Xcode Command Line Tools (for Fyne's OpenGL dependencies)
xcode-select --install

Install & Run

# 1. Clone / download the project
cd btmgr

# 2. Build
make build

# 3. Run (sudo is needed for sfltool dumpbtm)
make run
# or
sudo ./build/btmgr

Build a .app bundle

make bundle
open build/BTManager.app

Note: The app needs sudo (or appropriate entitlements) to read the BTM database via sfltool dumpbtm. Enabling/disabling user-level agents and login items runs as the current user without sudo. Operations on system daemons and file deletion outside ~/ prompt for administrator credentials via a native macOS dialog.

Usage

Action How
View all items Launch the app — list loads automatically
Filter by type Use the Type dropdown
Search Type in the search box (matches name, identifier, developer)
View details Click any item in the list
Enable/Disable item Select item → click "Enable" or "Disable"
Remove item Select item → click "Remove" (only shown when a deletable file exists)
Refresh Click the Refresh button

Project Structure

btmgr/
├── cmd/btmgr/
│   └── main.go       # Entry point
├── internal/
│   ├── btm/
│   │   └── parser.go # sfltool/launchctl/pluginkit parsing & control
│   └── ui/
│       ├── app.go    # Fyne UI
│       └── theme.go  # Custom dark theme
├── Info.plist        # macOS app bundle metadata
├── Makefile
└── go.mod

How it works

  • Reading: Runs sudo sfltool dumpbtm (falls back to without sudo) and parses the output into structured Item objects. Stale entries pointing to deleted files are filtered out automatically.
  • Status: Runs launchctl print-disabled gui/<uid> for user services and launchctl print-disabled system for daemons to get the current enabled/disabled state.
  • Enable/Disable agents & daemons: Runs launchctl enable/disable gui/<uid>/<id> or system/<id>.
  • Enable/Disable login items: Uses pluginkit -e use/ignore -i <id> since Login Items are managed by BTM/pluginkit, not launchd.
  • Remove: Deletes the plist file (or .app bundle) from disk and unloads the service via launchctl bootout. Operations requiring root (system daemons, paths outside ~/) are batched into a single shell script executed with administrator privileges via osascript.

Caveats

  • sfltool dumpbtm requires root; the app will try with and without sudo
  • Some items registered purely via SMAppService cannot be force-removed (only enabled/disabled)
  • System-level daemons may require administrator credentials to control or remove
  • Login Item enable/disable state changes via pluginkit are not immediately reflected in sfltool dumpbtm output; the UI updates local state directly after toggling

About

A macOS GUI tool written in Go for managing background tasks, login items, launch agents, and daemons — everything shown in System Settings → General → Login Items & Extensions.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors