diff --git a/quickshell/matugen/dynamic-base16-dankshell.vsix b/quickshell/matugen/dynamic-base16-dankshell.vsix index 306b9a82..42e1d10e 100644 Binary files a/quickshell/matugen/dynamic-base16-dankshell.vsix and b/quickshell/matugen/dynamic-base16-dankshell.vsix differ diff --git a/quickshell/matugen/vsix-build/extension.js b/quickshell/matugen/vsix-build/extension.js index b5ae7805..cb5ef0e4 100644 --- a/quickshell/matugen/vsix-build/extension.js +++ b/quickshell/matugen/vsix-build/extension.js @@ -18,7 +18,7 @@ function activate(context) { if (!watcher) return; - const reloadTheme = (uri) => { + const reloadTheme = () => { if (reloadTimeout) clearTimeout(reloadTimeout); reloadTimeout = setTimeout(async () => { @@ -47,13 +47,28 @@ function activate(context) { return; } - if (!themeData?.colors) return; + const themeKey = `[${currentTheme}]`; - await config.update( - "colorCustomizations", - { "[Dynamic Base16 DankShell]": themeData.colors }, - vscode.ConfigurationTarget.Global - ); + if (themeData.colors) { + const colorConfig = config.get("colorCustomizations") || {}; + colorConfig[themeKey] = themeData.colors; + await config.update( + "colorCustomizations", + colorConfig, + vscode.ConfigurationTarget.Global + ); + } + + if (themeData.tokenColors) { + const editorConfig = vscode.workspace.getConfiguration("editor"); + const tokenConfig = editorConfig.get("tokenColorCustomizations") || {}; + tokenConfig[themeKey] = { textMateRules: themeData.tokenColors }; + await editorConfig.update( + "tokenColorCustomizations", + tokenConfig, + vscode.ConfigurationTarget.Global + ); + } }, 150); };