!apt-get install vim tmux powerline zsh stow
!git clone https://github.com/gbraad/dotfiles.git ~/.dotfiles
!~/.dotfiles/install.shor
!curl -fsSL https://dotfiles.gbraad.nl/install.sh | sh%%script zsh
. ~/.dotfiles/source.sh
countryIn a code cell execute:
from IPython.core.magic import register_line_cell_magic
@register_line_cell_magic
def mysh(line, cell=None):
command = line
if cell:
command += '\n' + cell
get_ipython().system(f"zsh -i -c '. ~/.dotfiles/source.sh; {command}'")%dot country"The Netherlands"
%%dotscript
country"The Netherlands"
This is only available if the .dotfiles has also stowed ipython. This can be done as follows
%%script zsh
cd ~/.dotfiles
stow ipythonAfter this you can use the following in your notebook to load the extension:
$load_ext dotfilesThis enables the tools devenv, machine, app, action, notebook, etc which can be used as:
%devenv gofedora noinit%app weather apeldoornIf for some reason you get a ModuleNotFoundError: No module named 'dotfiles', it might be that the extensions is not part of the sys.path. This can be fixed with:
import sys, os
sys.path.append(os.path.expanduser("~/.ipython/extensions"))