Programmable tooltip that can be used with any Mac OS app
Tip (or its full name, Universal Tip) is a programmable tooltip that can be used with any Mac OS app. You can select the text and hit the shortcuts to activate a tooltip with useful info.
“Useful info” is programmed by you using your favourite programming language.
For me, who is prone to Repetitive strain injury and Carpal tunnel syndrome, Tip reduces hand movement which helps reduce the risk of the injury.
I’d love for you to try it!
Questions? please don’t hesitate to open a Github issue.
Tip is used within Chrome.
If you’ve installed Tip, try converting seconds from epoch to time by triggering Tip on the following string: 1577733633
Tip is used within Sublime.
Tip is used within Terminal.
Tip is used within Terminal.
You can make your own info provider. The possibility is endless!
Tip.app
to under /Applications
scripts/provider.script
to ~/Library/Application\ Scripts/tanin.tip/provider.script
. Run chmod 755 ~/Library/Application\ Scripts/tanin.tip/provider.script
.
curl -o ~/Library/Application\ Scripts/tanin.tip/provider.script --create-dirs https://raw.githubusercontent.com/tanin47/tip/master/scripts/provider.script && chmod 755 ~/Library/Application\ Scripts/tanin.tip/provider.script
The sample provider script is in Ruby, so you need Ruby to run it. Otherwise, you can make your own provider as well.
See how to develop the provider script here.
Cmd + &
.Currently, Tip supports 3 actions: (1) Copy to clipboard if the item is text, (2) Open URL if the item is URL, and (3) Execute a command.
See how to develop the provider script here.
Go to System Preferences > Keyboard > Shortcuts > Services and set the shortcut for “Tip: open tips”.
If your shortcut doesn’t include the Command key, you will need to activate it manually by:
Now you’ll be able to use the new shortcut for Tip.
I’ve found that Cmd + F3
is a good shortcut. I haven’t encountered an application that uses this shortcut yet.
My setup, which enables me to use Tip seamlessly, is:
Cmd + F3
Cmd + F3
I use Noo.app to configure my mouse buttons and trackpad.
There are 3 components that enables Tip to maintain a high degree of privacy: App Sandbox, NSService, and NSUserUnixTask
Tip runs in App Sandbox without requesting for an additional permission. With App Sandbox, Tip can only read/write files from a few predefined directories and, specifically, can only execute (not write) the files within ~/Library/Application\ Scripts/tanin.tip
. This is the reason why the provider script is under ~/Library/Application\ Scripts/tanin.tip/
.
Tip is based on NSServices. Tip doesn’t (and cannot) see the content of other applications. When you explicit trigger Tip, Mac OS gives Tip the selected text.
Tip uses NSUserUnixTask, which is intended to execute user-supplied scripts, and will execute them outside of the application’s sandbox, if any. This enables provider.script
(a user-supplied script) many more use cases because it runs outside of the sandbox.
Great design by Apple. It is a huge win in terms of privacy.
Tip is an NSServices. When user selects text and hits the shortcut, the selected text is sent to Tip. Then, Tip invokes the command-line tool with the selected text as the first argument, i.e ~/Library/Application\ Scripts/tanin.tip/provider.script [selected-text] --bundle-id [the-app-that-you-activate-tip-on]
.
The command-line tool processes the input, decides which info to show, and prints the tip items as JSON that looks like below:
[
{"type": "text", "value": "Some text"},
{"type": "url", "label": "Go to JIRA", "value": "https://your-jira-url/JIRA-0001"},
]
Tip processes the JSON and renders the tooltip at the mouse location.
Because I don’t know how to write Swift. I’d like to switch to Swift though.
Tip is a Thai word that means magical and divine. The word is derived from the word, divya, which exists in both Pali and Sanskrit.