Skip to content

Malcolm-GetAHead/BrewWidget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BrewMenuBar

A lightweight macOS menu bar app that monitors Homebrew package updates.

Menu Bar States

Features

  • πŸ”” Live update count in menu bar
  • 🎨 Visual indicators (βœ“ up-to-date, ↑ updates available, ! many updates)
  • πŸ“¦ Click individual packages to upgrade them
  • ⚑ Upgrade all packages at once
  • πŸ“Š Shows version changes (current β†’ new)
  • ⏰ Auto-refresh every hour
  • πŸ• Last checked timestamp
  • πŸ”„ Manual refresh option

Requirements

  • macOS 13.0 or later
  • Apple Silicon (M1/M2/M3/M4) or Intel Mac
  • Homebrew installed at /opt/homebrew/bin/brew (Apple Silicon) or /usr/local/bin/brew (Intel)

For Developers: Building from Source

Prerequisites

  • Xcode Command Line Tools installed (xcode-select --install)

Build Steps

  1. Clone or download this repository

  2. Navigate to the project directory:

    cd BrewWidget
  3. Compile the app:

    swiftc -parse-as-library -o BrewMenuBar BrewMenuBar.swift
  4. Create the app bundle:

    mkdir -p /Applications/BrewMenuBar.app/Contents/{MacOS,Resources}
    cp BrewMenuBar /Applications/BrewMenuBar.app/Contents/MacOS/
    chmod +x /Applications/BrewMenuBar.app/Contents/MacOS/BrewMenuBar
  5. Create Info.plist:

    cat > /Applications/BrewMenuBar.app/Contents/Info.plist << 'EOF'
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>CFBundleExecutable</key>
        <string>BrewMenuBar</string>
        <key>CFBundleIdentifier</key>
        <string>com.brewmenubar.app</string>
        <key>CFBundleName</key>
        <string>BrewMenuBar</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
        <key>LSUIElement</key>
        <true/>
    </dict>
    </plist>
    EOF
  6. Launch the app:

    open /Applications/BrewMenuBar.app

Building Universal Binary (Apple Silicon + Intel)

To create a universal binary that works on both architectures:

# Build for both architectures
swiftc -parse-as-library -target arm64-apple-macos13.0 -o BrewMenuBar-arm64 BrewMenuBar.swift
swiftc -parse-as-library -target x86_64-apple-macos13.0 -o BrewMenuBar-x86_64 BrewMenuBar.swift

# Create universal binary
lipo -create BrewMenuBar-arm64 BrewMenuBar-x86_64 -output BrewMenuBar

# Copy to app bundle
cp BrewMenuBar /Applications/BrewMenuBar.app/Contents/MacOS/

For Users: Installation

Option 1: Download Pre-built App (if available)

  1. Download BrewMenuBar.app.zip
  2. Unzip the file
  3. Move BrewMenuBar.app to your Applications folder
  4. Right-click the app and select "Open" (first time only, to bypass Gatekeeper)
  5. The app icon will appear in your menu bar

Option 2: Build from Source

Follow the "Building from Source" instructions above.

Enable Auto-Start at Login

Method 1: System Settings (Recommended)

  1. Open System Settings
  2. Go to General β†’ Login Items
  3. Click the + button under "Open at Login"
  4. Navigate to Applications folder
  5. Select BrewMenuBar.app
  6. Click Add

Method 2: LaunchAgent (Advanced)

  1. Create a LaunchAgent plist file:

    cat > ~/Library/LaunchAgents/com.brewmenubar.app.plist << 'EOF'
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.brewmenubar.app</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Applications/BrewMenuBar.app/Contents/MacOS/BrewMenuBar</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <false/>
    </dict>
    </plist>
    EOF
  2. Load the LaunchAgent:

    launchctl load ~/Library/LaunchAgents/com.brewmenubar.app.plist

Usage

Menu Dropdown

Menu Bar Icon States

  • βœ“ (Checkmark) - All packages up to date
  • ↑ (Arrow) - 1-5 packages need updates
  • ! (Exclamation) - 6+ packages need updates
  • ↻ ... (Spinner) - Currently checking for updates

Menu Options

  • Package list - Click any package to upgrade just that one
  • Refresh (⌘R) - Manually check for updates
  • Upgrade All (⌘U) - Upgrade all outdated packages
  • Quit (⌘Q) - Close the app

Automatic Updates

The app automatically checks for updates every hour. You can also manually refresh at any time.

Troubleshooting

App won't open

  • Right-click the app and select "Open" to bypass Gatekeeper
  • Or run: xattr -cr /Applications/BrewMenuBar.app

No icon appears in menu bar

  • Make sure the app is running: ps aux | grep BrewMenuBar
  • Try quitting and reopening the app

Homebrew not found

  • Verify Homebrew is installed: which brew
  • If installed in a non-standard location, you'll need to modify the source code

Multiple icons appear

The app includes single-instance protection, but if you see multiple icons:

killall BrewMenuBar
open /Applications/BrewMenuBar.app

Uninstallation

  1. Quit the app (click icon β†’ Quit)
  2. Remove from Login Items (System Settings β†’ General β†’ Login Items)
  3. Delete the app: rm -rf /Applications/BrewMenuBar.app
  4. (Optional) Remove LaunchAgent: rm ~/Library/LaunchAgents/com.brewmenubar.app.plist

License

This project is provided as-is for personal use.

Credits

Built with SwiftUI and AppKit for macOS.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages