Gotta commit before battery runs out, almost finished!
This commit is contained in:
parent
6bf5b9dd08
commit
8d04d9c649
|
@ -20,24 +20,21 @@
|
||||||
pkgs.writeText "run_jupyter_from_helix.zsh"
|
pkgs.writeText "run_jupyter_from_helix.zsh"
|
||||||
''
|
''
|
||||||
#! ~/.nix-profile/bin/zsh
|
#! ~/.nix-profile/bin/zsh
|
||||||
function is_new() {
|
is_new() {
|
||||||
new=true;
|
new=1;
|
||||||
touch /tmp/rjh;
|
touch /tmp/rjh;
|
||||||
cat /tmp/rjh | while read line
|
while IFS="" read -r p || [ -n "$p" ]; do
|
||||||
do
|
if [ $(pwd) = $p ]; then
|
||||||
if [$(pwd) = line]; then
|
new=0;
|
||||||
new=false;
|
|
||||||
fi
|
fi
|
||||||
done
|
done < /tmp/rjh
|
||||||
echo new;
|
return $new
|
||||||
}
|
}
|
||||||
|
|
||||||
function send_to_jupyter() {
|
send_to_jupyter() {
|
||||||
if $(is_new); then
|
is_new && zellij run -f -n "jupyter console" -- direnv exec . jupyter console --kernel="$1" -f="/tmp/rjh-$(pwd | tr \"/\" -).json" --ZMQTerminalInteractiveShell.include_other_output=True --ZMQTerminalInteractiveShell.other_output_prefix=''' && zellij action write 29 25
|
||||||
zellij run -f -n "jupyter console" -- direnv exec . jupyter console --kernel="$1" -f="/tmp/rjh-$(pwd | tr \"/\" -).json" --ZMQTerminalInteractiveShell.include_other_output=True --ZMQTerminalInteractiveShell.other_output_prefix=\'\'
|
pwd >> /tmp/rjh
|
||||||
pwd >> /tmp/rjh
|
zellij action write 29 25
|
||||||
fi
|
|
||||||
zellij write 29 25 # send ctr + w
|
|
||||||
cat | just send
|
cat | just send
|
||||||
}
|
}
|
||||||
send_to_jupyter
|
send_to_jupyter
|
||||||
|
|
Loading…
Reference in a new issue