Skip to content

Neved4/applist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Badge Shell Script

applist - List app directories in macOS! 🚀

These utilities list app locations in macOS

The Swift (68.2 ms) and Objective-C (78.4 ms) implementations try to mimic mdfind's (29.1 ms) behavior, but run slower than it.

Getting Started

Note

This utility is only intended to run in macOS.

Prerequisites

When you are building [applist], ensure you have either:

Installing

If you have brew installed, just run:

$ brew install Neved4/tap/applist

Otherwise, first clone the repo:

$ git clone https://github.com/Neved4/applist

To build all variants, go to the project directory and run:

$ make all

Alternatively, to build the Objective-C version run:

$ clang -framework Cocoa -o applist-objc applist.mm

For the Swift version, run:

$ swiftc -O applist.swift -o applist-swift

Done!

Alternatively, if you'd rather not install or compile anything, feel free to add it as a function to your shell .profile:

applist() {
    mdfind "kMDItemContentType == 'com.apple.application-bundle'"
}

Usage

$ applist | grep "Docker.app"
/Applications/Docker.app

This comes handy for manual Homebrew reinstalls that lie outside the default install path:

$ brew reinstall --cask docker --applist $(applist | grep Docker)

Benchmarks

All programs were benchmarked with hyperfine under arm64:

Command Mean [ms] Min [ms] Max [ms] Relative
applist-sh 29.1 ± 1.7 27.2 33.7 1.00
applist-objc 68.2 ± 3.5 63.7 81.5 2.34 ± 0.18
applist-swift 78.4 ± 4.2 71.0 89.9 2.69 ± 0.21

See Also

For other shell functions like applist, check out apputils.

License

applist is licensed under the terms of the MIT License.

See the LICENSE file for details.