aboutsummaryrefslogtreecommitdiff
path: root/local/bin/translate-prompt
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2024-11-11 21:16:03 +0100
committerCharles Cabergs <me@cacharle.xyz>2024-11-11 21:16:03 +0100
commit7e2dff6d3bf76eb46d4736cbda4178cbc8f4efa1 (patch)
treee24747e40673196a7e8fb34791bc10d8e9342b42 /local/bin/translate-prompt
parent90df8624a43c440ffa77c02f74f4ef1cb27a6648 (diff)
downloaddotfiles-7e2dff6d3bf76eb46d4736cbda4178cbc8f4efa1.tar.gz
dotfiles-7e2dff6d3bf76eb46d4736cbda4178cbc8f4efa1.tar.bz2
dotfiles-7e2dff6d3bf76eb46d4736cbda4178cbc8f4efa1.zip
Add translate from text selection
Diffstat (limited to 'local/bin/translate-prompt')
-rwxr-xr-xlocal/bin/translate-prompt4
1 files changed, 4 insertions, 0 deletions
diff --git a/local/bin/translate-prompt b/local/bin/translate-prompt
index d1588da..fb23b56 100755
--- a/local/bin/translate-prompt
+++ b/local/bin/translate-prompt
@@ -10,6 +10,7 @@ command -v rofi > /dev/null &&
choice="$(
$menu_exec <<EOF
+From Selection
From Clipboard
Open Editor
EOF
@@ -20,6 +21,9 @@ EOF
text_file="$(mktemp /tmp/translate_prompt_text_XXXXXX)"
case "$choice" in
+ 'From Selection')
+ xsel --output > "$text_file"
+ ;;
'From Clipboard')
xclip -out -selection clipboard > "$text_file"
;;