Skip to content

Instantly share code, notes, and snippets.

@akhiljalagam
Last active December 17, 2020 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhiljalagam/c7a010694cbb0e3882aaab75111f70ee to your computer and use it in GitHub Desktop.
Save akhiljalagam/c7a010694cbb0e3882aaab75111f70ee to your computer and use it in GitHub Desktop.
#
# Alive SSH Connections
#
SPACESHIP_SSH_SHOW="${SPACESHIP_SSH_SHOW=true}"
SPACESHIP_SSH_COLOR="${SPACESHIP_SSH_COLOR="yellow"}"
# ------------------------------------------------------------------------------
# Section
# ------------------------------------------------------------------------------
spaceship_ssh() {
[[ $SPACESHIP_SSH_SHOW == false ]] && return
if [[ $SPACESHIP_SSH_SHOW == 'always' ]] \
|| [[ $SPACESHIP_SSH_SHOW == true ]]
then
local 'ssh_alive'
ssh_alive=`ps auxwww | grep ssh: | grep -v grep | wc -l`
ssh_alive="$ssh_alive "
spaceship::section \
"$SPACESHIP_SSH_COLOR" \
$ssh_alive
fi
}
# add this line to spaceship.zsh
# ssh # Alive SSH connections section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment