Posts: 21
Joined: Wed Jan 03, 2018 8:40 pm

Translate Any Text You Select On Your solus Desktop With A Keyboard Shortcut And Notifications

Sat Jan 06, 2018 2:37 pm

ifind this useful iwant to share it

first make sure u install this from software center


then create new document text in ur home directory name it 'notitrans' and copy the script into the document and choose ur language like ido for arabic exemple for english (en) french (fr) ... any language u want

Code: Select all

#!/usr/bin/env bash
text="$(xsel -o)"
translate="$(wget -U "Mozilla/5.0" -qO - "$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"
echo "$translate" | xclip -selection clipboard
notify-send --icon=info "$text" "$translate"

then on terminal
chmod +x ~/notitrans

after this move it to /bin ( as root )

last think is put a custom keyboard shortcut like ido write this ... name = translate highlighted text
command = notitrans

now select what you want on desktop and press the shortcut u make .. ;)
Peek 2018-01-06 14-11.gif
Peek 2018-01-06 14-11.gif (205.83 KiB) Viewed 259 times
Last edited by samir on Sun Jan 07, 2018 12:12 am, edited 2 times in total.

Return to “Share All The Things!”