Closed JamyGolden closed 1 year ago
Sorry, but no it doesn't fix it.
Is this condition correct?
if [[ "$theme_name" == "$current_theme_name" && "$theme_name" == "$BASE16_THEME" ]]; then
return 0
fi
Feels like, it needs to be OR instead of AND.
@maksut I've looked more closely at the hack you created. Something seems a bit off if that's working for you, since when you restart your terminal the theme should not load. It should only set to a base16 theme if you manually change the theme to something it previously wasn't set to before.
$BASE16_SHELL_COLORSCHEME_PATH
is the path to the symbolic link of the set (or previously set) theme$script_path
is the path the new script that will be set as symbolic link path $BASE16_SHELL_COLORSCHEME_PATH
Your hack says if they're the same, don't re-run anything. If you were to close your terminal and re-open it your theme should not load (with that conditional) since the script path of the theme and the symbolic linked theme are still the same. If you were to set your theme to what it was before, say using base16_ayu-dark
, it would not set since it would be caught by your conditional (again setting to the same thing). You would need to change it to something else and then change it back.
The startup of everything adds a bit of complexity since we need to make sure things don't run when unnecessary ,but always run on startup (since it's necessary), but I've adjusted for this in the update.
However this may still not fix your issue. If the issues persist, you may want to have a look at https://github.com/tinted-theming/base16-foot since it doesn't use the dynamic shell function to set the theme and is set on startup of foot. Also good to keep in mind is base16-wayland is a 3rd party repo so there may be discrepancies with the colorschemes it supports compared to our template colorschemes. I'm happy to keep looking into the specific issue but we'd need to do it together with some back and forth sharing of logs, etc.
Let me know how it goes.
I was not clear nor accurate with my description. I don't have a problem with my terminal theme. In fact I had hardcoded colors in my 'foot.ini'. My hack may well be broken with terminal theming.
I'm using base16-shell to set the theme for sway (via https://github.com/freddiehaddad/base16-sway). That is also not an official project so it may have unintended usage. See here, they are reloading whole WM when the hook is sourced: https://github.com/freddiehaddad/base16-sway/blob/main/hooks/20_sway.sh I was thinking it must be waybar but it was sway reloading itself and waybar.
While writing this, I just realized it they have a fix on their side: https://github.com/freddiehaddad/base16-sway/pull/1 I will try that.
Thanks for spending time on this.
Ok great, let me know if it fixes it for you. I'm happy with the updates done in this PR either way :smile:
The fix in base16-sway works for me.
It would be great if base16-shell didn't recreate the files in '.config/tinted-theming' whenever a terminal opens. But it's a minor annoyance really.
Thanks again.
base16-shell doesn't recreate anything, it's just a repo that contains the scripts to set the shell theme as well as a helper profile_helper.sh
to make some things convenient. So if you don't want things to be created when the terminal opens, just don't load it up when the terminal opens - you have complete control of this.
Remove base16 shell from your shell RC file so it doesn't initialise, and add the following to your shell RC file.
base16_set() {
. "/path/to/base16-shell/profile_helper.sh"
set_theme "$1"
}
Then you can set a theme by running base16_set ayu-dark
(there won't be autocomplete) and it will initilise base16-shell as well as set the theme you want afterwards using the profile_helper.sh
which will run the hooks.
I was using official installation instructions. Yes, I had it commented out today. But your suggestion of adding a function is better.
Thanks