Skip to content

Instantly share code, notes, and snippets.

@ralsina
Last active May 4, 2023 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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