From c6b0ddc99b158549a0d290d3db7dd02434bb9b5c Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Sat, 9 Jan 2021 14:30:55 +0100 Subject: [PATCH] Add dmenu script for quick translating --- .bin/dmenu-trans | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 .bin/dmenu-trans diff --git a/.bin/dmenu-trans b/.bin/dmenu-trans new file mode 100755 index 0000000..fe15900 --- /dev/null +++ b/.bin/dmenu-trans @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl" + +selected=$(echo -e "$options" | dmenu -p "s?:t?" -i -l 0) + +notify-send --app-name= -t 3000 "$(trans $selected -b "$(dmenu -p $selected &)" \ + | tr -d '\n' \ + | xclip -sel clip -f)"