added colorization for bb output
This commit is contained in:
parent
24eee5670a
commit
c3c0dac2eb
@ -15,5 +15,6 @@ if [ -z $SSH_AUTH_SOCK ] ; then
|
|||||||
eval $(ssh-agent -k)
|
eval $(ssh-agent -k)
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
echo "$SSH_AUTH_SOCK"
|
||||||
echo "Agent already running at $SSH_AGENT_PID!"
|
echo "Agent already running at $SSH_AGENT_PID!"
|
||||||
fi
|
fi
|
||||||
|
@ -19,6 +19,24 @@ Options:
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
colorize() {
|
||||||
|
# sets $COLOR to value set in $COLORIZE
|
||||||
|
#echo $COLORIZE
|
||||||
|
case "$COLORIZE" in
|
||||||
|
[0-2])
|
||||||
|
clr='#[fg=color1]' # red
|
||||||
|
;;
|
||||||
|
[3-6])
|
||||||
|
clr='#[fg=color184]' # yellow
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
clr='#[fg=color34]' # green
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
COLOR="$clr$COLORIZE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# constants
|
# constants
|
||||||
timeout=60 # interval we request bike information at
|
timeout=60 # interval we request bike information at
|
||||||
WORKINGDIR="$HOME/.dotfiles/bin/bluebikes"
|
WORKINGDIR="$HOME/.dotfiles/bin/bluebikes"
|
||||||
@ -127,7 +145,16 @@ output_status() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '%d %d %s' "$BIKES" "$DOCKS" "$(echo "$NAME" | tr -d '"')"
|
COLORIZE="$BIKES"
|
||||||
|
colorize
|
||||||
|
echo "$BIKES $COLOR $clr $COLORIZE"
|
||||||
|
BIKES="$COLOR"
|
||||||
|
|
||||||
|
COLORIZE="$DOCKS"
|
||||||
|
colorize
|
||||||
|
DOCKS="$COLOR"
|
||||||
|
echo "$DOCKS $COLOR $clr $COLORIZE"
|
||||||
|
printf '%s %s #[default] %s' $BIKES $DOCKS "$(echo "$NAME" | tr -d '"')"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_station_alias() {
|
set_station_alias() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user