You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotfiles/bin/ssh_agent_check

27 lines
533 B
Plaintext

#!/usr/bin/env bash
# checks for agent status and echos to status bar
#ICON=$(echo -e '\Uf08c0')
if [[ -S ~/.ssh/ssh_auth_sock ]] ; then
ICON=$(echo -e '\uf00c')
if [[ "$1" == "-t" ]] ; then
DEFAULT=' #[default]'
clr='#[fg=color34]'
else
clr='%{F#0F0}'
fi
else
# agent not active
ICON=$(echo -e '\uf00d')
if [[ "$1" == "-t" ]] ; then
DEFAULT=' #[default]'
clr='#[fg=color1]'
else
clr='%{F#F00}'
fi
fi
printf 'Agent %s%s%s' $clr $ICON "$DEFAULT"