Coder Social home page Coder Social logo

zkokaja / brewlet Goto Github PK

View Code? Open in Web Editor NEW
432.0 12.0 13.0 710 KB

The missing menulet for brew.sh: keeping your packages up-to-date, and your system secure.

License: BSD 2-Clause "Simplified" License

Swift 100.00%
homebrew brew menulet productivity menubar-app macos

brewlet's Introduction

Brewlet Icon Brewlet

GitHub Release

The missing menulet for brew.sh.

This menulet makes it easier to use brew.sh. For example, you need to manually check if some of your packages can be updated. With Brewlet it's easy: if everything is working swimmingly, then you'll see the normal shadow icon. If updates are available to be installed, the icon will become colored, , to get your attention โ€“ along with a notification if you wish. Once clicked, you'll be able to upgrade your packages, among other options. In addition, Brewlet will periodically check the status of packages in the background, so you don't have to.

When new versions are available, you can update all of them at once or manually choose specific packages:

Installation

Install with brew on the command line:

brew install brewlet

Or download the latest version from releases or here (zip).

You can upgrade to the latest version by running:

brew update
brew upgrade brewlet

On the horizon

I am currently working on adding more features, listed in order of priority here:

  • Ability to handle casks
  • Ability to install brew if not found
  • About page with detailed information
  • Features suggested by community (see Issues).

Update vs Upgrade

The update operation pulls the latest version of Homebrew and updates the metadata related to packages. From the man pages:

Fetch the newest version of Homebrew and all formulae from GitHub using git(1) and perform any necessary migrations.

Whereas upgrade will actually upgrade your outdated packages to the latest version(s).

Upgrade outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options.

Developer

Contributions are welcome!

You can look for logged messages and errors with the Console app, or this command:

$ log show --predicate 'process == "Brewlet"' --info
$ log show --predicate "processID == `pgrep Brewlet`" --info --last 1h

To test for outdated packages, reinstall some older versions from a specific commit. For example:

$ brew uninstall jq 
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/b76347c21bbe20accf0a514b138515e30a48ad12/Formula/jq.rb

To generate images of different sizes, use Inkscape on the command line:

$ len=64 # or use a for loop
$ inkscape --export-type="png" \
           --export-file brewlet-"$len".png \
           -w "$len" \
           brewlet.svg

Brew will redirect output of the upgrade command to a temporary file, you can use this command to locate it.

$ find /var/folders -type f -name 'brewlet*log' 2> /dev/null

License & Acknowledgements

Because this app is closely tied to brew.sh, I used their icon as a template. I also decided to adopt their choice of license: BSD 2-Clause "Simplified" License.

Security & Permissions

Brewlet needs to be able to access to:

  • the brew.sh shell script to get information and take action on your behalf.
  • access to write to your Downloads folder when exporting a list of packages.
  • permissions to send you notifications when updates are available, and when unexpected errors occur.

brewlet's People

Contributors

cmpadden avatar kawarimidoll avatar methbkts avatar seekingmeaning avatar zachberger avatar zkokaja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brewlet's Issues

Menu icon darker than other applications

image

When using the light appearance setting, the Brewlet menu icon is a bit darker than both 3rd party application icons, and built-in icons. While this is not really an issue, it would be nice for the icons to be uniform.

Release a universal binary

Now that Macs have been released with Apple Silicon it would be nice to have a universal binary that supports arm64.

I've tested this on my new M1-based MacBook Pro and everything seems to work as intended.

version number broken

i've downloaded what is supposed to be version 1.5, but it identifies itself as version 1.0

both the CFBundleVersion and CFBundleShortVersionString entries in your Info.plist are broken
Screenshot 2021-01-28 at 22 39 18

Cask formulas were not requested/updated by brewlet. Brewlet doesn't use json=v2.

Currently cask formulas were not requested nor updated by brewlet.
It is probably because --json=v2 is not used.

See also man brew:

      --json                       Print a JSON representation. Currently the
                                   default value for version is v1 for
                                   formula. For formula and cask use
                                   v2. See the docs for examples of using
                                   the JSON output:
                                   https://docs.brew.sh/Querying-Brew

The following patch should fix the problem:

@@ -235,7 +235,7 @@
         let packageItem = self.statusMenu.item(withTag: self.name2tag["packages"]!)!
         packageItem.isEnabled = false
         
