-
-
Notifications
You must be signed in to change notification settings - Fork 979
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
Conditional in config file? #811
Comments
Just do it in your bashrc, something like this: if [ "$(hostname)" = "home" ]; then
alias kitty='kitty -c ~/.config/kitty/kitty-home.conf'
fi |
@maximbaz thanks for reply. I want to set
on one machine where chunkwm is installed while Such solution does not seem to work if I use Launching |
Right, my bad, bashrc is not suitable for this, it is loaded already in the new kitty instance. Maybe having this globally will work, like in /etc/profile.d/ ? Or change the command that launches kitty itself, i.e. have a different .desktop file? |
Use |
This is a cool idea, probably better than what I was thinking if you mostly share configs between different hosts and have only a few minor differences. |
The include directive also expands environment variables in the include file name. So in my kitty.conf I have
Of course this implies that the HOSTNAME variable is st system wide on your machine. |
I can't seem to get this to work on 0.12.3 When I have in my my kitty.conf file: include LilArooni.conf # this works great. include ${HOSTNAME}.conf # does not seem to load -- even though HOSTNAME is set [ubuntu 18.04] -- and HOSTNAME=LilArooni i tried with including full path names and no dice. what do i seem to be doing wrong? |
You need to set the HOSTNAME variable in your global environment ot your shell scripts. Remember that shell scripts are loaded after kitty starts not before. And paths for that directive are relative to the kittyconfig directory |
Got it working thanks. For anyone else visiting; edit /etc/enviornment on Ubuntu |
@arooni Could you please help me, I am having same issue but seems like things are not working on my mac. I want to setup theme based on in export SET_THEME="github_dimmed" in
Ironically, This same variable is accessible in my |
Having a similar problem to bhushan above. I'm trying to standardize fonts across several programs and so have created an environment variable containing the desired font name. Viewing the "current kitty env vars" page within kitty, I can see that kitty indeed sees my font environment variable. Seems like kitty is not expanding the environment variable to obtain its value, maybe contrary to what is indicated in the documentation. Have tried defining the variable within Can someone please advise on how to properly access and use environment variables within the kitty config file? Running kitty version 0.26.3 in Pop 22.04 if that makes any difference. Thanks much in advance. |
Nowhere in the documentation does it say the font_family expands env |
It would be nice for Kitty to automatically have at least something akin to |
There you go: d7d96c2 |
@kovidgoyal thanks so much! Awesome work on everything, btw, including the key handling effort. |
For anyone on macOS who wants @arooni's solution ( |
I would like to manage settings across machines in one file and I have some different configs for each of them. Is it possible to put conditionals in config files, e.g. set different
font size
according tohostname
?I went through the doc for config file and I didn't find anything related to conditionals. I also tried simple bash
if else
but doesn't seem to work.Is it possible? If not, are there any workarounds?
The text was updated successfully, but these errors were encountered: