Migrate 'dmenu-trans' to rofi

master
Hektor Misplon 2024-12-12 19:24:39 +01:00
parent fc08e2046b
commit 171d56150d
Signed by: hektor
GPG Key ID: 5151AF79E723F21C
2 changed files with 13 additions and 9 deletions

View File

@ -1,9 +0,0 @@
#!/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)"

13
.bin/rofi-trans Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl"
selected=$(echo -en "$options" | rofi -dmenu -p "source?:target?" -i)
# notify-send --app-name= -t 3000 "$(trans "$selected" -b "$(rofi -dmenu -p "$selected" &)" \
# | tr -d '\n' \
# | xclip -sel clip -f)"
translation="$(trans "$selected" -b "$(rofi -dmenu -p "$selected" &)" | tr -d '\n')"
echo -e "Copy" | rofi -p "translation" -dmenu -i -mesg "$translation" | xargs -I{} echo -n "$translation" | xclip -selection clipboard