diff options
| author | Paul Buetow <paul@buetow.org> | 2025-07-19 16:37:04 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-07-19 16:37:04 +0300 |
| commit | 77538381c28e4de8fa7d3f3731412c97699bb889 (patch) | |
| tree | 6abc09587e3dcb279f86f9c63c848ebfbee7b926 /cmd | |
| parent | 14357aee5c0db8665bea2da817d67f12d0499451 (diff) | |
feat: add app icon and change default output directory
- Add custom app icon with memory/brain theme
- Icon now displays in GNOME app menu, window title bar, and process list
- Change default output directory to ~/.local/state/totalrecall/
- Make output directory configurable via CLI flag, config file, or env var
- Add desktop entry file for GNOME integration
- Add install script for easy icon installation
- Update README with icon display and default directory information
- Bump version to 0.5.1
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/totalrecall/main.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/totalrecall/main.go b/cmd/totalrecall/main.go index 7fffbaf..f8039a8 100644 --- a/cmd/totalrecall/main.go +++ b/cmd/totalrecall/main.go @@ -73,11 +73,15 @@ func init() { // Initialize random number generator rand.Seed(time.Now().UnixNano()) + // Set default output directory + home, _ := os.UserHomeDir() + defaultOutputDir := filepath.Join(home, ".local", "state", "totalrecall") + // Global flags rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.totalrecall.yaml)") // Local flags - rootCmd.Flags().StringVarP(&outputDir, "output", "o", "./anki_cards", "Output directory") + rootCmd.Flags().StringVarP(&outputDir, "output", "o", defaultOutputDir, "Output directory") rootCmd.Flags().StringVarP(&audioFormat, "format", "f", "mp3", "Audio format (wav or mp3)") rootCmd.Flags().StringVar(&imageAPI, "image-api", "openai", "Image source (only openai supported)") rootCmd.Flags().StringVar(&batchFile, "batch", "", "Process words from file (one per line)") @@ -151,6 +155,11 @@ func initConfig() { } func runCommand(cmd *cobra.Command, args []string) error { + // Check if output directory was set in config file + if !cmd.Flags().Changed("output") && viper.IsSet("output.directory") { + outputDir = viper.GetString("output.directory") + } + // Handle --list-models flag if listModels { return listAvailableModels() |
