Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env bash
# translates any selection and displays the result in a notification.
# Install:
# - sudo apt install libnotify-bin xsel jq
# - you can copy this file to ~/bin, /usr/local/bin or somewhere and make it executable
# - configure a hotkey to execute it. You can use xbindkeys or your DE settings
in=$(xsel -o | sed "s/[\"'<>]//g")
notify-send --icon=info "$in" "$(wget -U "Mozilla/5.0" -qO - "$in" |jq -r '.[0][0:]|.[]|.[1]')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment