mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-18 00:30:40 -07:00
setup config
This commit is contained in:
parent
fa67e9d2ce
commit
41863c3945
@ -18,6 +18,7 @@ func configInit() {
|
||||
}
|
||||
config.AddConfigPath("$HOME/.config/gtt")
|
||||
|
||||
// create config file if not exists
|
||||
if err := config.ReadInConfig(); err != nil {
|
||||
config.Set("transparent", false)
|
||||
config.Set("theme", "Gruvbox")
|
||||
@ -28,4 +29,10 @@ func configInit() {
|
||||
}
|
||||
config.SafeWriteConfig();
|
||||
}
|
||||
|
||||
// setup
|
||||
theme = config.GetString("theme")
|
||||
transparent = config.GetBool("transparent")
|
||||
translator.src_lang = config.GetString("source_language")
|
||||
translator.dst_lang = config.GetString("destination_language")
|
||||
}
|
||||
|
6
main.go
6
main.go
@ -18,13 +18,11 @@ var (
|
||||
pages = tview.NewPages()
|
||||
window Window
|
||||
// config
|
||||
theme string = "Gruvbox"
|
||||
transparent bool = true
|
||||
theme string
|
||||
transparent bool
|
||||
)
|
||||
|
||||
func main() {
|
||||
translator.src_lang = "English"
|
||||
translator.dst_lang = "Chinese (Traditional)"
|
||||
// result, _ := translator.Translate("Hello world\nApple\nbumper")
|
||||
// fmt.Println(result)
|
||||
configInit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user