#!/bin/bash # in order to add environmental variables, put them in the following format: echo "TEST_ECHO_HOOK='it worked' " >> ~/.bashrc # you won't have sudo permissions since this script is run as the user # but you can install extra packages that do not require it # be mindful of paths you may not have permission to access # misconfiguring will lead to a frozen start-up. # however, this is a good place to run conda installations # this adds time to spawning the server, so only run things you would normally # be installing manually on log-in anyway and willing to wait for. # adding || true allows graceful failure. # vim settings git clone https://github.com/mathematicalmichael/docker-env.git \ --depth 1 \ ~/startup_scripts/docker-env/ || true mv ~/startup_scripts/docker-env/setup/vim ~/.vim mv ~/startup_scripts/docker-env/setup/vimrc ~/.vimrc mv ~/startup_scripts/docker-env/setup/bash_aliases ~/.bash_aliases mv ~/startup_scripts/docker-env/setup/bash_fzf ~/.bash_fzf echo "moved setup files." echo "moving settings for jlab" # dark mode and settings mkdir -p ~/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ mv ~/startup_scripts/themes.jupyterlab-settings ~/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ mkdir -p ~/.jupyter/lab/user-settings/@jupyterlab/codemirror-extension/ mv ~/startup_scripts/commands.jupyterlab-settings ~/.jupyter/lab/user-settings/@jupyterlab/codemirror-extension/ echo "removing docker-env" rm -rf ~/startup_scripts/docker-env/ echo "configuring settings" # some other settigs, preferential default programs if they exist. if [ -f /usr/bin/vim ]; then echo "export EDITOR=/usr/bin/vim" >> ~/.bashrc; fi if [ -f /usr/bin/less ]; then echo "export PAGER=/usr/bin/less" >> ~/.bashrc; else echo "export PAGER=/usr/bin/more" >> ~/.bashrc; fi echo "remember git config" git config --global credential.helper "cache --timeout 144000" echo "default latex" # you can choose the default compiler for the jupyterlab latex extension echo "c.LatexConfig.latex_command = 'pdflatex'" >> /home/$NB_USER/.jupyter/jupyter_notebook_config.py echo "Completed successfully."