-        run_command(arguments: ["info", "--json", "--installed"]) { (_, data: Data) in
+        run_command(arguments: ["info", "--json=v2", "--installed"]) { (_, data: Data) in
             
             // Determine which packages to include
             let includeDependencies = self.userDefaults.bool(forKey: "includeDependencies")

Upgrade button can be clicked many times

  • Installed app
  • had packages out of date, so I clicked "Upgrade"
  • app is doing stuff in the background, but no indication of progress ๐Ÿคท

edit: the keg icon is "filling", but see title.
ps: good stuff, thank you!

Formulae that require user intervention cause Brewlet to update forever

Some Homebrew formulae (casks) require CLI intervention when upgrading (for example, I am aware of dotnet-sdk, virtualbox and vagrant). Their installers require the administrator password in order to uninstall/reinstall components.

When these are installed on a system, Brewlet will still run an update, but will endlessly show that it is updating because these prompts are never shown or responded to.

Not sure what the best option might be for handling these.

macOS notifications

A nice feature (maybe you have it planned?), would be for system notifications (i.e., macOS-integrated). Ideally they could be configured in Preferences with checkboxes for various types of notifications, like:

  • Found X packages out-of-date (maybe a sub-checkbox for displaying a notification when no outdated packages are found)
  • Beginning download of PKG
  • Finished download of PKG
  • Beginning install of PKG
  • Finished install of PKG
  • Error downloading/installing PKG
  • Overall summary (number of packages successfully updated, failed, etc.)

Version 1.6 displays as 1.5 in Finder

image

I was a bit confused while testing for #22 because I thought I installed the wrong version. Turns out it's just that the app shows the wrong version number in the Finder.

It would however be nice if the menulet also had a way of showing some project information, like showing the version, declaring the license and linking to this bug tracker. That should probably be it's own bug I guess?

Easier way to set custom brew location

In order to see that I have entered the right path to a custom brew location,
as a user,
I would like some feedback from the app that the path was indeed correct.

Bonus points:

  • if I can use the MacOS Path Chooser instead of having to type it in
  • If I can use copy/paste to paste the path from the terminal
  • if I can use select all (cmd-a) to select the full path to delete it

Open at login

I manually added Brewlet to my login items in system settings but usually there's a toggle in app preferences.

Add option to open logs

When an error occurs, a notification displays a message that you should look at the logs, however there is no easy way to open the logs.
Would it be possible to add either an item in the menu to open the logs or add an option in the notification ?

Have a way to watch build progress

i.e. some way to show the text output from brew, so I can see the progress and easily inspect errors.

Maybe as simple as some apple script to open Konsole with the right log open?

Allow customization of brew path

Homebrew allows custom install paths. In addition on Apple Silicon based Macs homebrew should be installed at /opt/homebrew. Because of this, Brewlet should support custom hombrew paths instead of the hardcoded /usr/local/Homebrew/bin/brew.

brewdo support?

Thanks for creating this great little app.

Any chance of adding brewdo support? It would basically just mean being aware of the need to elevate to the _homebrew user and running brewdo instead of brew.

New Feature: Check for security vulnerabilities

It would be great to add functionality to periodically check for security vulnerabilities in any of the user's installed packages. We can at the very least notify them, and send them more details of actions to take, if a fix isn't available via an update.

Stuck in dark mode icon

My brewlet icon is always in dark mode (blue-ish) even though my MacBook is set to light mode.
Toggling the appearance doesn't fix it. Neither does restarting the app.
I'm on macOS Sonoma 14.2.1 (M1 chip)

Allow bigger time range for update checks

4.5 hours is mighty short for me, I would much rather do it only once a day.

Perhaps aa logarithmic time scale with a display of the currently selected value (so you don't have to discover the tooltip for that) would make sense?

Lots of random crashes

Hi there,

not quite sure what is going on, but I seem to get lots of crashes that seem kind of random in nature?

Always fairly short after the app has started up and has initialized its data from homebrew.

Some crash reports are appended, but they don't seem to point me to a common reason?

Brewlet Crash reports.zip

Ability to uninstall or upgrade individual packages

Using the Brewlet menulet has made me realize that there are many packages on my system that I no longer rely on. I think that it would be beneficial to have a way to easily uninstall, or manage, individual packages.

This could be done by spawning a window when the package name is clicked that
presents the user with the brew info for that package, along with a button to
uninstall, or upgrade.

Add Unit Tests

This project should have unit tests to ensure new changes don't break functionality.

List new formulae/casks?

I recently discovered Brewlet when I saw it in my daily brew upgrade:

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/cask-fonts).
==> New Formulae
cpplint                                                                nuclei
==> Updated Formulae
Updated 72 formulae.
==> New Casks
brewlet                                        font-iosevka-ss15                              pokemon-trading-card-game-online
==> Updated Casks
Updated 93 casks.

And one of the things I like to do is a brew info foo when I see a formula or cask that sounds interesting. I'm not sure if there's a good way to display something like that in Brewlet, but I'd love it if possible! (Be it a list of new formulae/casks, or even a way to get the brew info info.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.