-
Notifications
You must be signed in to change notification settings - Fork 6
/
rofi_trans
executable file
·34 lines (26 loc) · 1.09 KB
/
rofi_trans
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# TODO: Fix search problem
# This is the entry of rofi trans-shell
# This script require trans-shell itself, if you don't have one.
# You can install it from your package manager(if provided) or from source(clone trans-shell from github)
function Configs {
# The default translator for translate-shell
export primary_translator="google"
# The alternative transltor for translate-shell
export secondary_translator="bing"
export transHistory="$HOME/.rofi_trans"
export transAudioCacheDir="$HOME/.rofi_trans_audio"
export transTarget="zh-TW"
export save_audio="save_audio"
export transArgs="-b -speak"
export verbose="1"
export auto_refresh="1"
export version=1
}
# Setup environment variable for configs.
Configs
if [[ -z "$default" ]]; then default="brief"; fi
if [[ "$1" == "verbose" ]]; then default="verbose"; fi
if [[ "$1" == "brief" ]]; then default="brief"; fi
if [[ "$1" == "delete" ]]; then default="delete"; fi
rofi -sidebar-mode -modi "verbose:rofi_trans_verbose,brief:rofi_trans_brief,delete:rofi_trans_delete" -show "$default"