Skip to content

Commit

Permalink
Rename base16-shell to tinted-shell
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyGolden committed Sep 24, 2024
1 parent fc8f462 commit 076f8c8
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 46 deletions.
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ workflow, making your experience more enjoyable and productive.

### Cargo

```shell
```sh
cargo install tinty
```

### Homebrew

```shell
```sh
brew tap tinted-theming/tinted
brew install tinty
```
Expand All @@ -121,7 +121,7 @@ Download the relevant binary from the [repository releases] page.

### Manual

```shell
```sh
git clone https://github.com/tinted-theming/tinty path/to/tinty
cd path/to/tinty
make install
Expand All @@ -134,20 +134,20 @@ cp target/release/tinty /path/to/bin/dir
For the most basic usage without configuration, install Tinty and run
the following to apply `base16-mocha`:

```shell
```sh
tinty install # Required once or when your config file is updated
tinty apply base16-mocha
```

To get a list of [schemes] and more information about the colors:

```shell
```sh
tinty list
tinty info base16-oceanicnext
```

Without any `config.toml` file, `tinty` will apply your shell theme using
[base16-shell] using `sh` shell.
Without any `config.toml` file, `tinty` will apply your shell theme
using [tinted-shell] using `sh` shell.

## Usage

Expand Down Expand Up @@ -217,14 +217,14 @@ specify templates, directories for theme files, and hooks for applying
themes. Configuring items effectively enables you to manage multiple
themes across different applications seamlessly.

| Key | Type | Required | Description | Default | Example |
|-----------------------|----------|----------|---------------------------------------------------------------|---------|--------------------------------------------|
| `name` | `string` | Required | A unique name for the item being configured. | - | `name = "vim"` |
| `path` | `string` | Required | The file system path or URL to the theme template repository. Paths beginning with `~/` map to home dir. | - | `path = "https://github.com/base16-vim"` |
| `themes-dir` | `string` | Required | The directory within the repository where theme files are located. | - | `themes-dir = "colors"` |
| `hook` | `string` | Optional | A command to be executed after the theme is applied. Useful for reloading configurations. `%f` template variable maps to the path of the applied theme file. | None | `hook = "source ~/.vimrc"` |
| Key | Type | Required | Description | Default | Example |
|------------------------|----------|----------|---------------------------------------------------------------|---------|--------------------------------------------|
| `name` | `string` | Required | A unique name for the item being configured. | - | `name = "vim"` |
| `path` | `string` | Required | The file system path or URL to the theme template repository. Paths beginning with `~/` map to home dir. | - | `path = "https://github.com/tinted-tmux"` |
| `themes-dir` | `string` | Required | The directory within the repository where theme files are located. | - | `themes-dir = "colors"` |
| `hook` | `string` | Optional | A command to be executed after the theme is applied. Useful for reloading configurations. `%f` template variable maps to the path of the applied theme file. | None | `hook = "source ~/.vimrc"` |
| `theme-file-extension` | `string` | Optional | Define a custom theme file extension that isn't `/\.*$/`. Tinty looks for themes named `base16-uwunicorn.*` (for example), but when the theme file isn't structured that way, this option can help specify the pattern. | - | `theme-file-extension = ".module.css"` |
| `supported-systems` | `array<"base16" or "base24">` | Optional | Defines which theming systems ("base16" and or "base24") are supported by the item. | `["base16"]` | `supported-systems = ["base16", "base24"]` |
| `supported-systems` | `array<"base16" or "base24">` | Optional | Defines which theming systems ("base16" and or "base24") are supported by the item. | `["base16"]` | `supported-systems = ["base16", "base24"]` |

#### Note on `supported-systems`

Expand All @@ -250,31 +250,32 @@ default-scheme = "base16-mocha"

# Item configurations
[[items]]
name = "vim"
path = "https://github.com/tinted-theming/base16-shell"
name = "tinted-shell"
path = "https://github.com/tinted-theming/tinted-shell"
themes-dir = "scripts"
hook = "source %f"
supported-systems = ["base16", "base24"]

[[items]]
name = "vim"
name = "base16-vim"
path = "https://github.com/tinted-theming/base16-vim"
themes-dir = "colors"
hook = "source ~/.vimrc"
supported-systems = ["base16"]
# Look at USAGE.md for more information on sourcing the generated file in vim

