Skip to content

Instantly share code, notes, and snippets.

@ciis0
Created April 27, 2023 07:33
Show Gist options
  • Save ciis0/c5cd99f5fd2f43d3494528871ee909ea to your computer and use it in GitHub Desktop.
Save ciis0/c5cd99f5fd2f43d3494528871ee909ea to your computer and use it in GitHub Desktop.
psi -- WSLg IntelliJ with pageant agent forwarding
#!/usr/bin/env bash
set -e
#tmux_sess="$( { pgrep -f "tmux attach" || pgrep -f "tmux new"; } | head -n1)"
#if ! [[ "$tmux_sess" ]]
#then read -p "confirm no tmux"
#fi
#eval export $(cat /proc/$tmux_sess/environ | grep -z SSH_AUTH_SOCK | tr "\0" "\n")
psi_env=/tmp/psi.txt
if [[ ! -f $psi_env ]]
then read -p "confirm no psi env"
fi
export SSH_AUTH_SOCK=$(cat /tmp/psi.txt)
setxkbmap -layout de -variant nodeadkeys
export http_proxy=http://127.0.0.1:9000 https_proxy=$http_proxy no_proxy=localhost
cd $(dirname $BASH_SOURCE)
cd .local/opt/idea-IU*
set +e
exec ./bin/idea.sh
powershell -executionpolicy unrestricted psi.ps1
start-job -name foo -ScriptBlock { ssh -A localhost -p 2222 -l cschulz -- 'echo $SSH_AUTH_SOCK > /tmp/psi.txt; while sleep inf & wait; do :; done' }
wsl '$HOME/idea.sh'
stop-job -name foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment