Repository navigation
Automatically change VS Code theme along with Omarchy themes - #800
Conversation
|
See #719 (comment) |
|
I took a different approach in #791 with Obsidian by trying to infer the colors from the Omarchy themes and make the Obsidian theme dynamic, but allow the Omarchy theme to have a obsidian.css too if they wanted. So regardless, any new theme would magically work. Wonder if extracting that part out could be useful for more things like this and Zed? I got it to work pretty well. |
Oh interesting, I'll take a look. After using this for change locally for a bit, I'm realizing some of these vs code themes, while matching in colors with the rest, aren't that great for me. It's actually a bit disruptive to my workflow, and breaks my habits if it's not a high quality theme. That makes me hesitant about this change, especially without it being an opt-in (or at the very least having an opt-out) mechanism. Along with the comment in #719 (comment), I wonder if having theme hooks might be better to let people pick what they want. It could work in a similar way to |
|
Yeah - there was another proposal about this exact idea: #809 |
|
Question pls: let's say you have a default VSCode setup that you like which is separate from the Omarchy colour theme -- is the behaviour that every time you change Omarchy theme it will override your own VSCode theme (thus needing to manually change it back to your theme on every Omarchy theme change)? |
In its current implementation, yes -- which isn't ideal of course. I could make it something that people opt into (e.g. via theme plugins idea discussed above). A lot of it will depend on the direction Omarchy is taking with respect to theming apps, and VSCode specifically. @dhh any guidance or recommendation here? |
|
This is very nicely done! Super minimal and for the most popular editor. I'm inclined to take it. We had vscode themeing in Omakub too. We don't have any way of opting out of theme changes for neovim. I think that probably just goes with the territory? But we could have a backdoor like |
|
Question: Do these themes work for cursor and other vscode forks as well? |
5af51d4 to
9ac82df
Compare
9ac82df to
e4e53d2
Compare
Added support for that, along with missing themes.
In theory, it should work if the path (and executable to list-extensions) is updated accordingly. I can probably add cursor in a separate PR and check that it works. At that point, I might also refactor the logic in its own Either way, this should be good to go. Thanks @dhh |
|
@dhh when you have a moment, let me know if this looks good to merge. Thanks! |
|
This will make it into Omarchy 2.2 👌 |
|
Testing this now and my vanilla code installation does not have "$HOME/.config/Code/User/settings.json". Is that something we have to initialize ourselves here? |
) * Automatically change VS Code theme along with Omarchy themes * Create a way to skip vscode auto-theming * Make theme setting resilient to different states of the settings.json * Improve setting and removing theme and notify when waiting on install * Explain what we're doing * Extract dedicated bin for vscode theme change --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
|
Thanks @dhh for the merge and updates to the PR. |
) * Automatically change VS Code theme along with Omarchy themes * Create a way to skip vscode auto-theming * Make theme setting resilient to different states of the settings.json * Improve setting and removing theme and notify when waiting on install * Explain what we're doing * Extract dedicated bin for vscode theme change --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
) * Automatically change VS Code theme along with Omarchy themes * Create a way to skip vscode auto-theming * Make theme setting resilient to different states of the settings.json * Improve setting and removing theme and notify when waiting on install * Explain what we're doing * Extract dedicated bin for vscode theme change --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
Adding support for VS Code themes to get updated along with Omarchy themes.
How it works:
When changing theme:
Risks / Open questions:
We're installing an extension on behalf of the user. Is that ok? should it be an opt-in, or an opt-out? is there a precent with nvim themes?
We're updating vscode user config using a regex: not ideal. I would have preferred to use
jqbut it doesn't supprotjsonc(json with comments) which are fairly common for vscode user settings.Didn't find matching themes for all supported themes. Should all official omarchy themes have vs code support?