Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ The following is a table of the available subcommands for the CLI tool (Tinty),
| `sync` | Installs and updates schemes and templates defined in `tinty/config.toml` | - | `tinty sync` |
| `list` | Lists all available themes. | Optional argument `--custom-schemes` to list saved custom theme files using `tinty generate-scheme`.<br>Optional argument `--json` to output more info about each scheme in JSON form | `tinty list` |
| `apply` | Applies a specific theme. | `<scheme_system>-<scheme_name>`: Name of the system and scheme to apply. | `tinty apply base16-mocha` |
| `cycle` | Applies the next theme among your preferred ones. See [Configuration](#configuration). | | `tinty cycle` |
| `cycle` | Applies the next theme in a configured ring. See [Configuration](#configuration). | Optional `--ring <name>` to choose a specific ring. | `tinty cycle --ring dark` |
| `init` | Initializes the tool with the last applied theme otherwise `default-scheme` from `config.toml`. | - | `tinty init` |
| `current` | Displays the currently applied theme or current theme values. | `<scheme_property_name>` (Optional argument with the following supported values: `author` \| `description` \| `name` \| `slug` \| `system` \| `variant`) | `tinty current` |
| `config` | Displays config related information currently in use by Tinty. Without flags it returns `config.yml` content. | - | `tinty config` |
Expand Down Expand Up @@ -220,10 +220,19 @@ to your preferences and environment.
|-------------------|--------------------|----------|----------------------------------------------------------------------------------------|---------|---------|
| `shell` | `string` | Optional | Specifies the shell command used to execute hooks. | `"sh -c '{}'"` | `shell = "bash -c '{}'"` |
| `default-scheme` | `string` | Optional | Defines the default theme scheme to be applied if no specific scheme is set. | None | `default-scheme = "base16-mocha"` |
| `preferred-schemes` | `array<string>` | Optional | A list of your favorite theme schemes you'd like to cycle through | `[]` | `preferred-schemes = ["base16-gruvbox-dark", "base16-gruvbox-light"]` |
| `default-cycle-ring` | `string` | Optional | The configured ring used by `tinty cycle` when `--ring` is not provided. | None | `default-cycle-ring = "default"` |
| `[[rings]]` | `array<rings>` | Optional | Named scheme cycles used by `tinty cycle`. | - | See below |
| `hooks` | `array<string>` | Optional | A list of strings which are executed after every `tinty apply` | None | `hooks = ["echo \"The current scheme is: $(tinty current)\""]` |
| `[[items]]` | `array<items>` | Required | An array of `items` configurations. Each item represents a themeable component. Detailed structure provided in the next section. | - | - |

```toml
default-cycle-ring = "default"

[[rings]]
name = "default"
schemes = ["base16-gruvbox-dark", "base16-gruvbox-light"]
```

#### hooks

**New in Tinty 0.29+**: Theme & color values are now available to hooks as environment variables:
Expand Down Expand Up @@ -326,7 +335,15 @@ multiple items along with global settings:
# Global settings
shell = "zsh -c '{}'"
default-scheme = "base16-mocha"
preferred-schemes = ["base16-gruvbox-dark", "base16-gruvbox-light", "base16-github-dark"]
default-cycle-ring = "default"

[[rings]]
name = "default"
schemes = ["base16-gruvbox-dark", "base16-gruvbox-light", "base16-github-dark"]

[[rings]]
name = "dark"
schemes = ["base16-gruvbox-dark", "base16-github-dark"]

# Item configurations
[[items]]
Expand Down
9 changes: 8 additions & 1 deletion contrib/completion/tinty.bash
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,19 @@ _tinty() {
return 0
;;
tinty__cycle)
opts="-q -c -d -h --quiet --config --data-dir --help"
opts="-q -c -d -h --ring --quiet --config --data-dir --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--ring)
COMPREPLY=("${cur}")
if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
compopt -o nospace
fi
return 0
;;
--config)
COMPREPLY=($(compgen -f "${cur}"))
return 0
Expand Down
10 changes: 6 additions & 4 deletions contrib/completion/tinty.elvish
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ set edit:completion:arg-completer[tinty] = {|@words|
cand current 'Prints the last scheme name applied or specific values from the current scheme'
cand generate-completion 'Generates a shell completion script'
cand generate-scheme 'Generates a scheme based on an image'
cand info 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha)'
cand info 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha or tinty info tinted8-mocha)'
cand init 'Initializes with the exising config. Used to Initialize exising theme for when your shell starts up'
cand list 'Lists available schemes'
cand config 'Provides config related information'
cand apply 'Applies a theme based on the chosen scheme'
cand install 'Install the environment needed for tinty'
cand update 'Update to the latest themes'
cand sync 'Install missing templates in tinty/config.toml and update existing templates'
cand cycle 'Cycle through your preferred themes'
cand cycle 'Cycle through a configured ring of schemes'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'tinty;build'= {
Expand Down Expand Up @@ -87,6 +87,7 @@ set edit:completion:arg-completer[tinty] = {|@words|
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand --all 'Lists all availabile custom schemes'
cand --custom-schemes 'Lists availabile custom schemes'
cand -h 'Print help'
cand --help 'Print help'
Expand Down Expand Up @@ -161,6 +162,7 @@ set edit:completion:arg-completer[tinty] = {|@words|
cand --help 'Print help'
}
&'tinty;cycle'= {
cand --ring 'Name of the configured ring to cycle through'
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
Expand All @@ -175,15 +177,15 @@ set edit:completion:arg-completer[tinty] = {|@words|
cand current 'Prints the last scheme name applied or specific values from the current scheme'
cand generate-completion 'Generates a shell completion script'
cand generate-scheme 'Generates a scheme based on an image'
cand info 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha)'
cand info 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha or tinty info tinted8-mocha)'
cand init 'Initializes with the exising config. Used to Initialize exising theme for when your shell starts up'
cand list 'Lists available schemes'
cand config 'Provides config related information'
cand apply 'Applies a theme based on the chosen scheme'
cand install 'Install the environment needed for tinty'
cand update 'Update to the latest themes'
cand sync 'Install missing templates in tinty/config.toml and update existing templates'
cand cycle 'Cycle through your preferred themes'
cand cycle 'Cycle through a configured ring of schemes'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'tinty;help;build'= {
Expand Down
10 changes: 6 additions & 4 deletions contrib/completion/tinty.fish
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ complete -c tinty -n "__fish_tinty_needs_command" -f -a "build" -d 'Builds the t
complete -c tinty -n "__fish_tinty_needs_command" -f -a "current" -d 'Prints the last scheme name applied or specific values from the current scheme'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "generate-completion" -d 'Generates a shell completion script'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "generate-scheme" -d 'Generates a scheme based on an image'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "info" -d 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha)'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "info" -d 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha or tinty info tinted8-mocha)'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "init" -d 'Initializes with the exising config. Used to Initialize exising theme for when your shell starts up'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "list" -d 'Lists available schemes'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "config" -d 'Provides config related information'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "apply" -d 'Applies a theme based on the chosen scheme'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "install" -d 'Install the environment needed for tinty'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "update" -d 'Update to the latest themes'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "sync" -d 'Install missing templates in tinty/config.toml and update existing templates'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "cycle" -d 'Cycle through your preferred themes'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "cycle" -d 'Cycle through a configured ring of schemes'
complete -c tinty -n "__fish_tinty_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c tinty -n "__fish_tinty_using_subcommand build" -s c -l config -d 'Optional path to the tinty config.toml file' -r
complete -c tinty -n "__fish_tinty_using_subcommand build" -s d -l data-dir -d 'Optional path to the tinty data directory' -r
Expand All @@ -66,6 +66,7 @@ complete -c tinty -n "__fish_tinty_using_subcommand generate-scheme" -l save -d
complete -c tinty -n "__fish_tinty_using_subcommand generate-scheme" -s h -l help -d 'Print help'
complete -c tinty -n "__fish_tinty_using_subcommand info" -s c -l config -d 'Optional path to the tinty config.toml file' -r
complete -c tinty -n "__fish_tinty_using_subcommand info" -s d -l data-dir -d 'Optional path to the tinty data directory' -r
complete -c tinty -n "__fish_tinty_using_subcommand info" -l all -d 'Lists all availabile custom schemes'
complete -c tinty -n "__fish_tinty_using_subcommand info" -l custom-schemes -d 'Lists availabile custom schemes'
complete -c tinty -n "__fish_tinty_using_subcommand info" -s h -l help -d 'Print help'
complete -c tinty -n "__fish_tinty_using_subcommand init" -s c -l config -d 'Optional path to the tinty config.toml file' -r
Expand Down Expand Up @@ -98,6 +99,7 @@ complete -c tinty -n "__fish_tinty_using_subcommand sync" -s c -l config -d 'Opt
complete -c tinty -n "__fish_tinty_using_subcommand sync" -s d -l data-dir -d 'Optional path to the tinty data directory' -r
complete -c tinty -n "__fish_tinty_using_subcommand sync" -s q -l quiet -d 'Silence stdout'
complete -c tinty -n "__fish_tinty_using_subcommand sync" -s h -l help -d 'Print help'
complete -c tinty -n "__fish_tinty_using_subcommand cycle" -l ring -d 'Name of the configured ring to cycle through' -r
complete -c tinty -n "__fish_tinty_using_subcommand cycle" -s c -l config -d 'Optional path to the tinty config.toml file' -r
complete -c tinty -n "__fish_tinty_using_subcommand cycle" -s d -l data-dir -d 'Optional path to the tinty data directory' -r
complete -c tinty -n "__fish_tinty_using_subcommand cycle" -s q -l quiet -d 'Silence stdout'
Expand All @@ -106,13 +108,13 @@ complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_su
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "current" -d 'Prints the last scheme name applied or specific values from the current scheme'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "generate-completion" -d 'Generates a shell completion script'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "generate-scheme" -d 'Generates a scheme based on an image'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "info" -d 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha)'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "info" -d 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha or tinty info tinted8-mocha)'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "init" -d 'Initializes with the exising config. Used to Initialize exising theme for when your shell starts up'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "list" -d 'Lists available schemes'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "config" -d 'Provides config related information'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "apply" -d 'Applies a theme based on the chosen scheme'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "install" -d 'Install the environment needed for tinty'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "update" -d 'Update to the latest themes'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "sync" -d 'Install missing templates in tinty/config.toml and update existing templates'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "cycle" -d 'Cycle through your preferred themes'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "cycle" -d 'Cycle through a configured ring of schemes'
complete -c tinty -n "__fish_tinty_using_subcommand help; and not __fish_seen_subcommand_from build current generate-completion generate-scheme info init list config apply install update sync cycle help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
Loading
Loading