This tiny tool aims to ease the pain of
- Mouse selection (mainly text)
- Selecting actions in the pop-up menu after right clicking
- Recurring tasks given selected text
- You can think of it as a purely keyboard and open-source version of PopClip with some extra utility features.
- And it allows you to interact with some UI text that is not even possible to select using a mouse. Like those in a video game or in a button.
Text can be extracted from either UI elements or Apple VisionKit OCR results
demo.mp4
For users who are not satisfied with the default text editing experiences of editable text fields, this app allows you to edit them in your favorite editor, and automatically sync the saved content back to the UI element.
demo2.mp4
- Toggle multi-selection mode on (Shift key)
- Select starting/ending piece of text
- Select the other side, and the program will automatically guess the paragraph of intention
Here's an example of how to select and translate the lyrics in Apple Music.
demo3.mp4
If you want to select a specific sub-piece of text in an identified element, you can
- Split the whole context into pieces, the interface of word picker will pop up
- Toggle multi-selection mode on within the word picker
- Select both sides according to the hint keys
- UI element tree exploring mode (E)
- Useful for debugging and screenshot taking
- Apple Dictionary support in simple pop-up window
- Avoids the hassle of opening the dictionary app, like what PopClip will do
- Dictionary CSS is respected to make the text more readable
- Easily extensible text actions, please refer to the Configuration section
- Avoids the hassle of plugin management, easier to share across devices
- Act on text from clipboard
- Customizable theme
- Install with brew tap and start the service
brew tap blindfs/tools
brew install glyphlow
brew services start glyphlow-
Grant accessibility permission to it
-
Press the global trigger (defaults to "ALT + g") to start
This app is designed to be lean and clean, it only generates 2 files:
- A configuration file
$XDG_CONFIG_HOME/glyphlow/config.tomlor~/.config/glyphlow/config.tomlif the env-var is not set. - A cache file for temporary editing:
$XDG_CACHE_HOME/glyphlow/tempfile.mdor~/.cache/glyphlow/tempfile.md.
Here's how I configure it to perform those actions shown in the demo videos. A comprehensive configuration file is generated when you run this app at the first time.
colored_frame_min_size = 100
element_min_width = 15
element_min_height = 15
ocr_languages = [
"zh-Hans",
"ja-JP",
"en-US",
]
dictionaries = [
"牛津英汉汉英词典",
"New Oxford American Dictionary",
]
[[text_actions]]
display = " Google Search"
key = 'G'
command = "nu"
args = ["-c", "r#'{glyphlow_text}'# | url encode | ^open $'https://google.com/search?q=($in)'"]
[[text_actions]]
display = " Wikipedia Search"
key = 'W'
command = "nu"
args = ["-c", "r#'{glyphlow_text}'# | url encode | ^open $'https://en.wikipedia.org/wiki/Special:Search/($in)'"]
[[text_actions]]
display = " Goolge Translate -> zh_cn"
key = 'T'
command = "nu"
args = ["-c", "r#'{glyphlow_text}'# | url encode | ^open $'https://translate.google.com/?sl=auto&tl=zh_cn&text=($in)&op=translate'"]
[editor]
display = " Editor"
key = 'V'
# command = "tmux"
# args = ["new-window", "-t", "dev", "^open -a Ghostty; ^nvim {glyphlow_temp_file}"]
command = "open"
args = ["-a", "Zed", "{glyphlow_temp_file}"]
[theme]
hint_font = "AndaleMono:16"
menu_font = "IosevkaTerm Nerd Font Mono:26"- nix-flake
- menu bar icon