Last active
December 17, 2020 06:01
-
-
Save akhiljalagam/c7a010694cbb0e3882aaab75111f70ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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