Skip to content

Instantly share code, notes, and snippets.

@ralsina
Last active July 22, 2024 00:11
Show Gist options
  • Save ralsina/b7f7bce7f929da7f7eee64510404cc6d to your computer and use it in GitHub Desktop.
Save ralsina/b7f7bce7f929da7f7eee64510404cc6d to your computer and use it in GitHub Desktop.
Dynamically change your VS Code theme using flavours and base16
#!/bin/sh -x
set -e
THEME=$(cat ~/.local/share/flavours/lastscheme)
if grep -q "light" <<< $THEME
then
THEME_NAME=$(jq .name ~/.vscode/extensions/golf1052.base16-generator-1.19.1/themes/base16-$THEME.json)
else
THEME_NAME=$(jq .name ~/.vscode/extensions/golf1052.base16-generator-1.19.1/themes/base16-$THEME-dark.json)
fi
jq '.["workbench.colorTheme"] = '"$THEME_NAME" ~/.config/Code/User/settings.json | sponge ~/.config/Code/User/settings.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment