MohMine 4e90a357e8
feat(themes): allow users to add theme overrides using their config file
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>
2025-07-11 00:06:46 +02:00
2025-07-06 17:36:04 +02:00
2025-07-07 18:21:18 +02:00
2025-03-18 02:21:24 +01:00
2025-07-10 18:40:00 +02:00
2025-07-10 18:40:00 +02:00
2024-09-15 21:57:36 +02:00
2025-07-10 00:16:57 +02:00


A cross-platform, fast and extensible general purpose fuzzy finder for the terminal.

GitHub Release docs.rs GitHub branch check runs GitHub License

tv's files channel

About

Television is a cross-platform, fast and extensible fuzzy finder for the terminal.

It integrates with your shell and lets you quickly search through any kind of data source (files, git repositories, environment variables, docker images, you name it) using a fuzzy matching algorithm and is designed to be extensible.

It is inspired by the neovim telescope plugin and leverages tokio and the nucleo matcher used by the helix editor to ensure optimal performance.

Installation

See installation docs.

TL;DR

Create a channel: ~/.config/television/cable/files.toml

[metadata]
name = "files"
description = "A channel to select files and directories"
requirements = ["fd", "bat"]

[source]
command = "fd -t f"

[preview]
command = "bat -n --color=always '{}'"
env = { BAT_THEME = "Catppuccin Mocha" }

[ui]
preview_panel = { "size" = 70, "scrollbar" = true }

[keybindings]
shortcut = "f1"

Start searching:

tv files

tv files

Switch channels using the remote control and pick from a list of community-maintained channels which you can install with tv update-channels:

tv remote

See the channels docs for more info on how to set these up.

Usage

tv  # default channel

tv [channel]  # e.g. `tv files`, `tv env`, `tv git-repos`, etc.

# pipe the output of your program into tv
my_program | tv

fd -t f . | tv --preview 'bat -n --color=always {}'

# or build your own channel on the fly
tv --source-command 'fd -t f .' --preview-command 'bat -n --color=always {}' --preview-size 70

Tip

🐚 Television has builtin shell integration. More info here.

Credits

This project was inspired by the awesome work done by the telescope neovim plugin.

It also leverages the great helix editor's nucleo fuzzy matching library, the tokio async runtime as well as the formidable ratatui library.

Description
No description provided
Readme MIT
Languages
Rust 95.2%
Shell 1.7%
TypeScript 1.2%
CSS 0.7%
Just 0.5%
Other 0.7%