Skip to content

Instantly share code, notes, and snippets.

View Monsterovich's full-sized avatar
🏠
Working from home

Monsterovich

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bash
# A pop-up dictionary based on translate-shell and notifications
# Bind this script to a hotkey and select a word to get its dictionary entry.
# https://github.com/soimort/translate-shell
# ' and " are removed
text=$(xsel -o | sed "s/[\"']//g")
path=$(dirname "$0")
output=$(sh ${path}/translate --no-ansi ${text})