Is it even possible to change the colour theme using the CLI? I went through the doc but could not find anything that matches this requirement.
I am working on a personal project where I am adding a cron job to switch the theme of my computer.
It's not possible to change settings using the code command, but instead you could use sed to edit settings.json like so:
sed -i -e 's/"workbench.colorTheme": ".*"/"workbench.colorTheme": "Visual Studio Dark"/g' "$HOME/.config/Code/User/settings.json"
"workbench.colorTheme": ".*" is the regular expression (regex) to replace."workbench.colorTheme": "Visual Studio Dark" is the replacement string. Change Visual Studio Dark to your desired theme.$HOME/.config/Code/User/settings.json is the path to your settings.jsonIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With