Press <Key> to TranslatesteemCreated with Sketch.

in #linux5 years ago (edited)

With the following script you can translate small sentences and words using a keyboard shortcut!

  • start via shortcut
  • or via Terminal
  • enter text
  • notification with translation
  • clipboard with translation

075n5e.gif

The following packages are needed

  • Menu: rofi, rofi-dmenu
  • Notifications: libnotify
  • Translation: translate-shell
  • Clipboard: xclip

Install dependencies

sudo pacman -S rofi rofi-dmenu libnotify translate-shell xclip

Install script

#!/bin/sh
# translates text from rofi prompt to clipboard and creates a notfication

notify-send -t 5000 "Translation" "$(trans -b "$(rofi -dmenu -p translate &)" | tr -d '\n' | xclip -sel clip -f)"

If you see something in the script that can be improved, feel free to write a comment :)

Sort:  

Congratulations @sebov1c! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You distributed more than 50 upvotes. Your next target is to reach 100 upvotes.
You got more than 10 replies. Your next target is to reach 50 replies.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:

Valentine's day challenge - Give a badge to your beloved!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!


Congratulations @sebov1c!
You raised your level and are now a Red Fish!

Do not miss the last post from @steemitboard:

Valentine's day challenge - Give a badge to your beloved!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.24
TRX 0.21
JST 0.036
BTC 97887.76
ETH 3371.78
USDT 1.00
SBD 3.36