Code Monkey home page Code Monkey logo

pot-desktop's Introduction

Pot (Translator of Pylogmon)

🌈 A cross-platform software for text translation (Telegram Group)

License Tauri JavaScript Rust Windows MacOS Linux



中文 | English

Instructions

Selection Translation Select the text to be translated, then press the shortcut key for word translation.
Input Translation Press the shortcut key for translation input, enter the text to be translated, and press Enter to translate.
Plugin Invocation Select the text to be translated and click the plugin icon. More information Plugin Invocation
Clipboard Listening Mode Open the translation window, start the clipboard listening mode, and copy the content you want to translate
Screenshot OCR Press the shortcut key for screenshot OCR, select the screenshot area in the box
Screenshot Translation Press the shortcut key for screenshot translation, select the screenshot area in the box

Features

  • Input text and translate
  • Selection text and translate
  • Invoke by other software to translate (Detail)
  • Listening clipboard to translate
  • OpenAI API support
  • Multi-API support (Support Apis)
  • Multi-language support
  • Export to Anki/Eudic (or add more)
  • Available on all PC platforms (Windows, macOS, and Linux)
  • Good Wayland support (Test on KDE and Gnome)
  • OCR support (Support Apis)
  • Screenshot translate

Support Apis

Translation

OCR

Installation

Windows

Install via Winget

winget install Pylogmon.pot

Install Manually

  1. Download the installation package ending in .exe from the Latest Release page.
  2. Double click the downloaded file to install it.

MacOS

Install via Brew

  1. Add our tap:
brew tap pot-app/homebrew-tap
  1. Install pot:
brew install --cask pot
  1. Upgrade pot
brew upgrade --cask pot

Install Manually

  1. Download the installation package ending in .dmg from the Latest Release page. (If you are using M1, please download the installation package named pot_{version}_aarch64.dmg, otherwise download the installation package named pot_{version}_x64.dmg)
  2. Double click the downloaded file to install it.

Troubleshooting

  • "pot" can’t be opened because the developer cannot be verified.

    Click the Cancel button, then go to the Settings -> Privacy and Security page, click the Still Open button, and then click the Open button in the pop-up window. After that, there will be no more pop-up warnings when opening pot.

    If you cannot find the above options in Privacy & Security, or get error prompts such as broken files with Apple Silicon machines. Open Terminal.app and enter the following command (you may need to enter a password halfway through), then restart pot:

    sudo xattr -d com.apple.quarantine /Applications/pot.app
  • If you encounter a permission prompt every time you open it, or if you cannot perform a shortcut translation, please go to Settings -> Privacy & Security -> Supporting Features to remove pot, and then re-add pot.

Linux

Debian/Ubuntu

We provide AppImage and deb packages for Linux.

Please note that: There are two deb package, universal is based on glibc2.28 and openssl-1.1, If the regular deb package can't run on your machine due to dependency problems, please download the universal package, Due to its low version dependency, it can run on most systems.

Arch/Manjaro

  1. View on AUR

Use aur helper:

yay -S pot-translation # or pot-translation-bin or pot-translation-git
# or
paru -S pot-translation # or pot-translation-bin or pot-translation-git
  1. If you are using archlinuxcn, you can install directly using pacman:
sudo pacman -S pot-translation-bin

Plugin Invocation

Introduction

Pot supports invoke by other software. In this way, with the help of other software, it is very convenient to translate.

Pot provides two ways to call it from outside, you can also call it through other software you like

Both ways require the pot to keep running in the background.

  1. Call the pot via the command line
pot popclip "hello world" # The second parameter is what you want to translate
  1. Call the pot via the HTTP Request
curl 'http://127.0.0.1:60828' -X POST -d "Hello world" # The body content is what you want to translate

Existing Usage

SnipDo (Windows)

  1. Download and install SnipDo in the Microsoft Store
  2. Download the SnipDo extension of pot from the Latest Release (pot.pbar)
  3. Double click the downloaded file to install it.
  4. Selection some text, you can see the pot icon in the upper right corner of the selection, click the icon to translate.

PopClip (MacOS)

  1. Download and install PopClip in the App Store
  2. Download the PopClip extension of pot from the Latest Release (pot.popclipextz)
  3. Double click the downloaded file to install it.
  4. Enable the pot extension in PopClip settings, and then you can translate by selecting text.

Starry (Linux)

Starry is still in the development stage, so you can only compile him manually

Github: ccslykx/Starry

Wayland Support

Due to the varying levels of support for Wayland among different distributions, pot itself cannot achieve perfect compatibility. However, here are some solutions to common issues that can be implemented through proper configuration, allowing pot to run flawlessly on Wayland.

Shortcut key cannot be used

Due to Tauri's lack of support for Wayland, the shortcut key scheme in the pot application cannot be used under Wayland. To address this issue, pot provides command-line startup parameters that allow system shortcuts to be set through commands.

All commands need "pot" to remain running in the background.

pot cofig # Start the configuration window
pot persistent # Input translation
pot translate # Selection translation
pot screenshot_ocr # Screenshot OCR
pot screenshot_translate # Screenshot Translate
pot screenshot_ocr without_screenshot # Screenshot OCR(without screenshot)
pot screenshot_translate without_screenshot # Screenshot Translate(without screenshot)

Screenshot doesn't work

In some pure Wayland desktop environments/window managers (such as Hyprland), the built-in screenshot feature of pot cannot be used. In this case, you can use other screenshot tools instead by using command line parameters. Simply save the screenshot to ~/.cache/com.pylogmon.pot/pot_screenshot_cut.png and then execute pot screenshot_ocr without_screenshot.

Here is an example configuration in Hyprland (using grim and slurp for screenshots):

bind = ALT, X, exec, grim -g "$(slurp)" ~/.cache/com.pylogmon.pot/pot_screenshot_cut.png && pot screenshot_ocr without_screenshot
bind = ALT, C, exec, grim -g "$(slurp)" ~/.cache/com.pylogmon.pot/pot_screenshot_cut.png && pot screenshot_translate without_screenshot

Other desktop environments/window managers also have similar operations.

The translation window follows the mouse position.

Due to the current inability of pot to obtain accurate mouse coordinates under Wayland, its internal implementation cannot function properly. For certain desktop environments/window managers, it is possible to achieve window following mouse position by setting window rules. Here we take Hyprland as an example:

windowrulev2 = float, class:(pot), title:(Translator|OCR|PopClip|Screenshot Translate) # Translation window floating
windowrulev2 = move cursor 0 0, class:(pot), title:(Translator|PopClip|Screenshot Translate) # Translation window follows the mouse position.

Contributors

Manual compilation

Requirements

Node.js >= 18.0.0

pnpm >= 8.5.0

Rust >= 1.69.0

Start compilation

  1. Clone the repository

    git clone https://github.com/pot-app/pot-desktop.git
  2. Install dependencies

    cd pot-desktop
    pnpm install
  3. Install dependencies(Only Linux)

sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libxdo-dev libxcb1 libxrandr2 libdbus-1-3
  1. Development (Optional)

    pnpm tauri dev # Run the app in development mode
  2. Build

    pnpm tauri build # Build into installation package

Acknowledgement

pot-desktop's People

Contributors

pylogmon avatar xtyuns avatar layouwen avatar ccslykx avatar liudonghua123 avatar bestpika avatar bylevel avatar binw666 avatar yetone avatar jhongyu avatar vanja-san avatar kuingsmile avatar eltociear avatar havokdan avatar zhtjtcz avatar ph3n92h3 avatar eliauk365 avatar alphaboom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.