scwrypts v4.4 config adjustments; added os dependencies; removed dotwryn.env.vim references from setup; generate i3 config on setup
This commit is contained in:
46
scwrypts/remote/remote.scwrypts.zsh
Normal file
46
scwrypts/remote/remote.scwrypts.zsh
Normal file
@ -0,0 +1,46 @@
|
||||
SCWRYPTS_GROUPS+=(remote)
|
||||
[ $DOTWRYN ] || source "$HOME/.config/wryn/env.zsh"
|
||||
|
||||
export SCWRYPTS_TYPE__remote=zsh
|
||||
export SCWRYPTS_ROOT__remote="$DOTWRYN/scwrypts/remote"
|
||||
export SCWRYPTS_COLOR__remote='\033[0;34m'
|
||||
|
||||
DEPENDENCIES+=(yq)
|
||||
REMOTE_CONNECTIONS_FILE="$HOME/.config/wryn/remote-connections.toml"
|
||||
|
||||
SCWRYPTS__LIST_AVAILABLE_SCWRYPTS__remote() {
|
||||
[ -f "$REMOTE_CONNECTIONS_FILE" ] || {
|
||||
mkdir -p "$(dirname -- "$REMOTE_CONNECTIONS_FILE")" &>/dev/null
|
||||
echo "
|
||||
[sessions]
|
||||
|
||||
[sessions.$(hostnamectl --static)]
|
||||
enabled = true
|
||||
host = 'localhost'
|
||||
" | sed 's/^\s\+//; 1d; $d;' > "$REMOTE_CONNECTIONS_FILE"
|
||||
}
|
||||
|
||||
{
|
||||
yq -oy -r '.sessions | keys | .[]' "$REMOTE_CONNECTIONS_FILE" \
|
||||
| sed 's|^|connect/|'
|
||||
|
||||
echo "tmux/omni"
|
||||
echo "configure"
|
||||
echo "test"
|
||||
} | sed "s|^|$SCWRYPTS_TYPE__remote/|"
|
||||
}
|
||||
|
||||
SCWRYPTS__GET_RUNSTRING__remote__zsh() {
|
||||
local SCWRYPT_FILENAME
|
||||
case $SCWRYPT_NAME in
|
||||
connect/* )
|
||||
SCWRYPT_FILENAME="$SCWRYPTS_ROOT__remote/connect"
|
||||
echo "export REMOTE__TARGET=$(echo $SCWRYPT_NAME | sed 's|^.*connect/||')"
|
||||
;;
|
||||
* )
|
||||
SCWRYPT_FILENAME="$SCWRYPTS_ROOT__remote/$SCWRYPT_NAME"
|
||||
;;
|
||||
esac
|
||||
|
||||
SCWRYPTS__GET_RUNSTRING__zsh__generic "$SCWRYPT_FILENAME"
|
||||
}
|
Reference in New Issue
Block a user