Fixes#560
### Add theme color overrides in configuration file
Link to #560
### Problem
Currently, customizing television's appearance to match personal style
requires users to rebuild from source code to modify theme colors. This
creates a significant barrier for users who want to personalize their
experience without dealing with compilation and development setup.
Users who want to adjust colors for better readability, match their
terminal theme, or create custom color schemes must either:
- Modify theme files in the source code
- Rebuild the entire application
- Maintain separate theme files
This workflow is not user-friendly and prevents quick experimentation
with different color combinations.
### Solution
Added theme color overrides directly in the configuration file, allowing
users to customize any theme color without rebuilding from source. The
themes/*.toml files now serve as defaults, while the configuration file
provides overrides that take precedence.
### Key features:
- No rebuild required: Customize colors instantly through config
- Easy testing: Try different color combinations without compilation
- Theme flexibility: Mix and match colors from different themes
- Backward compatible: Existing configs continue to work unchanged
- User-friendly: Simple TOML syntax for color customization
### Usage Example
Find your config file location:
```
Default locations:
# Unix: ~/.config/television/config.toml
# Windows: %APPDATA%\television\config.toml
```
Add theme overrides to your config:
```
[ui]
theme = "catppuccin" # or any other theme
[ui.theme_overrides]
background = "#000000" # Pure black background for maximum contrast
text_fg = "#00ff00" # Bright green for main text (high visibility)
selection_bg = "#ff00ff" # Bright magenta for selected items (eye-catching)
selection_fg = "#ffffff" # Pure white text on selected items (high contrast)
match_fg = "#ffff00" # Bright yellow for search matches (stands out)
border_fg = "#00ffff" # Bright cyan for borders (neon effect)
result_name_fg = "#ff8800" # Bright orange for file names (warm highlight)
result_value_fg = "#ff0080" # Bright pink for values (vibrant accent)
```
Test your changes:
```
# Run with your config
./target/release/tv --config-file ~/.config/television/config.toml
```
<img width="1420" alt="Screenshot 2025-07-08 at 08 14 42"
src="https://github.com/user-attachments/assets/90563f86-74aa-460a-a7c2-82080be3dc0b"
/>
---------
Co-authored-by: Mohamed-Amine Bousahih <mohamed-aminebousahih@pc-66.home>
Co-authored-by: Mohamed-Amine Bousahih <mohamed-aminebousahih@mohamedminesair.home>
sometimes I want to tweak the previous search, or just run it again.
this solves that problem
---------
Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
cleaned up keybinding section from config
@alexpasmantier you had this code before, perhaps there was a reason for
it?
```rust
if cfg!(not(windows)) {
execute!(buffered_stderr, DisableMouseCapture)?;
}
```
- Migrate to a feature based UI
- Introduces television/features.rs with a flags-based Features type
(PREVIEW_PANEL, HELP_PANEL, STATUS_BAR, REMOTE_CONTROL).
- Per-feature configuration sections: [ui.preview_panel],
[ui.status_bar], [ui.remote_control], [ui.help_panel]
- Rename Keybinding panel ➜ Help panel
- CLI & housekeeping
- new CLI toggle --no-status-bar, updated docs and man page
- import clean up
BREAKING CHANGE: No more builtin previews which means channels currently using `:files:` and other builtins will now need to rely on external tools (examples to come).
- tv's default channel (when lauching `tv`) is now configurable via the
`default_channel` configuration option
- add `RUST_BACKTRACE=1` and `--nocapture` to ci testing for better
debugging
- remove all builtin channels and associated glue code as well as the
`ToCliChannel` and `ToUnitChannel` derive macros
- recode all builtin channels using shell commands (along with `fd`,
`bat`, and `rg`)
- add support for interactive shell commands inside cable channels
- drop the `send_to_channel` feature until further notice (will be
reimplemented later on in a more generic and customizable way)
BREAKING CHANGE: mode keybindings dropped in favor of a global table
**What this means in practice:**
```toml
[keybindings.Channel]
quit = ["esc", "ctrl-c"]
# ...
[keybindings.RemoteControl]
quit = ["esc", "ctrl-c"]
# ...
[keybindings.SendToChannel]
quit = ["esc", "ctrl-c"]
# ...
```
are being replaced with
```toml
[keybindings]
quit = ["esc", "ctrl-c"]
# ...
```
Mode keybindings were I believe a premature optimization which only
brought additional complexity and redundancy to the code and did not
provide any real functionality in the current state of things for end
users.
Before:
```toml
[shell_integration.commands]
# Add your commands here. Each key is a command that will trigger tv with the
# corresponding channel as value.
# Example: say you want the following prompts to trigger the following channels
# when pressing <CTRL-T>:
# `git checkout` should trigger the `git-branches` channel
# `ls` should trigger the `dirs` channel
# `cat` should trigger the `files` channel
#
# You would add the following to your configuration file:
# ```
# [shell_integration.commands]
# "git checkout" = "git-branch"
# "ls" = "dirs"
# "cat" = "files"
# ```
# environment variables
"export" = "env"
"unset" = "env"
# dirs channel
"cd" = "dirs"
"ls" = "dirs"
"rmdir" = "dirs"
# files channel
"cat" = "files"
"less" = "files"
"head" = "files"
"tail" = "files"
"vim" = "files"
"bat" = "files"
# git-diff channel
"git add" = "git-diff"
# git-branch channel
"git checkout" = "git-branch"
"git branch -d" = "git-branch"
# docker-images channel
"docker run" = "docker-images"
# gitrepos channel
"nvim" = "git-repos"
```
After
```toml
[shell_integration.channel_triggers]
# Add your channel triggers here. Each key is a channel that will be triggered
# by the corresponding commands.
# Example: say you want the following commands to trigger the following channels
# when pressing <CTRL-T>:
# `git checkout` should trigger the `git-branches` channel
# `ls` should trigger the `dirs` channel
# `cat` and `cp` should trigger the `files` channel
#
# You would add the following to your configuration file:
# ```
# [shell_integration.channel_triggers]
# "git-branches" = ["git checkout"]
# "dirs" = ["ls"]
# "files" = ["cat", "cp"]
# ```
"env" = ["export", "unset"]
"dirs" = ["cd", "ls", "rmdir"]
"files" = ["cat", "less", "head", "tail", "vim", "bat"]
"git-diff" = ["git add"]
"git-branch" = ["git checkout", "git branch -d"]
"docker-images" = ["docker run"]
"git-repos" = ["nvim"]
```