Press <Key> to TranslatesteemCreated with Sketch.

in linux •  2 months ago  (edited)

Hi community!

aulfxz.png

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

DE: Mit folgendem Skript könnt ihr kleine Sätze und Wörter via Tastenkombination übersetzen lassen!

  • start via shortcut | starten via Tastenkombination
  • or via Terminal | oder via Terminal
  • enter text | Text eingeben
  • notification with translation | Benachrichtugung mit Übersetzung
  • clipboard with translation | Zwischenablage mit Übersetzung

075n5e.gif

The following packages are needed | Folgende Packete werden dafür benötigt:

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

Install dependencies | Abhängigkeiten installieren

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

Install script | Skript installieren

#!/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 :)

Wenn du im Skript etwas findest das verbessert werden kann, schreib gerne ein Kommentar!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

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!