1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-12-22 14:54:23 +00:00

Display hostname in magenta if current host cannot be determined

This commit is contained in:
Steffo 2021-07-19 18:02:26 +02:00
parent 061c7a6b4c
commit 7208fd2409
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -36,7 +36,10 @@ function fish_prompt
# Hostname
if test (who am i | awk '{print $5}') = "(:0)"
set -g CURRENT_IP (who am i | awk '{print $5}')
if test -z "$CURRENT_IP"
set_color magenta
else if test "$CURRENT_IP" "=" "(:0)"
set_color green
else
set_color cyan