Skip to content

Conversation

@sassman
Copy link
Owner

@sassman sassman commented Nov 30, 2025

Summary

This PR adds support for a configuration file with named profiles, making it easy to save and reuse your favorite t-rec settings.

New Features

  • Config file support: Save your default settings in ~/.config/t-rec/config.toml (or local t-rec.toml)
  • Named profiles: Create different presets for various use cases (e.g., demo, quick, presentation)
  • Easy setup: Run t-rec --init-config to create a starter config file
  • Profile discovery: Use t-rec --list-profiles to see available profiles
  • Home directory expansion: Use $HOME in wallpaper paths for portability

Usage Examples

# Create a starter config file
t-rec --init-config

# Use a named profile
t-rec --profile demo

# List available profiles
t-rec --list-profiles

Example Config File

# Default settings applied to all recordings
[default]
wallpaper = "ventura"
wallpaper-padding = 60

# Named profiles for different use cases
[profiles.demo]
wallpaper = "ventura"
wallpaper-padding = 100
start-pause = "5s"
idle-pause = "5s"

[profiles.quick]
quiet = true
idle-pause = "1s"

[profiles.custom]
wallpaper = "$HOME/Pictures/my-wallpaper.png"
wallpaper-padding = 80

Supported Settings

All CLI options can be set in the config file:

  • wallpaper - Background wallpaper (built-in name or path)
  • wallpaper-padding - Padding around the recording (1-500px)
  • decor - Border decoration style (shadow or none)
  • bg - Background color (white, black, transparent)
  • quiet - Suppress the Ctrl+D banner
  • verbose - Enable verbose output
  • video / video-only - Generate MP4 video
  • natural - Disable idle detection
  • start-pause / end-pause / idle-pause - Timing controls
  • output - Output file name

Priority Order

Settings are applied in this order (later values override earlier):

  1. Built-in defaults
  2. Config file [default] section
  3. Config file [profiles.<name>] section (if --profile used)
  4. CLI arguments

Test plan

  • cargo build succeeds
  • cargo test passes (17 tests)
  • cargo clippy passes
  • Manual test: t-rec --init-config creates config file
  • Manual test: t-rec --list-profiles shows profiles
  • Manual test: t-rec --profile demo uses profile settings
  • Manual test: CLI args override profile settings

Closes #293

sassman and others added 2 commits November 30, 2025 17:17
Adds support for a TOML configuration file with named profiles:

- Config file at ~/.config/t-rec/config.toml (or local t-rec.toml)
- Default settings apply to all recordings
- Named profiles for different use cases (e.g., demo, quick)
- Profile selection via --profile <name>
- --init-config to create a starter config file
- --list-profiles to show available profiles
- $HOME expansion in wallpaper paths

New CLI options:
  --profile <name>    Use a named profile from config
  --init-config       Create starter config file
  --list-profiles     List available profiles

Config files support all CLI options: wallpaper, wallpaper-padding,
decor, bg, quiet, verbose, video, video-only, natural, start-pause,
end-pause, idle-pause, and output.

Closes #293

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Documents the new config file feature including:
- Quick start commands (--init-config, --list-profiles, --profile)
- Config file locations
- Example config file with profiles
- Usage examples
- All available config options table
- Also adds wallpaper options to Full Options section

Part of #293
@sassman sassman marked this pull request as ready for review November 30, 2025 16:33
@sassman sassman merged commit 6909f17 into main Nov 30, 2025
12 checks passed
@sassman sassman deleted the feat/config-profiles branch November 30, 2025 16:33
@5422m4n-bot 5422m4n-bot bot mentioned this pull request Nov 30, 2025
sassman pushed a commit that referenced this pull request Nov 30, 2025
## 🤖 New release

* `t-rec`: 0.7.10 -> 0.7.11

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.7.11](v0.7.10...v0.7.11)
- 2025-11-30

### Added

- add config file with profiles support
([#295](#295))
- support custom wallpaper images
([#294](#294))
- add --wallpaper option with macOS Ventura background
([#292](#292))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: 5422m4n-bot[bot] <203366424+5422m4n-bot[bot]@users.noreply.github.com>
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.

Config file for often used preferences

2 participants