[[items]]
name = "tmux"
path = "~/path/path/to/base16-tmux"
themes-dir = "colors"
hook = "tmux source-file ~/.tmux.conf"
supported-systems = ["base16"]
hook = "tmux run 2> /dev/null && tmux source-file %f"
supported-systems = ["base16", "base24"]
```

### Select and apply a scheme using fzf

Note: Requires [fzf]

```shell
```sh
tinty apply $(tinty list | fzf)
```

Expand Down Expand Up @@ -328,8 +329,8 @@ light = false
```toml
# ~/.config/tinted-theming/tinty/config.toml
[[items]]
path = "https://github.com/aarowill/base16-alacritty"
name = "base16-alacritty"
path = "https://github.com/tinted-theming/tinted-alacritty"
name = "tinted-alacritty"
themes-dir = "colors"
hook = "cp -f %f ~/.config/alacritty/colors.toml"

Expand Down Expand Up @@ -385,7 +386,7 @@ file for details.
[Base16 builder specification]: https://github.com/tinted-theming/home/blob/main/builder.md
[home repository]: https://github.com/tinted-theming/home
[Base16 Gallery]: https://tinted-theming.github.io/base16-gallery
[base16-shell]: https://github.com/tinted-theming/base16-shell
[tinted-shell]: https://github.com/tinted-theming/tinted-shell
[schemes]: https://github.com/tinted-theming/schemes
[fzf]: https://github.com/junegunn/fzf
[Base16]: https://github.com/tinted-theming/home/blob/main/styling.md
Expand Down
8 changes: 4 additions & 4 deletions example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
# [[items]]
# # Path to template repository. Can be a URL, absolute path or path
# # beginning with `~/`.
# path = "https://github.com/tinted-theming/base16-shell"
# path = "https://github.com/tinted-theming/tinted-shell"
# # Unique name of item
# name = "base16-shell"
# name = "tinted-shell"
# # Name of the repository directory containing the theme files
# themes-dir = "scripts"
# # (Optional) Command to execute after copying template (goes through `shell`)
Expand All @@ -41,8 +41,8 @@
# default-scheme = "base16-oceanicnext"
#
# [[items]]
# path = "https://github.com/tinted-theming/base16-shell"
# name = "base16-shell"
# path = "https://github.com/tinted-theming/tinted-shell"
# name = "tinted-shell"
# hook = ". %f"
# themes-dir = "scripts"
#
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use url::Url;

pub const DEFAULT_CONFIG_SHELL: &str = "sh -c '{}'";
pub const CONFIG_FILE_NAME: &str = "config.toml";
pub const BASE16_SHELL_REPO_URL: &str = "https://github.com/tinted-theming/base16-shell";
pub const BASE16_SHELL_REPO_NAME: &str = "base16-shell";
pub const BASE16_SHELL_REPO_URL: &str = "https://github.com/tinted-theming/tinted-shell";
pub const BASE16_SHELL_REPO_NAME: &str = "tinted-shell";
pub const BASE16_SHELL_THEMES_DIR: &str = "scripts";
pub const BASE16_SHELL_HOOK: &str = ". %f";

Expand Down
2 changes: 1 addition & 1 deletion src/operations/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub fn apply(
}
}

// Run global hooks
// Run global tinty/config.toml hooks
if let Some(hooks_vec) = config.hooks.clone() {
for hook in hooks_vec.iter() {
let hook_command_vec = get_shell_command_from_string(config_path, hook.as_str())?;
Expand Down
2 changes: 1 addition & 1 deletion src/operations/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn config(
println!("{config}");
}
(true, true) => {
// This case should be dealt with by clap
// This case should already be handled by clap
return Err(anyhow!(
"the argument '--data-dir-path' cannot be used with '--config-path'",
));
Expand Down
2 changes: 1 addition & 1 deletion src/operations/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::path::Path;
/// Lists available color schemes
///
/// Lists colorschemes file which is updated via scripts/install by getting a list of schemes
/// available in https://github.com/tinted-theming/schemes/base16
/// available in https://github.com/tinted-theming/schemes
pub fn list(data_path: &Path, is_custom: bool) -> Result<()> {
let schemes_dir_path = if is_custom {
data_path.join(CUSTOM_SCHEMES_DIR_NAME)
Expand Down
9 changes: 4 additions & 5 deletions tests/cli_apply_subcommand_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn test_cli_apply_subcommand_with_setup() -> Result<()> {
"test_cli_apply_subcommand_with_setup",
format!("apply {}", &scheme_name).as_str(),
)?;
let shell_theme_filename = "base16-shell-scripts-file.sh";
let shell_theme_filename = "tinted-shell-scripts-file.sh";
let current_scheme_path = data_path.join(CURRENT_SCHEME_FILE_NAME);

// ---
Expand Down Expand Up @@ -182,7 +182,7 @@ hooks = ["echo 'Path: %f'"]
let custom_scheme_file_path =
data_path.join(format!("custom-schemes/base16/{}.yaml", scheme_name));
let expected_output = format!(
r#"Successfully generated "base16" themes for "base16" at "{}/repos/base16-shell/scripts/*.sh"#,
r#"Successfully generated "base16" themes for "base16" at "{}/repos/tinted-shell/scripts/*.sh"#,
data_path.display()
);
let current_scheme_path = data_path.join(CURRENT_SCHEME_FILE_NAME);
Expand Down Expand Up @@ -228,9 +228,8 @@ fn test_cli_apply_subcommand_root_hooks_with_setup() -> Result<()> {
format!("apply {}", &scheme_name).as_str(),
)?;
let expected_output = "This\nis\nexpected\noutput.";
let config_content = r##"
hooks = ["echo 'This '", "echo 'is '", "echo 'expected '", "echo 'output.'"]
"##;
let config_content =
r#"hooks = ["echo 'This'", "echo 'is'", "echo 'expected'", "echo 'output.'"]"#;
write_to_file(&config_path, config_content)?;

// ---
Expand Down
4 changes: 2 additions & 2 deletions tests/cli_config_subcommand_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ fn test_cli_config_without_config() -> Result<()> {
let expected = r#"shell = "sh -c '{}'"
[[items]]
name = "base16-shell"
path = "https://github.com/tinted-theming/base16-shell"
name = "tinted-shell"
path = "https://github.com/tinted-theming/tinted-shell"
hook = ". %f"
supported-systems = ["base16"]
themes-dir = "scripts"
Expand Down
4 changes: 2 additions & 2 deletions tests/cli_general_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn test_cli_default_data_path() -> Result<()> {
// ------
fs::remove_file(&config_path)?; // cleanup
assert!(
data_path.join("repos/base16-shell").exists(),
data_path.join("repos/tinted-shell").exists(),
"stdout does not contain the expected output"
);
assert_eq!(
Expand Down Expand Up @@ -182,7 +182,7 @@ fn test_cli_data_path_tilde_as_home() -> Result<()> {
// Assert
// ------
assert!(
data_path.join("repos/base16-shell").exists(),
data_path.join("repos/tinted-shell").exists(),
"stdout does not contain the expected output"
);
assert!(
Expand Down
4 changes: 2 additions & 2 deletions tests/cli_install_subcommand_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn test_cli_install_subcommand_without_setup() -> Result<()> {
// -------
let (_, _, command_vec, cleanup) =
setup("test_cli_install_subcommand_without_setup", "install")?;
let expected_output = "base16-shell installed";
let expected_output = "tinted-shell installed";

// ---
// Act
Expand All @@ -107,7 +107,7 @@ fn test_cli_install_subcommand_with_setup() -> Result<()> {
// Arrange
// -------
let (_, _, command_vec, cleanup) = setup("test_cli_install_subcommand_with_setup", "install")?;
let expected_output = "base16-shell already installed";
let expected_output = "tinted-shell already installed";

// ---
// Act
Expand Down
4 changes: 2 additions & 2 deletions tests/cli_update_subcommand_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn test_cli_update_subcommand_without_setup() -> Result<()> {
"test_cli_install_subcommand_non_unique_config_item_name",
"update",
)?;
let expected_output = format!("base16-shell not installed (run `{} install`)", REPO_NAME);
let expected_output = format!("tinted-shell not installed (run `{} install`)", REPO_NAME);

// ---
// Act
Expand All @@ -38,7 +38,7 @@ fn test_cli_update_subcommand_with_setup() -> Result<()> {
// -------
let (config_path, data_path, command_vec, cleanup) =
setup("test_cli_update_subcommand_with_setup", "update")?;
let expected_output = "base16-shell up to date";
let expected_output = "tinted-shell up to date";

// ---
// Act
Expand Down

0 comments on commit 076f8c8

Please sign in to comment.