Skip to content

Translates the text and displays it under cursor, works on wayland

License

Notifications You must be signed in to change notification settings

plzfgme/wl_translation_window

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wl_translation_window

Translates the text (with google translate) and displays it in a window under cursor, works on wayland.

Only tested on sway.

Usage

Usage: wl_translation_window [OPTIONS] --from-lang <FROM_LANG> --to-lang <TO_LANG>

Options:
  -f, --from-lang <FROM_LANG>  Language code (https://cloud.google.com/translate/docs/languages) to translate from
  -t, --to-lang <TO_LANG>      Language code (https://cloud.google.com/translate/docs/languages) to translate to
  -s, --src-text <SRC_TEXT>    Text to translate, if not provided, stdin will be used
  -h, --help                   Print help
  -V, --version                Print version

You can bind something like below to a shortcut in your desktop environment.

Combine with wl-clipboard to translate text from clipboard.

wl-paste | wl_translation_window --from-lang en --to-lang zh-CN

Combine with grimshot and tesseract to translate text from screenshot.

grimshot save area - | tesseract stdin stdout | wl_translation_window --from-lang en --to-lang zh-CN

About

Translates the text and displays it under cursor, works on wayland

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published