Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] running tinty init in .zshrc #19

Closed
laenzlinger opened this issue Apr 27, 2024 · 8 comments
Closed

[Question] running tinty init in .zshrc #19

laenzlinger opened this issue Apr 27, 2024 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@laenzlinger
Copy link

laenzlinger commented Apr 27, 2024

What version of tinty are you using?
[paste the output of tinty --version here]
tinty 0.11.0
alacritty 0.13.2 (bb8ea18e)

I am migrating from chriskempso/base16-shell to tinty + tinted-theming/base16-shell

cat .config/tinty/config.toml
# Global settings
shell = "zsh -c '{}'"
default_scheme = "base16-darktooth"

[[items]]
name = "shell"
path = "https://github.com/tinted-theming/base16-shell"
themes_dir = "scripts"
hook = ". %f"

when I run tinty init, the colors are correctly changed,

however, when i run tinty init in my .zshrc it the colors are not initialized when I open a new alacritty terminal.

Any hints for how to further debug are very much appreciated.

@laenzlinger laenzlinger added the question Further information is requested label Apr 27, 2024
@laenzlinger laenzlinger changed the title [Question] running tinty init in .zshrd [Question] running tinty init in .zshrc Apr 27, 2024
@JamyGolden
Copy link
Member

Hi and welcome @laenzlinger 😄 Are you getting any errors? (I'm guessing not). Try running tinty current right after your .zshrc tinty init just to make sure it's working. When you open a new terminal window, this should output the name of the theme that should be applied.

I would imagine that this might be because tinty isn't in your PATH yet in .zshrc but then I'd expect an error when you open a new window.

@laenzlinger
Copy link
Author

laenzlinger commented Apr 27, 2024

Thanks @JamyGolden for the quick reply!

I have changed my .zshrc

#... more initialization above (oh-my-zsh)

export PATH=$PATH:$HOME/.cargo/bin

tinty init
tinty current

(tinty was installed with cargo install and I exported the cargo bin path before tinty is called)

-- console output produced during zsh initialization follows --

base16-black-metal-dark-funeral

@JamyGolden
Copy link
Member

Can you try to manually source the theme file? So add . ~/.local/share/tinted-theming/tinty/shell-scripts-file.sh to your .zshrc file and see if that loads the shell theme when you open a new window. Make sure that files exists though, it might be in a different location depending on your OS. (this isn't the solution if it works, still just a debugging step)

@laenzlinger
Copy link
Author

laenzlinger commented Apr 27, 2024

yes this helps (I am using arch linux)

env | grep BASE
BASE16_THEME=brewer

I guess it was a wrong assumption that I should call tinty init in my .zshrc. Instead i should directly source the applied shell script.

@laenzlinger
Copy link
Author

laenzlinger commented Apr 27, 2024

I found 2 problems:

On my system, tinty does not see the config file ~/.config/tinty/config.toml. I have to add -c ~/.config/tinty/config.toml. Without that, it seems to use an internal default config.

Once I added -c, i found that in my config file, tinty reported an error. (I copied the example from the README.md file of this repository, which contains the same error: The key themes_dir should be themes-dir.

@JamyGolden
Copy link
Member

JamyGolden commented Apr 28, 2024

Ahh ok thanks for going through all of this. Yes it looks like documentation errors which I've just cretead a PR addressing these issues #20.

The reason it didn't find the config without you specifying is that the default config path is ~/.config/tinted-theming/tinty/config.toml. I'll add a command which returns the config and data paths being used to make this sort of thing easier to debug.

Is this resolved for you now using the -c? You could either continue using that path or use the default of ~/.config/tinted-theming/tinty/config.toml

@laenzlinger
Copy link
Author

Oh sorry, now I understand! No problem for me to use the default path instead of my own path. I don't remember why my path would be correct. Maybe the defaults could be mentioned in --help. I think that would have resolved it for me.

@JamyGolden
Copy link
Member

Yeah I'll make sure to do more to explain it. In the PR I created I fixed 2 instances of a path which mimics the path you were using so the docs incorrectly mentioned the path in 2 places. I'll merge that PR now. I'll close this issue since it seems like it's sorted. I've added a feature request issue to add something to help debug this type of issue in future: #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants