Skip to content

Commit

Permalink
Automatically use dark mode on jupyter, rstudio & vscode (#145)
Browse files Browse the repository at this point in the history
* enable dark mode for jupyter

* Update onyxia-init.sh

* use MAMBA_DIR variable

* remove darkmode from settings

* darkmode for r and vscode

* R dark mode theme and vscode settings
  • Loading branch information
ihiverlet authored Oct 16, 2023
1 parent f17f03f commit 7354bd9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 17 additions & 0 deletions scripts/onyxia-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,23 @@ if command -v R; then
env | grep "IMAGE_NAME" >> ${R_HOME}/etc/Renviron.site
fi
if [[ -n "$DARK_MODE" ]]; then
if command -v jupyter lab; then
echo "{\"@jupyterlab/apputils-extension:themes\": {\"theme\": \"JupyterLab Dark\"}}" > ${MAMBA_DIR}/share/jupyter/lab/settings/overrides.json;
fi
if command -v vscode; then
jq '.|= . + {"workbench.colorTheme": "Default Dark Modern", }' ${HOME}/.local/share/code-server/User/settings.json
fi
if command -v R; 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
fi
fi
if [[ -e "$HOME/work" ]]; then
if [[ $(id -u) = 0 ]]; then
echo "cd $HOME/work" >> /etc/profile
Expand Down
1 change: 0 additions & 1 deletion vscode/settings/User.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"workbench.colorTheme": "Default Dark+",
"security.workspace.trust.enabled": false,
"security.workspace.trust.startupPrompt": "never",
"terminal.integrated.inheritEnv": false,
Expand Down

0 comments on commit 7354bd9

Please sign in to comment.