I have a couple of console commands that I a) want to run and stop at demand (optionally automated) and b) without opening terminal window and/or leaving it open, ideally from menu bar. Some of them require root.
(One example of such command is proximac — it forces certain apps to use proxy, useful when they don’t respect system proxy settings. I want to run it when I connect to SOCKS proxy at work, and stop when I leave)
What’s the best way or app to launch command line tools from the menu bar?
Best Answer
You can enable the Script menu from the built-in Script Editor.app: Preferences → General → Show Script menu in menu bar.
Then you can place any AppleScript in this menu by putting the script in your Scripts folder.
https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/UsetheSystem-WideScriptMenu.html