Skip to content

Make accounts file location configurable and switchable from tray menu - #717

Merged
redvox merged 3 commits into
mainfrom
feature/configurable-accounts-file
Oct 29, 2026
Merged

redvox merged 3 commits into
mainfrom
feature/configurable-accounts-file

Conversation

@MediaMarco

Copy link
Copy Markdown
Member

Summary

Makes the location of the accounts file configurable and adds a tray menu to switch between recently used accounts files.

Configurable accounts file

  • New accounts_path option in ~/.logsmith/config.yaml, e.g. accounts_path: ~/some/dir/my-accounts.yaml
  • The file name can be anything, but it must have a .yaml or .yml extension
  • ~ and environment variables (e.g. $HOME) are expanded
  • An invalid extension shows a config error and falls back to the default ~/.logsmith/accounts.yaml
  • Missing parent directories/files are created on startup and save
  • Saving via "Edit config" preserves the setting

Switch accounts file (tray menu)

  • New "Switch accounts file" submenu listing the last 10 used accounts files. It only shows files that exist, and the active one is checked
  • "Open accounts file..." opens a file picker that only shows .yaml/.yml files
  • Switching logs out, persists accounts_path and accounts_path_history to config.yaml, reloads the profile groups and rebuilds the tray menu

Fix

  • app.setQuitOnLastWindowClosed(False): Closing the file picker caused Qt to quit the tray app because it was considered the "last window"

Testing

  • Added unit tests for path resolution, extension validation, history handling and Core.switch_accounts_file
  • All 271 tests pass
  • Smoke-tested switching via the history menu and the file dialog with Qt offscreen

…ad of config.yaml

Switching the accounts file from the tray menu no longer writes config.yaml,
so it also works when config.yaml is read-only (e.g. managed by home-manager).
The selection takes precedence over accounts_path in config.yaml until
accounts_path is changed or the selected file no longer exists.
@redvox
redvox merged commit c0dc3dd into main Oct 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants