Code Monkey home page Code Monkey logo

rofi-translate's Introduction

Rofi translate

Simple rofi script for translation based on translate shell

Demo

Brief mode

Brief translation, provide simple translation with pronunciation audio.

Demo1

Verbose mode

Provide detail of specific translation

Demo2

Requirement

Archlinux

sudo pacman -S translate-shell rofi mplayer

Install

Download rofi-translate

git clone https://github.com/garyparrot/rofi-translate
cd rofi-translate

Configure environment variables

Edit .xprofile, add the following line.

export PATH=~/rofi-translate:$PATH

Usage

shell

$ rofi_trans
$ rofi_trans brief
$ rofi_trans verbose
$ rofi_trans delete

Add key binding for i3-wm

bindsym $mod+t exec rofi_trans

Configuration of rofi-translate

Open the file rofi_trans with your text editor. Then make changes to these environment variables.

function Configs {
    # the default translation engine for translate-shell.
    export primary_translator="google"

    # the alternative translation engine for translate-shell. Once the primary engine malfunctioned, the secondary engine replace it.
    export secondary_translator="bing"

    # the file use to storing your translating history.
    export transHistory="$HOME/.rofi_trans"

    # Directory for cache audio files
    export transAudioCacheDir="$HOME/.rofi_trans_audio"

    # target language for translation
    export transTarget="zh-TW"

    # transArgs: Arguement for translate shell
    export transArgs="-b -speak"

    # display some debug information, run it in shell so you can see it
    export verbose="1"

    # auto refresh the content of each mode after every operation, this will cause the rofi flash(close and open)
    export auto_refresh="1"

    export version=1
}

rofi-translate's People

Contributors

garyparrot avatar r888800009 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rofi-translate's Issues

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.