#!/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"