Skip to content

Instantly share code, notes, and snippets.

@ccnokes
Last active December 8, 2022 12:10
Show Gist options
  • Save ccnokes/af3a1fe7434e284650693787f99d4e1c to your computer and use it in GitHub Desktop.
Save ccnokes/af3a1fe7434e284650693787f99d4e1c to your computer and use it in GitHub Desktop.
Bash script that checks for apps that use Electron. Detailed a bit more here: https://cameronnokes.com/blog/how-to-know-if-a-desktop-app-uses-electron/
#!/bin/bash
target="${1:-/Applications}"
check() {
stat "$1/Contents/Frameworks/Electron Framework.framework" &> /dev/null
if [[ $? = 0 ]]; then
echo "$1 uses Electron"
fi
}
export -f check
find "$target" -maxdepth 2 -type d -name "*.app" -exec bash -c 'check "{}"' \;
# give this script executable permissions (chmod +x), then run. By default it'll check /Applications
@darzo27
Copy link

darzo27 commented May 12, 2020

This is brilliant !
Saw your post https://cameronnokes.com/blog/how-to-know-if-a-desktop-app-uses-electron/

As some Hackintosh machines can sometimes lag due to Electron apps, I needed to find out how to determine which apps are the culprit, your site link was one of the top hits and the best! Hint, hint - Hackintosh / cursor lag may be tags to add to that page.

Also, while I overstate the comment, entering "/Applications" as a parameter for the script was sufficient to output the apps, adding the suggestion in the echo might save someone a few seconds.

@ccnokes
Copy link
Author

ccnokes commented May 16, 2020

Thanks for the suggestion darzo! I just made /Applications the default. Should have done that from the outset.

This is brilliant !
Saw your post https://cameronnokes.com/blog/how-to-know-if-a-desktop-app-uses-electron/

As some Hackintosh machines can sometimes lag due to Electron apps, I needed to find out how to determine which apps are the culprit, your site link was one of the top hits and the best! Hint, hint - Hackintosh / cursor lag may be tags to add to that page.

Also, while I overstate the comment, entering "/Applications" as a parameter for the script was sufficient to output the apps, adding the suggestion in the echo might save someone a few seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment