diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/totalrecall/main.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/totalrecall/main.go b/cmd/totalrecall/main.go index f50750f..ab06987 100644 --- a/cmd/totalrecall/main.go +++ b/cmd/totalrecall/main.go @@ -73,7 +73,7 @@ func init() { // Initialize random number generator rand.Seed(time.Now().UnixNano()) - // Set default output directory to Downloads + // Set default output directory based on mode home, _ := os.UserHomeDir() defaultOutputDir := filepath.Join(home, "Downloads") @@ -931,12 +931,21 @@ Word: [IPA transcription] func runGUIMode() error { // Create GUI configuration from command line flags and viper config guiConfig := &gui.Config{ - OutputDir: outputDir, AudioFormat: audioFormat, ImageProvider: imageAPI, OpenAIKey: getOpenAIKey(), } + // Only set OutputDir if it was explicitly provided via flag + // Check if the outputDir is different from the default + home, _ := os.UserHomeDir() + defaultOutputDir := filepath.Join(home, "Downloads") + if outputDir != defaultOutputDir { + // User explicitly set a different output directory + guiConfig.OutputDir = outputDir + } + // Otherwise, gui.New will use its own default (XDG state directory) + // Create and run GUI application app := gui.New(guiConfig) app.Run() |
