Skip to content

Commit

Permalink
Use RStudio config file to pass theme instead of R hooks (#196)
Browse files Browse the repository at this point in the history
* Use RStudio config file to pass theme instead of R hooks

* set vibrant ink theme
  • Loading branch information
ihiverlet authored Mar 22, 2024
1 parent 1936e2e commit db48c71
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scripts/onyxia-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,8 @@ if [[ "$DARK_MODE" == "true" ]]; then
jq '. + {"workbench.colorTheme": "Default Dark Modern" }' ${HOME}/.local/share/code-server/User/settings.json > ${HOME}/tmp.settings.json && mv ${HOME}/tmp.settings.json ${HOME}/.local/share/code-server/User/settings.json
fi
if command -v rstudio-server; then
touch ${R_HOME}/etc/Rprofile.site
echo "if (Sys.getenv('DARK_MODE')=='true'){
setHook('rstudio.sessionInit', function(newSession) {
rstudioapi::applyTheme(\"Vibrant Ink\")
}, action = 'append')
}" >> ${R_HOME}/etc/Rprofile.site
mkdir -p ${HOME}/.config/rstudio/
echo "{\"editor_theme\": \"Vibrant Ink\" }" > ${HOME}/.config/rstudio/rstudio-prefs.json
fi
fi
Expand Down

0 comments on commit db48c71

Please sign in to comment.