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

Split configurations into multiple files and source them from the main file? #153

Open
Abdiloki opened this issue Dec 1, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Abdiloki
Copy link

Abdiloki commented Dec 1, 2021

Is this something that is possible? My edn file is getting pretty long, it'd be neat to be able to split them into separate files based on application/layers. And then source them into the main file.

@yqrashawn yqrashawn added the enhancement New feature or request label Dec 1, 2021
@yqrashawn
Copy link
Owner

It's not possible right now.

@MatCyg
Copy link

MatCyg commented Jan 24, 2022

I had the same issue. I solved it with a bash script that combines all the files.

It is available here. In the main karabiner file I have i.e.: ;include:raise-layer.edn which is then replaced by the script with the content from raise-layer.edn file. The combined file is created in the /tmp/ directory and is deleted after it has been sourced by goku.

@yqrashawn yqrashawn added the help wanted Extra attention is needed label Aug 16, 2022
@eugenesvk
Copy link

eugenesvk commented Nov 18, 2022

another tip: using the great chezmoi dotfile manager with its includeTemplate function you can include all subtemplates to your main karabiner.edn.tmpl template like so:

(this assumes your env var is set to source karabiner.edn from a the custom ~/.config/path2goku/ folder)

<!-- content of karabiner.edn.tmpl at the same path as ↓ -->
{{- includeTemplate "./private_dot_config/path2goku/subtemplate1.edn.tmpl" . -}}
{{- includeTemplate "./private_dot_config/path2goku/subtemplate2.edn.tmpl" . -}}
{{- includeTemplate "./private_dot_config/path2goku/subtemplate3.edn.tmpl" . -}}
{{- includeTemplate "./private_dot_config/path2goku/subtemplate4.edn.tmpl" . -}}

Then after changing the subtemplates and running chezmoi to apply the changes, you will get a consolidated karabiner.edn in you config folder, then just run goku to add it to your karabiner.json

So after updating your configs, you can use this type of one liner to apply them
chezmoi apply -v --interactive ~/.config/path2goku/karabiner.edn; goku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants