wip
This commit is contained in:
14
.config/television/cable/alias.toml
Normal file
14
.config/television/cable/alias.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
[metadata]
|
||||
name = "alias"
|
||||
description = "A channel to select from shell aliases"
|
||||
|
||||
[source]
|
||||
# you may need to adjust the command depending on your shell
|
||||
command = "$SHELL -ic 'alias'"
|
||||
output = "{split:=:0}"
|
||||
|
||||
[preview]
|
||||
command = "$SHELL -ic 'alias' | grep -E '^(alias )?{split:=:0}='"
|
||||
|
||||
[ui.preview_panel]
|
||||
size = 30
|
||||
23
.config/television/cable/channels.toml
Normal file
23
.config/television/cable/channels.toml
Normal file
@@ -0,0 +1,23 @@
|
||||
[metadata]
|
||||
name = "channels"
|
||||
description = "A channel to find and select other channels"
|
||||
|
||||
[source]
|
||||
command = "tv list-channels"
|
||||
|
||||
[keybindings]
|
||||
enter = "actions:zap"
|
||||
ctrl-t = "actions:echo"
|
||||
|
||||
[actions.echo]
|
||||
description = "Echo the channel name"
|
||||
command = "echo '{}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.zap]
|
||||
description = "Switch to the channel"
|
||||
command = "tv '{}'"
|
||||
mode = "execute"
|
||||
|
||||
# [preview]
|
||||
# command = "bat -n --color=always ~/.config/television/cable/'{}'.toml"
|
||||
23
.config/television/cable/compose.toml
Normal file
23
.config/television/cable/compose.toml
Normal file
@@ -0,0 +1,23 @@
|
||||
[metadata]
|
||||
name = "compose"
|
||||
description = "Search XCompose key mappings (no preview)"
|
||||
|
||||
[source]
|
||||
command = [
|
||||
"cat ~/.XCompose /usr/share/X11/locale/cs_CZ.UTF-8/Compose",
|
||||
"cat /usr/share/X11/locale/en_US.UTF-8/Compose",
|
||||
]
|
||||
ansi = false
|
||||
output = "{}"
|
||||
|
||||
[ui]
|
||||
ui_scale = 90
|
||||
layout = "portrait"
|
||||
input_bar_position = "top"
|
||||
input_header = "Search Compose mappings:"
|
||||
|
||||
[ui.preview_panel]
|
||||
hidden = true # No preview panel
|
||||
|
||||
[ui.remote_control]
|
||||
show_channel_descriptions = true
|
||||
25
.config/television/cable/dirs.toml
Normal file
25
.config/television/cable/dirs.toml
Normal file
@@ -0,0 +1,25 @@
|
||||
[metadata]
|
||||
name = "dirs"
|
||||
description = "A channel to select from directories"
|
||||
requirements = ["fdfind"]
|
||||
|
||||
[source]
|
||||
command = ["printenv | grep -e '^m' | sort | cut -d= -f2-", "fdfind -t d", "fdfind -t d --hidden"]
|
||||
|
||||
[preview]
|
||||
command = "ls -la --color=always '{}'"
|
||||
|
||||
[keybindings]
|
||||
shortcut = "f2"
|
||||
ctrl-o = "actions:cd"
|
||||
ctrl-up = "actions:goto_parent_dir"
|
||||
|
||||
[actions.cd]
|
||||
description = "Open a shell in the selected directory"
|
||||
command = "cd '{}' && $SHELL"
|
||||
mode = "execute"
|
||||
|
||||
[actions.goto_parent_dir]
|
||||
description = "Re-opens tv in the parent directory"
|
||||
command = "tv dirs .."
|
||||
mode = "execute"
|
||||
32
.config/television/cable/docker-compose.toml
Normal file
32
.config/television/cable/docker-compose.toml
Normal file
@@ -0,0 +1,32 @@
|
||||
[metadata]
|
||||
name = "docker-compose"
|
||||
description = "Manage Docker Compose services"
|
||||
requirements = ["docker"]
|
||||
|
||||
[source]
|
||||
command = "docker compose ps --format '{{.Name}}\t{{.Service}}\t{{.Status}}'"
|
||||
display = "{split:\t:1} ({split:\t:2})"
|
||||
output = "{split:\t:1}"
|
||||
|
||||
[preview]
|
||||
command = "docker compose logs --tail=30 --no-log-prefix '{split:\t:1}'"
|
||||
|
||||
[actions.up]
|
||||
description = "Start the selected service"
|
||||
command = "docker compose up -d '{split:\t:1}'"
|
||||
mode = "fork"
|
||||
|
||||
[actions.down]
|
||||
description = "Stop and remove the selected service"
|
||||
command = "docker compose down '{split:\t:1}'"
|
||||
mode = "fork"
|
||||
|
||||
[actions.restart]
|
||||
description = "Restart the selected service"
|
||||
command = "docker compose restart '{split:\t:1}'"
|
||||
mode = "fork"
|
||||
|
||||
[actions.logs]
|
||||
description = "Follow logs of the selected service"
|
||||
command = "docker compose logs -f '{split:\t:1}'"
|
||||
mode = "execute"
|
||||
19
.config/television/cable/dotfiles.toml
Normal file
19
.config/television/cable/dotfiles.toml
Normal file
@@ -0,0 +1,19 @@
|
||||
[metadata]
|
||||
name = "dotfiles"
|
||||
description = "A channel to select from your user's dotfiles"
|
||||
requirements = ["fdfind", "bat"]
|
||||
|
||||
[source]
|
||||
command = "fdfind -t f . $HOME/.config"
|
||||
|
||||
[preview]
|
||||
command = "bat -n --color=always '{}'"
|
||||
|
||||
[keybindings]
|
||||
enter = "actions:edit"
|
||||
|
||||
[actions.edit]
|
||||
description = "Edit the selected dotfile"
|
||||
command = "${EDITOR:-vim} '{}'"
|
||||
shell = "bash"
|
||||
mode = "execute"
|
||||
28
.config/television/cable/files.toml
Normal file
28
.config/television/cable/files.toml
Normal file
@@ -0,0 +1,28 @@
|
||||
[metadata]
|
||||
name = "files"
|
||||
description = "A channel to select files and directories"
|
||||
requirements = ["fdfind", "batcat", "cat", "head"]
|
||||
|
||||
[source]
|
||||
command = ["fdfind -t f", "fdfind -t f -H", "fdfind -t f -H -I"]
|
||||
|
||||
[preview]
|
||||
command = ["batcat -n --color=always '{}'", "cat '{}'", "head -50 '{}'"]
|
||||
env = { BAT_THEME = "ansi" }
|
||||
|
||||
[keybindings]
|
||||
shortcut = "f1"
|
||||
ctrl-e = "actions:edit"
|
||||
ctrl-up = "actions:goto_parent_dir"
|
||||
|
||||
[actions.edit]
|
||||
description = "Opens the selected entries with the default editor (falls back to vim)"
|
||||
command = "${EDITOR:-vim} '{}'"
|
||||
shell = "bash"
|
||||
# use `mode = "fork"` if you want to return to tv afterwards
|
||||
mode = "execute"
|
||||
|
||||
[actions.goto_parent_dir]
|
||||
description = "Re-opens tv in the parent directory"
|
||||
command = "tv files .."
|
||||
mode = "execute"
|
||||
37
.config/television/cable/git-branch.toml
Normal file
37
.config/television/cable/git-branch.toml
Normal file
@@ -0,0 +1,37 @@
|
||||
[metadata]
|
||||
name = "git-branch"
|
||||
description = "A channel to select from git branches"
|
||||
requirements = ["git"]
|
||||
|
||||
[source]
|
||||
command = "git --no-pager branch --all --format=\"%(refname:short)\""
|
||||
output = "{split: :0}"
|
||||
|
||||
[preview]
|
||||
command = "git show -p --stat --pretty=fuller --color=always '{0}'"
|
||||
|
||||
[keybindings]
|
||||
ctrl-o = "actions:checkout"
|
||||
ctrl-d = "actions:delete"
|
||||
ctrl-m = "actions:merge"
|
||||
ctrl-r = "actions:rebase"
|
||||
|
||||
[actions.checkout]
|
||||
description = "Checkout the selected branch"
|
||||
command = "git switch '{0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.delete]
|
||||
description = "Delete the selected branch"
|
||||
command = "git delete-branch '{0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.merge]
|
||||
description = "Merge the selected branch into current branch"
|
||||
command = "git merge '{0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.rebase]
|
||||
description = "Rebase current branch onto the selected branch"
|
||||
command = "git rebase '{0}'"
|
||||
mode = "execute"
|
||||
34
.config/television/cable/git-diff.toml
Normal file
34
.config/television/cable/git-diff.toml
Normal file
@@ -0,0 +1,34 @@
|
||||
[metadata]
|
||||
name = "git-diff"
|
||||
description = "A channel to select files from git diff commands"
|
||||
requirements = ["git"]
|
||||
|
||||
[source]
|
||||
command = "GIT_PAGER= git diff --name-only HEAD"
|
||||
|
||||
[preview]
|
||||
command = "GIT_PAGER= git diff HEAD --color=always -- '{}'"
|
||||
|
||||
[ui]
|
||||
layout = "portrait"
|
||||
|
||||
[keybindings]
|
||||
ctrl-s = "actions:stage"
|
||||
ctrl-r = "actions:restore"
|
||||
ctrl-e = "actions:edit"
|
||||
|
||||
[actions.stage]
|
||||
description = "Stage the selected file"
|
||||
command = "git add '{}'"
|
||||
mode = "fork"
|
||||
|
||||
[actions.restore]
|
||||
description = "Discard changes in the selected file"
|
||||
command = "git restore '{}'"
|
||||
mode = "fork"
|
||||
|
||||
[actions.edit]
|
||||
description = "Open the selected file in editor"
|
||||
command = "${EDITOR:-vim} '{}'"
|
||||
shell = "bash"
|
||||
mode = "execute"
|
||||
34
.config/television/cable/git-log.toml
Normal file
34
.config/television/cable/git-log.toml
Normal file
@@ -0,0 +1,34 @@
|
||||
[metadata]
|
||||
name = "git-log"
|
||||
description = "A channel to select from git log entries"
|
||||
requirements = ["git"]
|
||||
|
||||
[source]
|
||||
command = "git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --color=always"
|
||||
output = "{strip_ansi|split: :1}"
|
||||
ansi = true
|
||||
no_sort = true
|
||||
frecency = false
|
||||
|
||||
[preview]
|
||||
command = "git show -p --stat --pretty=fuller --color=always '{strip_ansi|split: :1}' | head -n 1000"
|
||||
|
||||
[keybindings]
|
||||
ctrl-y = "actions:cherry-pick"
|
||||
ctrl-r = "actions:revert"
|
||||
ctrl-o = "actions:checkout"
|
||||
|
||||
[actions.cherry-pick]
|
||||
description = "Cherry-pick the selected commit"
|
||||
command = "git cherry-pick '{strip_ansi|split: :1}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.revert]
|
||||
description = "Revert the selected commit"
|
||||
command = "git revert '{strip_ansi|split: :1}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.checkout]
|
||||
description = "Checkout the selected commit"
|
||||
command = "git checkout '{strip_ansi|split: :1}'"
|
||||
mode = "execute"
|
||||
28
.config/television/cable/git-reflog.toml
Normal file
28
.config/television/cable/git-reflog.toml
Normal file
@@ -0,0 +1,28 @@
|
||||
[metadata]
|
||||
name = "git-reflog"
|
||||
description = "A channel to select from git reflog entries"
|
||||
requirements = ["git"]
|
||||
|
||||
[source]
|
||||
command = "git reflog --decorate --color=always"
|
||||
output = "{0|strip_ansi}"
|
||||
ansi = true
|
||||
no_sort = true
|
||||
frecency = false
|
||||
|
||||
[preview]
|
||||
command = "git show -p --stat --pretty=fuller --color=always '{0|strip_ansi}'"
|
||||
|
||||
[keybindings]
|
||||
ctrl-o = "actions:checkout"
|
||||
ctrl-r = "actions:reset"
|
||||
|
||||
[actions.checkout]
|
||||
description = "Checkout the selected reflog entry"
|
||||
command = "git checkout '{0|strip_ansi}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.reset]
|
||||
description = "Reset --hard to the selected reflog entry"
|
||||
command = "git reset --hard '{0|strip_ansi}'"
|
||||
mode = "execute"
|
||||
26
.config/television/cable/git-tags.toml
Normal file
26
.config/television/cable/git-tags.toml
Normal file
@@ -0,0 +1,26 @@
|
||||
[metadata]
|
||||
name = "git-tags"
|
||||
description = "Browse and checkout git tags"
|
||||
requirements = ["git"]
|
||||
|
||||
[source]
|
||||
command = "git tag --sort=-creatordate"
|
||||
no_sort = true
|
||||
frecency = false
|
||||
|
||||
[preview]
|
||||
command = "git show --color=always '{}'"
|
||||
|
||||
[keybindings]
|
||||
ctrl-o = "actions:checkout"
|
||||
ctrl-d = "actions:delete"
|
||||
|
||||
[actions.checkout]
|
||||
description = "Checkout the selected tag"
|
||||
command = "git switch '{}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.delete]
|
||||
description = "Delete the selected tag"
|
||||
command = "git tag -d '{}'"
|
||||
mode = "execute"
|
||||
24
.config/television/cable/images.toml
Normal file
24
.config/television/cable/images.toml
Normal file
@@ -0,0 +1,24 @@
|
||||
[metadata]
|
||||
name = "images"
|
||||
description = "Browse image files with preview"
|
||||
requirements = ["fdfind", "chafa"]
|
||||
|
||||
[source]
|
||||
command = [
|
||||
"fdfind -t f -e png -e jpg -e jpeg -e gif -e webp -e bmp -e svg .",
|
||||
"fdfind -t f -e png -e jpg -e jpeg -e gif -e webp -e bmp -e svg -H .",
|
||||
]
|
||||
|
||||
[preview]
|
||||
command = [
|
||||
"viu -w 40 -h 80 '{}'",
|
||||
"chafa -s 80x40 '{}' 2>/dev/null || file '{}'",
|
||||
]
|
||||
|
||||
[keybindings]
|
||||
ctrl-o = "actions:open"
|
||||
|
||||
[actions.open]
|
||||
description = "Open the selected image with default viewer"
|
||||
command = "xdg-open '{}' 2>/dev/null || open '{}'"
|
||||
mode = "fork"
|
||||
24
.config/television/cable/journalctl.toml
Normal file
24
.config/television/cable/journalctl.toml
Normal file
@@ -0,0 +1,24 @@
|
||||
[metadata]
|
||||
name = "journalctl"
|
||||
description = "Browse systemd journal log identifiers and their logs"
|
||||
requirements = ["journalctl"]
|
||||
|
||||
[source]
|
||||
command = "journalctl --field SYSLOG_IDENTIFIER 2>/dev/null | sort -f"
|
||||
|
||||
[preview]
|
||||
command = "journalctl -b --no-pager -o short-iso -n 50 SYSLOG_IDENTIFIER='{}' 2>/dev/null"
|
||||
|
||||
[ui]
|
||||
layout = "portrait"
|
||||
preview_panel = { size = 70 }
|
||||
|
||||
[actions.logs]
|
||||
description = "Follow live logs for the selected identifier"
|
||||
command = "journalctl -f SYSLOG_IDENTIFIER='{}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.full]
|
||||
description = "View all logs for the selected identifier in a pager"
|
||||
command = "journalctl -b --no-pager -o short-iso SYSLOG_IDENTIFIER='{}' | less"
|
||||
mode = "fork"
|
||||
33
.config/television/cable/pkgs-apt.toml
Normal file
33
.config/television/cable/pkgs-apt.toml
Normal file
@@ -0,0 +1,33 @@
|
||||
[metadata]
|
||||
name = "pkgs-apt"
|
||||
description = "List and manage APT packages, including upgradable ones"
|
||||
requirements = ["dpkg", "apt"]
|
||||
|
||||
[source]
|
||||
command = [
|
||||
"dpkg-query -W -f='${Package}\t${Version}\t${Status}\n' 2>/dev/null | grep 'install ok installed' | awk -F'\t' '{print $1, $2}'",
|
||||
"apt-mark showmanual 2>/dev/null | sort -u",
|
||||
"apt-get -s upgrade 2>/dev/null | grep -oP '^Inst \\K[^ ]+' | sort -u",
|
||||
]
|
||||
|
||||
[preview]
|
||||
command = "apt show '{split: :0}' 2>/dev/null"
|
||||
|
||||
[keybindings]
|
||||
ctrl-u = "actions:upgrade"
|
||||
ctrl-d = "actions:remove"
|
||||
|
||||
[actions.upgrade]
|
||||
description = "Upgrade the selected package"
|
||||
command = "sudo apt install --only-upgrade '{split: :0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.reinstall]
|
||||
description = "Reinstall the selected package"
|
||||
command = "sudo apt install --reinstall '{split: :0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.remove]
|
||||
description = "Remove the selected package"
|
||||
command = "sudo apt remove '{split: :0}'"
|
||||
mode = "execute"
|
||||
29
.config/television/cable/pkgs-brew.toml
Normal file
29
.config/television/cable/pkgs-brew.toml
Normal file
@@ -0,0 +1,29 @@
|
||||
[metadata]
|
||||
name = "pkgs-brew"
|
||||
description = "List and manage Homebrew packages, including outdated ones (installed on request)"
|
||||
requirements = ["brew"]
|
||||
|
||||
[source]
|
||||
command = [
|
||||
"comm -12 <(brew list --installed-on-request | sort) <(brew outdated | sort)",
|
||||
"brew list --installed-on-request",
|
||||
"brew list --formula",
|
||||
"brew list --cask",
|
||||
]
|
||||
|
||||
[preview]
|
||||
command = "brew info '{}'"
|
||||
|
||||
[keybindings]
|
||||
ctrl-u = "actions:upgrade"
|
||||
ctrl-d = "actions:uninstall"
|
||||
|
||||
[actions.upgrade]
|
||||
description = "Upgrade the selected package"
|
||||
command = "brew upgrade '{}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.uninstall]
|
||||
description = "Uninstall the selected package"
|
||||
command = "brew uninstall '{}'"
|
||||
mode = "execute"
|
||||
27
.config/television/cable/pkgs-flatpak.toml
Normal file
27
.config/television/cable/pkgs-flatpak.toml
Normal file
@@ -0,0 +1,27 @@
|
||||
[metadata]
|
||||
name = "pkgs-flatpak"
|
||||
description = "List and manage Flatpak applications"
|
||||
requirements = ["flatpak"]
|
||||
|
||||
[source]
|
||||
command = "flatpak list --app --columns=application,name,version 2>/dev/null"
|
||||
display = "{split:\t:1} ({split:\t:2})"
|
||||
output = "{split:\t:0}"
|
||||
|
||||
[preview]
|
||||
command = "flatpak info '{split:\t:0}' 2>/dev/null"
|
||||
|
||||
[actions.run]
|
||||
description = "Launch the selected application"
|
||||
command = "flatpak run '{split:\t:0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.uninstall]
|
||||
description = "Uninstall the selected application"
|
||||
command = "flatpak uninstall '{split:\t:0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.update]
|
||||
description = "Update the selected application"
|
||||
command = "flatpak update '{split:\t:0}'"
|
||||
mode = "execute"
|
||||
28
.config/television/cable/pkgs-npm.toml
Normal file
28
.config/television/cable/pkgs-npm.toml
Normal file
@@ -0,0 +1,28 @@
|
||||
[metadata]
|
||||
name = "pkgs-npm"
|
||||
description = "List globally installed npm packages"
|
||||
requirements = ["npm"]
|
||||
|
||||
[source]
|
||||
command = [
|
||||
"npm outdated -g --depth=0 --json | njs -p '$.stdin.json()' 'Object.entries' 'e=> e.map(([p,i])=> `${p} @${i.current} → ${i.wanted} (${i.latest})`).join(\"\\n\")'",
|
||||
"npm list -g --depth=0 --json | njs -p '$.stdin.json().dependencies' 'Object.entries' 'e=> e.map(([p,i])=> p).join(\"\\n\")'",
|
||||
]
|
||||
output = "{split: :0}"
|
||||
|
||||
[preview]
|
||||
command = "npm info '{split: :0}' 2>/dev/null | head -30"
|
||||
|
||||
[keybindings]
|
||||
ctrl-u = "actions:update"
|
||||
ctrl-d = "actions:uninstall"
|
||||
|
||||
[actions.uninstall]
|
||||
description = "Uninstall the selected global package"
|
||||
command = "npm uninstall -g '{split: :0}'"
|
||||
mode = "execute"
|
||||
|
||||
[actions.update]
|
||||
description = "Update the selected global package"
|
||||
command = "npm update -g '{split: :0}'"
|
||||
mode = "execute"
|
||||
23
.config/television/cable/recent-files.toml
Normal file
23
.config/television/cable/recent-files.toml
Normal file
@@ -0,0 +1,23 @@
|
||||
[metadata]
|
||||
name = "recent-files"
|
||||
description = "List recently modified files (via git or filesystem)"
|
||||
requirements = ["git", "fdfind", "batcat"]
|
||||
|
||||
[source]
|
||||
command = [
|
||||
"git diff --name-only HEAD~10 HEAD 2>/dev/null || find . -type f -mtime -7 -not -path '*/.*' 2>/dev/null | head -100",
|
||||
"fdfind -t f --changed-within 7d -E .git -E .cache -E node_modules -E .local/share/Trash",
|
||||
]
|
||||
|
||||
[preview]
|
||||
command = "batcat -n --color=always '{}'"
|
||||
env = { BAT_THEME = "ansi" }
|
||||
|
||||
[keybindings]
|
||||
ctrl-e = "actions:edit"
|
||||
|
||||
[actions.edit]
|
||||
description = "Open the selected file in editor"
|
||||
command = "${EDITOR:-vim} '{}'"
|
||||
shell = "bash"
|
||||
mode = "execute"
|
||||
29
.config/television/cable/text.toml
Normal file
29
.config/television/cable/text.toml
Normal file
@@ -0,0 +1,29 @@
|
||||
[metadata]
|
||||
name = "text"
|
||||
description = "A channel to find and select text from files"
|
||||
requirements = ["rg", "batcat"]
|
||||
|
||||
[source]
|
||||
command = [
|
||||
"rg . --no-heading --line-number --colors 'match:fg:white' --colors 'path:fg:blue' --color=always",
|
||||
"rg . --no-heading --line-number --hidden --colors 'match:fg:white' --colors 'path:fg:blue' --color=always",
|
||||
]
|
||||
ansi = true
|
||||
output = "'+{strip_ansi|split:\\::1}' '{strip_ansi|split:\\::0}'"
|
||||
|
||||
[preview]
|
||||
command = "batcat -n --color=always '{strip_ansi|split:\\::0}'"
|
||||
env = { BAT_THEME = "ansi" }
|
||||
offset = '{strip_ansi|split:\::1}'
|
||||
|
||||
[ui]
|
||||
preview_panel = { header = '{strip_ansi|split:\::..2}' }
|
||||
|
||||
[keybindings]
|
||||
ctrl-e = "actions:edit"
|
||||
|
||||
[actions.edit]
|
||||
description = "Open file in editor at line"
|
||||
command = "${EDITOR:-vim} '+{strip_ansi|split:\\::1}' '{strip_ansi|split:\\::0}'"
|
||||
shell = "bash"
|
||||
mode = "execute"
|
||||
255
.config/television/config.toml
Normal file
255
.config/television/config.toml
Normal file
@@ -0,0 +1,255 @@
|
||||
# CONFIGURATION FILE LOCATION ON YOUR SYSTEM:
|
||||
# -------------------------------------------
|
||||
# Defaults:
|
||||
# ---------
|
||||
# Linux: `$HOME/.config/television/config.toml`
|
||||
# macOS: `$HOME/.config/television/config.toml`
|
||||
# Windows: `%LocalAppData%\television\config.toml`
|
||||
#
|
||||
# XDG dirs:
|
||||
# ---------
|
||||
# You may use XDG_CONFIG_HOME if set on your system.
|
||||
# In that case, television will expect the configuration file to be in:
|
||||
# `$XDG_CONFIG_HOME/television/config.toml`
|
||||
#
|
||||
|
||||
# General settings
|
||||
# ----------------------------------------------------------------------------
|
||||
tick_rate = 50
|
||||
default_channel = "files"
|
||||
# Shell settings
|
||||
# --------------
|
||||
# Default shell used for executing commands (source, preview, actions).
|
||||
# Options: bash, zsh, fish, powershell, cmd, nu
|
||||
# If not specified, the shell is detected from the environment ($SHELL on Unix).
|
||||
# Channel-specific shell settings override this global setting.
|
||||
# shell = "bash"
|
||||
# History settings
|
||||
# ---------------
|
||||
# Maximum number of entries to keep in the global history (default: 100)
|
||||
# The history tracks search queries across all channels and sessions
|
||||
# Set to 0 to disable history functionality entirely
|
||||
history_size = 200
|
||||
# Whether to use global history (default: false)
|
||||
# When true: history navigation shows entries from all channels
|
||||
# When false: history navigation is scoped to the current channel
|
||||
global_history = false
|
||||
|
||||
[ui]
|
||||
# How much space to allocate for the UI (in percentage of the screen)
|
||||
# ┌─────────────────────────┐
|
||||
# │ Terminal screen │
|
||||
# │ ┌───────────────────┐ │
|
||||
# │ │ │ │
|
||||
# │ │ Television UI │ │
|
||||
# │ │ │ │
|
||||
# │ └───────────────────┘ │
|
||||
# │ │
|
||||
# └─────────────────────────┘
|
||||
ui_scale = 100
|
||||
# What orientation should tv be (landscape or portrait)
|
||||
orientation = "landscape"
|
||||
# The theme to use for the UI
|
||||
# A list of builtin themes can be found in the `themes` directory of the television
|
||||
# repository. You may also create your own theme by creating a new file in a `themes`
|
||||
# directory in your configuration directory (see the `config.toml` location above).
|
||||
theme = "television"
|
||||
|
||||
# Feature-specific configurations
|
||||
# Each feature can have its own configuration section
|
||||
[ui.input_bar]
|
||||
# Where to place the input bar in the UI (top or bottom)
|
||||
position = "bottom"
|
||||
# The input prompt string (defaults to ">" if not specified)
|
||||
prompt = ">"
|
||||
# header = "{}"
|
||||
# padding = {"left": 0, "right": 0, "top": 0, "bottom": 0}
|
||||
border_type = "rounded" # https://docs.rs/ratatui/latest/ratatui/widgets/block/enum.BorderType.html#variants
|
||||
|
||||
[ui.status_bar]
|
||||
# Status bar separators (bubble):
|
||||
#separator_open = ""
|
||||
#separator_close = ""
|
||||
# Status bar separators (box):
|
||||
separator_open = ""
|
||||
separator_close = ""
|
||||
hidden = false
|
||||
|
||||
[ui.results_panel]
|
||||
border_type = "rounded"
|
||||
# padding = {"left": 0, "right": 0, "top": 0, "bottom": 0}
|
||||
|
||||
[ui.preview_panel]
|
||||
# Preview panel size (percentage of screen width/height)
|
||||
size = 50
|
||||
#header = ""
|
||||
#footer = ""
|
||||
scrollbar = true
|
||||
border_type = "rounded"
|
||||
# padding = {"left": 0, "right": 0, "top": 0, "bottom": 0}
|
||||
hidden = false
|
||||
|
||||
[ui.help_panel]
|
||||
# Whether to split the help panel by categories
|
||||
show_categories = true
|
||||
hidden = true
|
||||
|
||||
[ui.remote_control]
|
||||
# Whether to show channel descriptions in remote control mode
|
||||
show_channel_descriptions = true
|
||||
# Whether to sort channels alphabetically
|
||||
sort_alphabetically = true
|
||||
# disabled = false
|
||||
|
||||
# Theme color overrides
|
||||
# ---------------------
|
||||
# You can override specific colors from the selected theme by adding them here.
|
||||
# This allows you to customize the appearance without creating a full theme file.
|
||||
# Colors can be specified as ANSI color names (e.g., "red", "bright-blue") or
|
||||
# as hex values (e.g., "#ff0000", "#1e1e2e").
|
||||
#
|
||||
# Example overrides:
|
||||
# [ui.theme_overrides]
|
||||
# background = "#000000"
|
||||
# text_fg = "#ffffff"
|
||||
# selection_bg = "#444444"
|
||||
# match_fg = "#ff0000"
|
||||
|
||||
# Keybindings and Events
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
[keybindings]
|
||||
# Application control
|
||||
# ------------------
|
||||
esc = "quit"
|
||||
ctrl-c = "quit"
|
||||
|
||||
# Navigation and selection
|
||||
# -----------------------
|
||||
down = "select_next_entry"
|
||||
ctrl-n = "select_next_entry"
|
||||
ctrl-j = "select_next_entry"
|
||||
up = "select_prev_entry"
|
||||
ctrl-p = "select_prev_entry"
|
||||
ctrl-k = "select_prev_entry"
|
||||
|
||||
# History navigation
|
||||
# -----------------
|
||||
ctrl-up = "select_prev_history"
|
||||
ctrl-down = "select_next_history"
|
||||
|
||||
# Multi-selection
|
||||
# --------------
|
||||
tab = "toggle_selection_down"
|
||||
backtab = "toggle_selection_up"
|
||||
enter = "confirm_selection"
|
||||
|
||||
# Preview panel control
|
||||
# --------------------
|
||||
pagedown = "scroll_preview_half_page_down"
|
||||
pageup = "scroll_preview_half_page_up"
|
||||
ctrl-f = "cycle_previews"
|
||||
|
||||
# Data operations
|
||||
# --------------
|
||||
ctrl-y = "copy_entry_to_clipboard"
|
||||
ctrl-r = "reload_source"
|
||||
ctrl-s = "cycle_sources"
|
||||
|
||||
# UI Features
|
||||
# ----------
|
||||
ctrl-t = "toggle_remote_control"
|
||||
ctrl-x = "toggle_action_picker"
|
||||
ctrl-o = "toggle_preview"
|
||||
ctrl-h = "toggle_help"
|
||||
f12 = "toggle_status_bar"
|
||||
ctrl-l = "toggle_layout"
|
||||
|
||||
# Input field actions
|
||||
# ----------------------------------------
|
||||
backspace = "delete_prev_char"
|
||||
ctrl-w = "delete_prev_word"
|
||||
ctrl-u = "delete_line"
|
||||
delete = "delete_next_char"
|
||||
left = "go_to_prev_char"
|
||||
right = "go_to_next_char"
|
||||
home = "go_to_input_start"
|
||||
ctrl-a = "go_to_input_start"
|
||||
end = "go_to_input_end"
|
||||
ctrl-e = "go_to_input_end"
|
||||
|
||||
# Shell integration
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
# The shell integration feature allows you to use television as a picker for
|
||||
# your shell commands (as well as your shell history with <CTRL-R>).
|
||||
# E.g. typing `git checkout <CTRL-T>` will open television with a list of
|
||||
# branches to choose from.
|
||||
|
||||
[shell_integration]
|
||||
# This specifies the default fallback channel if no other channel is matched.
|
||||
fallback_channel = "files"
|
||||
|
||||
[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"]
|
||||
# ```
|
||||
"alias" = ["alias", "unalias"]
|
||||
"env" = ["export", "unset"]
|
||||
"dirs" = ["cd", "ls", "rmdir", "z"]
|
||||
"files" = [
|
||||
"cat",
|
||||
"less",
|
||||
"head",
|
||||
"tail",
|
||||
"vim",
|
||||
"nano",
|
||||
"bat",
|
||||
"cp",
|
||||
"mv",
|
||||
"rm",
|
||||
"touch",
|
||||
"chmod",
|
||||
"chown",
|
||||
"ln",
|
||||
"tar",
|
||||
"zip",
|
||||
"unzip",
|
||||
"gzip",
|
||||
"gunzip",
|
||||
"xz",
|
||||
]
|
||||
"git-diff" = ["git add", "git restore"]
|
||||
"git-branch" = [
|
||||
"git switch",
|
||||
"but branch delete",
|
||||
"git delete-branch",
|
||||
"git checkout",
|
||||
"git branch",
|
||||
"git merge",
|
||||
"git rebase",
|
||||
"git pull",
|
||||
"git push",
|
||||
]
|
||||
"git-log" = ["git log", "git show"]
|
||||
"channels" = ["tv", "television"]
|
||||
|
||||
[shell_integration.keybindings]
|
||||
# controls which key binding should trigger tv
|
||||
# for shell autocomplete
|
||||
"smart_autocomplete" = "ctrl-t"
|
||||
# controls which keybinding should trigger tv
|
||||
# for command history
|
||||
"command_history" = "ctrl-r"
|
||||
Reference in New Issue
Block a user