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:
parent
95f26a6322
commit
c5fa4d1056
@ -1,4 +1,12 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
|
command -v scwrypts &>/dev/null || {
|
||||||
|
[ -f $HOME/.local/bin/scwrypts ] \
|
||||||
|
&& scwrypts() { $HOME/.local/bin/scwrypts $@; } \
|
||||||
|
|| scwrypts() { $HOME/.wryn/zsh/plugins/scwrypts/scwrypts $@; } \
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
( next | previous | play-pause ) playerctl $1 ;;
|
( next | previous | play-pause ) playerctl $1 ;;
|
||||||
( fastforward ) playerctl position 5+ ;;
|
( fastforward ) playerctl position 5+ ;;
|
||||||
|
@ -13,5 +13,5 @@ xrandr ${ARGS[@]} \
|
|||||||
(pkill compton; sleep 0.5; compton;) &
|
(pkill compton; sleep 0.5; compton;) &
|
||||||
|
|
||||||
scwrypts desktop screen-blank -- enable
|
scwrypts desktop screen-blank -- enable
|
||||||
scwrypts desktop i3 set background -- random
|
scwrypts desktop i3 set background -- $(scwrypts -n get theme).jpg || scwrypts desktop i3 set background -- random
|
||||||
scwrypts desktop play sound -- gamedock
|
scwrypts desktop play sound -- gamedock
|
||||||
|
@ -5,11 +5,14 @@
|
|||||||
SCWRYPTS_SHORTCUT='' # CTRL + W
|
SCWRYPTS_SHORTCUT='' # CTRL + W
|
||||||
SCWRYPTS_ENV_SHORTCUT='' # CTRL + /
|
SCWRYPTS_ENV_SHORTCUT='' # CTRL + /
|
||||||
|
|
||||||
source "$HOME/.wryn/scwrypts/dotwryn/dotwryn.scwrypts.zsh"
|
for SEARCH_DIR in \
|
||||||
source "$HOME/.wryn/scwrypts/ssh/ssh.scwrypts.zsh"
|
"$HOME/.wryn/scwrypts" \
|
||||||
|
"$HOME/Projects/yage/" \
|
||||||
[ -f "$HOME/Projects/yage/home/code/scwrypts/yagehome.scwrypts.zsh" ] \
|
;
|
||||||
&& source "$HOME/Projects/yage/home/code/scwrypts/yagehome.scwrypts.zsh"
|
do
|
||||||
|
[ -d "$SEARCH_DIR" ] || continue
|
||||||
|
for G in "$SEARCH_DIR/"**/*.scwrypts.zsh; do . "$G"; done
|
||||||
|
done
|
||||||
|
|
||||||
[ -f "$HOME/.config/scwrypts/config.local.zsh" ] \
|
[ -f "$HOME/.config/scwrypts/config.local.zsh" ] \
|
||||||
&& source "$HOME/.config/scwrypts/config.local.zsh"
|
&& source "$HOME/.config/scwrypts/config.local.zsh"
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# session name for remote connection (default 'remote')
|
# session name for remote connection (default 'remote')
|
||||||
export REMOTE_TMUX_SESSION=wryn
|
export REMOTE_TMUX_SESSION=
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# session name for remote connection (default 'remote')
|
# session name for remote connection (default 'remote')
|
||||||
export REMOTE_TMUX_SESSION=wryn # from local
|
export REMOTE_TMUX_SESSION=
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# session name for remote connection (default 'remote')
|
# session name for remote connection (default 'remote')
|
||||||
export REMOTE_TMUX_SESSION=wryn # from local
|
export REMOTE_TMUX_SESSION=
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# session name for remote connection (default 'remote')
|
# session name for remote connection (default 'remote')
|
||||||
export REMOTE_TMUX_SESSION=wryn # from local
|
export REMOTE_TMUX_SESSION=
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# session name for remote connection (default 'remote')
|
# session name for remote connection (default 'remote')
|
||||||
export REMOTE_TMUX_SESSION=wryn # from local
|
export REMOTE_TMUX_SESSION=
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# session name for remote connection (default 'remote')
|
# session name for remote connection (default 'remote')
|
||||||
export REMOTE_TMUX_SESSION=wryn # from local
|
export REMOTE_TMUX_SESSION=
|
||||||
|
@ -24,12 +24,6 @@ export DISCORD__DEFAULT_CHANNEL_ID=
|
|||||||
export DISCORD__DEFAULT_USERNAME=
|
export DISCORD__DEFAULT_USERNAME=
|
||||||
export DISCORD__DEFAULT_WEBHOOK=
|
export DISCORD__DEFAULT_WEBHOOK=
|
||||||
|
|
||||||
# custom i3 configuration settings
|
|
||||||
export I3__BORDER_PIXEL_SIZE=
|
|
||||||
export I3__DMENU_FONT_SIZE=
|
|
||||||
export I3__GLOBAL_FONT_SIZE=
|
|
||||||
export I3__MODEL_CONFIG=$DOTWRYN/config/i3.conf
|
|
||||||
|
|
||||||
# linear.app project management configuration
|
# linear.app project management configuration
|
||||||
export LINEAR__API_TOKEN=
|
export LINEAR__API_TOKEN=
|
||||||
|
|
||||||
|
@ -24,12 +24,6 @@ export DISCORD__DEFAULT_CHANNEL_ID=
|
|||||||
export DISCORD__DEFAULT_USERNAME=
|
export DISCORD__DEFAULT_USERNAME=
|
||||||
export DISCORD__DEFAULT_WEBHOOK=
|
export DISCORD__DEFAULT_WEBHOOK=
|
||||||
|
|
||||||
# custom i3 configuration settings
|
|
||||||
export I3__BORDER_PIXEL_SIZE=
|
|
||||||
export I3__DMENU_FONT_SIZE=
|
|
||||||
export I3__GLOBAL_FONT_SIZE=
|
|
||||||
export I3__MODEL_CONFIG=$DOTWRYN/config/i3.conf # from local
|
|
||||||
|
|
||||||
# linear.app project management configuration
|
# linear.app project management configuration
|
||||||
export LINEAR__API_TOKEN=
|
export LINEAR__API_TOKEN=
|
||||||
|
|
||||||
|
@ -24,12 +24,6 @@ export DISCORD__DEFAULT_CHANNEL_ID=
|
|||||||
export DISCORD__DEFAULT_USERNAME=
|
export DISCORD__DEFAULT_USERNAME=
|
||||||
export DISCORD__DEFAULT_WEBHOOK=
|
export DISCORD__DEFAULT_WEBHOOK=
|
||||||
|
|
||||||
# custom i3 configuration settings
|
|
||||||
export I3__BORDER_PIXEL_SIZE=
|
|
||||||
export I3__DMENU_FONT_SIZE=
|
|
||||||
export I3__GLOBAL_FONT_SIZE=
|
|
||||||
export I3__MODEL_CONFIG=$DOTWRYN/config/i3.conf # from local
|
|
||||||
|
|
||||||
# linear.app project management configuration
|
# linear.app project management configuration
|
||||||
export LINEAR__API_TOKEN=
|
export LINEAR__API_TOKEN=
|
||||||
|
|
||||||
|
@ -24,12 +24,6 @@ export DISCORD__DEFAULT_CHANNEL_ID=
|
|||||||
export DISCORD__DEFAULT_USERNAME=
|
export DISCORD__DEFAULT_USERNAME=
|
||||||
export DISCORD__DEFAULT_WEBHOOK=
|
export DISCORD__DEFAULT_WEBHOOK=
|
||||||
|
|
||||||
# custom i3 configuration settings
|
|
||||||
export I3__BORDER_PIXEL_SIZE=1
|
|
||||||
export I3__DMENU_FONT_SIZE=20
|
|
||||||
export I3__GLOBAL_FONT_SIZE=7
|
|
||||||
export I3__MODEL_CONFIG=$DOTWRYN/config/i3.conf # from local
|
|
||||||
|
|
||||||
# linear.app project management configuration
|
# linear.app project management configuration
|
||||||
export LINEAR__API_TOKEN=
|
export LINEAR__API_TOKEN=
|
||||||
|
|
||||||
|
@ -24,12 +24,6 @@ export DISCORD__DEFAULT_CHANNEL_ID=
|
|||||||
export DISCORD__DEFAULT_USERNAME=
|
export DISCORD__DEFAULT_USERNAME=
|
||||||
export DISCORD__DEFAULT_WEBHOOK=
|
export DISCORD__DEFAULT_WEBHOOK=
|
||||||
|
|
||||||
# custom i3 configuration settings
|
|
||||||
export I3__BORDER_PIXEL_SIZE=
|
|
||||||
export I3__DMENU_FONT_SIZE=
|
|
||||||
export I3__GLOBAL_FONT_SIZE=
|
|
||||||
export I3__MODEL_CONFIG=$DOTWRYN/config/i3.conf # from local
|
|
||||||
|
|
||||||
# linear.app project management configuration
|
# linear.app project management configuration
|
||||||
export LINEAR__API_TOKEN=
|
export LINEAR__API_TOKEN=
|
||||||
|
|
||||||
|
@ -24,22 +24,19 @@ export DISCORD__DEFAULT_CHANNEL_ID=
|
|||||||
export DISCORD__DEFAULT_USERNAME=umbreon
|
export DISCORD__DEFAULT_USERNAME=umbreon
|
||||||
export DISCORD__DEFAULT_WEBHOOK=
|
export DISCORD__DEFAULT_WEBHOOK=
|
||||||
|
|
||||||
# custom i3 configuration settings
|
|
||||||
export I3__BORDER_PIXEL_SIZE=3
|
|
||||||
export I3__DMENU_FONT_SIZE=18
|
|
||||||
export I3__GLOBAL_FONT_SIZE=16
|
|
||||||
export I3__MODEL_CONFIG=$DOTWRYN/config/i3.conf # from local
|
|
||||||
|
|
||||||
# linear.app project management configuration
|
# linear.app project management configuration
|
||||||
export LINEAR__API_TOKEN=
|
export LINEAR__API_TOKEN=
|
||||||
|
|
||||||
# s3 bucket name and filesystem targets for media backups
|
# s3 bucket name and filesystem targets for media backups
|
||||||
export MEDIA_SYNC__S3_BUCKET=yage # from local
|
export MEDIA_SYNC__S3_BUCKET=yage # from local
|
||||||
export MEDIA_SYNC__TARGETS=(
|
export MEDIA_SYNC__TARGETS=(
|
||||||
.porn
|
|
||||||
Documents
|
Documents
|
||||||
Media
|
|
||||||
Pictures
|
Pictures
|
||||||
|
.local/.porn
|
||||||
|
Media/commission
|
||||||
|
Media/music
|
||||||
|
Media/recordings
|
||||||
|
Media/sfx
|
||||||
)
|
)
|
||||||
|
|
||||||
# redis connection credentials
|
# redis connection credentials
|
||||||
|
@ -39,3 +39,7 @@ VUNDLE__BUILD__youcompleteme() {
|
|||||||
# ... build steps from /home/w0ryn/.vim/youcompleteme
|
# ... build steps from /home/w0ryn/.vim/youcompleteme
|
||||||
./install.py --all
|
./install.py --all
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VUNDLE__BUILD__rust.vim() {
|
||||||
|
# ... build steps from /home/w0ryn/.vim/rust.vim
|
||||||
|
}
|
||||||
|
@ -1 +1,2 @@
|
|||||||
setxkbmap -option compose:ralt
|
setxkbmap -option compose:ralt
|
||||||
|
return 0
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
use bastion --group remote
|
||||||
use config --group remote
|
use config --group remote
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
@ -14,6 +15,9 @@ USAGE__options="
|
|||||||
--no-tty don't request a tty connection
|
--no-tty don't request a tty connection
|
||||||
|
|
||||||
--force-local-login force login through ssh when working with localhost
|
--force-local-login force login through ssh when working with localhost
|
||||||
|
|
||||||
|
--use-bastion true / false override for bastion preference
|
||||||
|
(default: session.name.bastion.preferred or 'false')
|
||||||
"
|
"
|
||||||
|
|
||||||
USAGE__description="
|
USAGE__description="
|
||||||
@ -35,22 +39,33 @@ MAIN() {
|
|||||||
local LOAD_RC=true
|
local LOAD_RC=true
|
||||||
local USE_TTY=true
|
local USE_TTY=true
|
||||||
local FORCE_LOCAL_LOGIN=false
|
local FORCE_LOCAL_LOGIN=false
|
||||||
|
local USE_BASTION
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
|
local _S=1
|
||||||
case $1 in
|
case $1 in
|
||||||
-t | --type ) CONNECTION_TYPE=$2; shift 1 ;;
|
-t | --type ) ((_S+=1)); CONNECTION_TYPE=$2 ;;
|
||||||
-c | --command ) REMOTE_COMMAND=$2; shift 1 ;;
|
-c | --command ) ((_S+=1)); REMOTE_COMMAND=$2 ;;
|
||||||
-s | --shell ) LOGIN_SHELL=$2; shift 1 ;;
|
-s | --shell ) ((_S+=1)); LOGIN_SHELL=$2 ;;
|
||||||
|
|
||||||
--no-rc ) LOAD_RC=false ;;
|
--no-rc ) LOAD_RC=false ;;
|
||||||
--no-tty ) USE_TTY=false ;;
|
--no-tty ) USE_TTY=false ;;
|
||||||
|
|
||||||
|
--use-bastion )
|
||||||
|
((_S+=1))
|
||||||
|
USE_BASTION=$2
|
||||||
|
case $USE_BASTION in
|
||||||
|
true | false ) ;;
|
||||||
|
* ) ERROR "invalid setting for '--use-bastion' (must be 'true' or 'false')" ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
--force-local-login ) FORCE_LOCAL_LOGIN=true ;;
|
--force-local-login ) FORCE_LOCAL_LOGIN=true ;;
|
||||||
|
|
||||||
* ) ERROR "unknown argument '$1'" ;;
|
* ) ERROR "unknown argument '$1'" ;;
|
||||||
esac
|
esac
|
||||||
shift 1
|
shift $_S
|
||||||
done
|
done
|
||||||
|
|
||||||
CHECK_ERRORS
|
CHECK_ERRORS
|
||||||
@ -88,8 +103,8 @@ MAIN() {
|
|||||||
REMOTE_COMMAND=$(\
|
REMOTE_COMMAND=$(\
|
||||||
REMOTE__QUERY_CONNECTION_WITH_FALLBACK \
|
REMOTE__QUERY_CONNECTION_WITH_FALLBACK \
|
||||||
"$REMOTE_COMMAND" \
|
"$REMOTE_COMMAND" \
|
||||||
".$REMOTE_NAME.$CONNECTION_TYPE.command" \
|
".sessions.$REMOTE_NAME.$CONNECTION_TYPE.command" \
|
||||||
".$REMOTE_NAME.command" \
|
".sessions.$REMOTE_NAME.command" \
|
||||||
".default.$CONNECTION_TYPE.command" \
|
".default.$CONNECTION_TYPE.command" \
|
||||||
".default.command" \
|
".default.command" \
|
||||||
)
|
)
|
||||||
@ -113,6 +128,35 @@ MAIN() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
[ $USE_BASTION ] || {
|
||||||
|
USE_BASTION=$(\
|
||||||
|
REMOTE__QUERY_CONNECTION_WITH_FALLBACK \
|
||||||
|
".sessions.$REMOTE_NAME.bastion.preferred" \
|
||||||
|
'false' \
|
||||||
|
;
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
local BASTION_HOST
|
||||||
|
[[ $USE_BASTION =~ true ]] && {
|
||||||
|
BASTION_HOST=$(\
|
||||||
|
REMOTE__QUERY_CONNECTION_WITH_FALLBACK \
|
||||||
|
".sessions.$REMOTE_NAME.bastion.session" \
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[ $BASTION_HOST ] && {
|
||||||
|
PASSTHROUGH_COMMAND="$(GET_PASSTHROUGH_PREFIX) connect $REMOTE_NAME -- -c $(printf "%q " "$REMOTE_COMMAND")"
|
||||||
|
|
||||||
|
BASTION_TARGET=$REMOTE_NAME REMOTE__TARGET=$BASTION_HOST MAIN --command "$PASSTHROUGH_COMMAND"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
|
||||||
[ $REMOTE_COMMAND ] && [[ $LOAD_RC =~ true ]] && {
|
[ $REMOTE_COMMAND ] && [[ $LOAD_RC =~ true ]] && {
|
||||||
REMOTE_COMMAND="$LOGIN_SHELL -l -c 'source ~/.$(basename $LOGIN_SHELL)rc &>/dev/null; $REMOTE_COMMAND'"
|
REMOTE_COMMAND="$LOGIN_SHELL -l -c 'source ~/.$(basename $LOGIN_SHELL)rc &>/dev/null; $REMOTE_COMMAND'"
|
||||||
}
|
}
|
||||||
@ -123,10 +167,11 @@ MAIN() {
|
|||||||
|| REMOTE_COMMAND="$LOGIN_SHELL"
|
|| REMOTE_COMMAND="$LOGIN_SHELL"
|
||||||
}
|
}
|
||||||
|
|
||||||
##########################################
|
[ $BASTION_TARGET ] && CONNECTION_TYPE=bastion
|
||||||
|
|
||||||
STATUS "
|
DEBUG "
|
||||||
attempting execution on $REMOTE_NAME
|
attempting execution:
|
||||||
|
netpath : $(hostnamectl --static) -> $([ $BASTION_TARGET ] && echo "$BASTION_TARGET -> ")$REMOTE_NAME
|
||||||
type : $CONNECTION_TYPE
|
type : $CONNECTION_TYPE
|
||||||
connection : $REMOTE_NAME
|
connection : $REMOTE_NAME
|
||||||
command : \"$REMOTE_COMMAND\"
|
command : \"$REMOTE_COMMAND\"
|
3
scwrypts/remote/lib/bastion.module.zsh
Normal file
3
scwrypts/remote/lib/bastion.module.zsh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
GET_PASSTHROUGH_PREFIX() {
|
||||||
|
echo "SUBSCWRYPT=$((SUBSCWRYPT+1)) SCWRYPTS_LOG_LEVEL=$SCWRYPTS_LOG_LEVEL scwrypts"
|
||||||
|
}
|
@ -2,7 +2,7 @@ SCWRYPTS_GROUPS+=(remote)
|
|||||||
[ $DOTWRYN ] || source "$HOME/.config/wryn/env.zsh"
|
[ $DOTWRYN ] || source "$HOME/.config/wryn/env.zsh"
|
||||||
|
|
||||||
export SCWRYPTS_TYPE__remote=zsh
|
export SCWRYPTS_TYPE__remote=zsh
|
||||||
export SCWRYPTS_ROOT__remote="$DOTWRYN/scwrypts/ssh"
|
export SCWRYPTS_ROOT__remote="$DOTWRYN/scwrypts/remote"
|
||||||
export SCWRYPTS_COLOR__remote='\033[0;34m'
|
export SCWRYPTS_COLOR__remote='\033[0;34m'
|
||||||
|
|
||||||
DEPENDENCIES+=(yq)
|
DEPENDENCIES+=(yq)
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
use bastion --group remote
|
||||||
use config --group remote
|
use config --group remote
|
||||||
|
|
||||||
DEPENDENCIES+=(timeout ssh)
|
DEPENDENCIES+=(timeout ssh)
|
||||||
@ -9,6 +10,9 @@ USAGE__options='
|
|||||||
-s, --connection-string explicit session host / ssh connection string to test
|
-s, --connection-string explicit session host / ssh connection string to test
|
||||||
-t, --maximum-timeout maximum connection timeout before failure (in seconds)
|
-t, --maximum-timeout maximum connection timeout before failure (in seconds)
|
||||||
-c, --command testing command; performs echo by default
|
-c, --command testing command; performs echo by default
|
||||||
|
|
||||||
|
--use-bastion true / false override for bastion preference
|
||||||
|
(default: session.name.bastion.preferred or "false")
|
||||||
'
|
'
|
||||||
|
|
||||||
USAGE__description='
|
USAGE__description='
|
||||||
@ -22,45 +26,86 @@ MAIN() {
|
|||||||
local CONNECTION_STRING REMOTE_NAME
|
local CONNECTION_STRING REMOTE_NAME
|
||||||
local TIMEOUT_SECONDS=3
|
local TIMEOUT_SECONDS=3
|
||||||
local COMMAND='echo OK &>/dev/null'
|
local COMMAND='echo OK &>/dev/null'
|
||||||
|
local USE_BASTION
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
|
local _S=1
|
||||||
case $1 in
|
case $1 in
|
||||||
-n | --name )
|
-n | --name )
|
||||||
|
((_S+=1))
|
||||||
REMOTE_NAME=$2
|
REMOTE_NAME=$2
|
||||||
CONNECTION_STRING=$(REMOTE__GET_CONNECTION_STRING $REMOTE_NAME)
|
CONNECTION_STRING=$(REMOTE__GET_CONNECTION_STRING $REMOTE_NAME)
|
||||||
shift 1
|
|
||||||
;;
|
;;
|
||||||
-s | --connection_string )
|
-s | --connection_string )
|
||||||
|
((_S+=1))
|
||||||
CONNECTION_STRING="$2"
|
CONNECTION_STRING="$2"
|
||||||
shift 1
|
|
||||||
;;
|
;;
|
||||||
-t | --maximum-timout )
|
-t | --maximum-timout )
|
||||||
|
((_S+=1))
|
||||||
TIMEOUT_SECONDS=$2
|
TIMEOUT_SECONDS=$2
|
||||||
[[ $TIMEOUT_SECONDS -gt 0 ]] \
|
[[ $TIMEOUT_SECONDS -gt 0 ]] \
|
||||||
|| ERROR "invalid timeout seconds '$TIMEOUT_SECONDS'"
|
|| ERROR "invalid timeout seconds '$TIMEOUT_SECONDS'"
|
||||||
shift 1
|
|
||||||
;;
|
;;
|
||||||
-c | --command )
|
-c | --command )
|
||||||
|
((_S+=1))
|
||||||
COMMAND=$2
|
COMMAND=$2
|
||||||
shift 1
|
;;
|
||||||
|
--use-bastion )
|
||||||
|
((_S+=1))
|
||||||
|
USE_BASTION=$2
|
||||||
|
case $USE_BASTION in
|
||||||
|
true | false ) ;;
|
||||||
|
* ) ERROR "invalid setting for '--use-bastion' (must be 'true' or 'false')" ;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
* ) ERROR "unrecognized argument '$1'" ;;
|
* ) ERROR "unrecognized argument '$1'" ;;
|
||||||
esac
|
esac
|
||||||
shift 1
|
shift $_S
|
||||||
done
|
done
|
||||||
|
|
||||||
[ $CONNECTION_STRING ] \
|
[ $CONNECTION_STRING ] \
|
||||||
|| ERROR "unable to determine connection string"
|
|| ERROR "unable to determine connection string"
|
||||||
|
|
||||||
|
|
||||||
|
[ $USE_BASTION ] || {
|
||||||
|
USE_BASTION=$(\
|
||||||
|
REMOTE__QUERY_CONNECTION_WITH_FALLBACK \
|
||||||
|
".sessions.$REMOTE_NAME.bastion.preferred" \
|
||||||
|
'false' \
|
||||||
|
;
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
CHECK_ERRORS
|
CHECK_ERRORS
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
|
local BASTION_HOST
|
||||||
|
[[ $USE_BASTION =~ true ]] && {
|
||||||
|
BASTION_HOST=$(\
|
||||||
|
REMOTE__QUERY_CONNECTION_WITH_FALLBACK \
|
||||||
|
".sessions.$REMOTE_NAME.bastion.session" \
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ $USE_BASTION =~ true ]] && {
|
||||||
|
[ $BASTION_HOST ] \
|
||||||
|
|| ERROR "cannot connect to $REMOTE_NAME; no configured bastion host" \
|
||||||
|
|| return 1
|
||||||
|
}
|
||||||
|
|
||||||
case $CONNECTION_STRING in
|
case $CONNECTION_STRING in
|
||||||
localhost | $USER@localhost )
|
localhost | $USER@localhost )
|
||||||
CONNECTION_TEST() { return 0; } # current user on local machine can always connect
|
CONNECTION_TEST() { return 0; } # current user on local machine can always connect
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
|
[[ $USE_BASTION =~ true ]] && {
|
||||||
|
DEBUG "MAIN -n $BASTION_HOST -c \"$(GET_PASSTHROUGH_PREFIX) remote test -- -n $REMOTE_NAME -c \"$COMMAND\"\""
|
||||||
|
BASTION_TARGET="$REMOTE_NAME" MAIN -n $BASTION_HOST -c "$(GET_PASSTHROUGH_PREFIX) remote test -- -n $REMOTE_NAME -c \"$COMMAND\""
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
CONNECTION_TEST() {
|
CONNECTION_TEST() {
|
||||||
[ $REMOTE_NAME ] && {
|
[ $REMOTE_NAME ] && {
|
||||||
[[ $(REMOTE__QUERY_CONNECTION .sessions.$REMOTE_NAME) =~ false ]] && {
|
[[ $(REMOTE__QUERY_CONNECTION .sessions.$REMOTE_NAME) =~ false ]] && {
|
||||||
@ -68,16 +113,16 @@ MAIN() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
local REMOTE_ARGS=()
|
local REMOTE_ARGS=()
|
||||||
REMOTE_ARGS+=($(REMOTE__GET_SSH_ARGS --type ssh --no-tty $REMOTE_NAME))
|
REMOTE_ARGS+=($(REMOTE__GET_SSH_ARGS --type ssh $REMOTE_NAME))
|
||||||
REMOTE_ARGS+=(-o BatchMode=yes)
|
REMOTE_ARGS+=(-o BatchMode=yes)
|
||||||
DEBUG "attempting\nssh ${REMOTE_ARGS[@]} \"$CONNECTION_STRING\" \"$COMMAND\""
|
DEBUG "attempting\ntimeout $TIMEOUT_SECONDS ssh $REMOTE_ARGS $CONNECTION_STRING "'\'"\"$COMMAND"'\'"\"" >&2
|
||||||
timeout $TIMEOUT_SECONDS ssh ${REMOTE_ARGS[@]} "$CONNECTION_STRING" "$COMMAND" >&2
|
timeout --foreground $TIMEOUT_SECONDS ssh ${REMOTE_ARGS[@]} "$CONNECTION_STRING" "$COMMAND" >&2
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ $REMOTE_NAME ] || REMOTE_NAME=explicit
|
[ $REMOTE_NAME ] || REMOTE_NAME=explicit
|
||||||
STATUS "testing connection $CONNECTION_STRING ($REMOTE_NAME)" \
|
STATUS "testing connection $CONNECTION_STRING ($REMOTE_NAME$([ $BASTION_TARGET ] && echo " -> $BASTION_TARGET"))" \
|
||||||
&& CONNECTION_TEST \
|
&& CONNECTION_TEST \
|
||||||
&& SUCCESS "successfully connected to '$CONNECTION_STRING' ($REMOTE_NAME)" \
|
&& SUCCESS "successfully connected to '$CONNECTION_STRING' ($REMOTE_NAME)" \
|
||||||
|| ERROR "connection to '$CONNECTION_STRING ($REMOTE_NAME)' failed" \
|
|| ERROR "connection to '$CONNECTION_STRING ($REMOTE_NAME)' failed" \
|
@ -7,6 +7,22 @@
|
|||||||
|
|
||||||
CONNECTIONS_FILE="$HOME/.config/wryn/remote-connections.toml"
|
CONNECTIONS_FILE="$HOME/.config/wryn/remote-connections.toml"
|
||||||
|
|
||||||
|
OMNI_LOGDIR="$HOME/.local/share/scwrypts/dotwryn"
|
||||||
|
OMNI_LOGFILE="$HOME/.local/share/scwrypts/dotwryn/omni.current.txt"
|
||||||
|
|
||||||
|
[ ! -d "$OMNI_LOGDIR" ] && mkdir -p "$OMNI_LOGDIR"
|
||||||
|
|
||||||
|
[ -f "$OMNI_LOGFILE" ] && {
|
||||||
|
for x in {1..99}
|
||||||
|
do
|
||||||
|
[ ! -f "$OMNI_LOGDIR/omni.$x.txt" ] && break
|
||||||
|
done
|
||||||
|
|
||||||
|
[ ! -f "$OMNI_LOGDIR/omni.$x.txt" ] && mv "$OMNI_LOGFILE" "$OMNI_LOGDIR/omni.$x.txt"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "OMNI MANAGER START : $(date)" > "$OMNI_LOGFILE"
|
||||||
|
|
||||||
OMNI_SOCKET="omni.socket"
|
OMNI_SOCKET="omni.socket"
|
||||||
OMNI_TMUX() { tmux -L $OMNI_SOCKET $@; }
|
OMNI_TMUX() { tmux -L $OMNI_SOCKET $@; }
|
||||||
|
|
||||||
@ -30,7 +46,7 @@ GET_UNIQUE_WINDOW_ID() {
|
|||||||
&& return 0 \
|
&& return 0 \
|
||||||
;
|
;
|
||||||
|
|
||||||
unset WINDOW_ID__$REMOTE_NAME &>/dev/null
|
unset WINDOW_ID__$REMOTE_NAME &>>"$OMNI_LOGFILE"
|
||||||
|
|
||||||
WINDOW_ID="$1"
|
WINDOW_ID="$1"
|
||||||
WINDOW_ID=$(CONFIG_QUERY .sessions.$REMOTE_NAME.id)
|
WINDOW_ID=$(CONFIG_QUERY .sessions.$REMOTE_NAME.id)
|
||||||
@ -86,11 +102,12 @@ do
|
|||||||
&& continue
|
&& continue
|
||||||
|
|
||||||
printf "testing connection $REMOTE_NAME..."
|
printf "testing connection $REMOTE_NAME..."
|
||||||
scwrypts -n --name test --group remote --type zsh \
|
echo "testing connection $REMOTE_NAME..." &>>"$OMNI_LOGFILE"
|
||||||
|
scwrypts --name test --group remote --type zsh \
|
||||||
-- \
|
-- \
|
||||||
--name $REMOTE_NAME \
|
--name $REMOTE_NAME \
|
||||||
--command 'command -v tmux' \
|
--command 'command -v tmux' \
|
||||||
&>/dev/null \
|
&>>"$OMNI_LOGFILE" \
|
||||||
&& export CAN_CONNECT__$REMOTE_NAME=true \
|
&& export CAN_CONNECT__$REMOTE_NAME=true \
|
||||||
|| export CAN_CONNECT__$REMOTE_NAME=false \
|
|| export CAN_CONNECT__$REMOTE_NAME=false \
|
||||||
;
|
;
|
@ -6,6 +6,8 @@ function SETUP__CONFIG() {
|
|||||||
CONFIG__ZSH || return 2
|
CONFIG__ZSH || return 2
|
||||||
CONFIG__VIM || return 3
|
CONFIG__VIM || return 3
|
||||||
|
|
||||||
|
SCWRYPTS generate i3 config || return 4
|
||||||
|
|
||||||
SUCCESS 'finished application configuration'
|
SUCCESS 'finished application configuration'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,5 +11,6 @@ lolcat
|
|||||||
ncurses
|
ncurses
|
||||||
python
|
python
|
||||||
ripgrep
|
ripgrep
|
||||||
|
scwrypts
|
||||||
tmux
|
tmux
|
||||||
vim
|
vim
|
||||||
|
@ -43,6 +43,7 @@ python-virtualenv
|
|||||||
ripgrep
|
ripgrep
|
||||||
rofi
|
rofi
|
||||||
rustup
|
rustup
|
||||||
|
scwrypts
|
||||||
sudo
|
sudo
|
||||||
tmux
|
tmux
|
||||||
ttf-nerd-fonts-symbols
|
ttf-nerd-fonts-symbols
|
||||||
|
@ -92,6 +92,10 @@ OS__INSTALL_MANAGED_DEPENDENCIES() {
|
|||||||
UPDATE_REPOSITORIES__arch() { yay -Syu; }
|
UPDATE_REPOSITORIES__arch() { yay -Syu; }
|
||||||
INSTALL_MANAGED__arch() {
|
INSTALL_MANAGED__arch() {
|
||||||
local TARGET="$1"
|
local TARGET="$1"
|
||||||
|
[[ $TARGET =~ aws-cli-v2 ]] && {
|
||||||
|
STATUS "skipping aws-cli-v2 checks since they are bad right now"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
STATUS "checking for $TARGET"
|
STATUS "checking for $TARGET"
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit c2b4aa5ad2532cca91f23908ac7f00efb7ff09c9
|
Subproject commit c7fb028ec0bbc1056c51508602dbd61b0f475ac3
|
@ -1 +1 @@
|
|||||||
Subproject commit 8f3e86208686de45f06bbfbdd77d3424eb44f607
|
Subproject commit 3fe01a726399df3753cfe544808700bd43c30a09
|
@ -1 +1 @@
|
|||||||
Subproject commit b82ac78a2d4457d2ca09973332638f123f065fd1
|
Subproject commit d37a763a6a30e1b32766fecc3b8ffd6127f8a0fd
|
@ -1,3 +1,8 @@
|
|||||||
|
#####################################################################
|
||||||
|
|
||||||
ZSH_PLUGINS+=($(
|
ZSH_PLUGINS+=($(
|
||||||
find "$HOME/.local/zsh" -type f 2>/dev/null
|
find "$HOME/.local/zsh" -type f 2>/dev/null
|
||||||
))
|
))
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user