sophuwu.site > bashprompt
uwu
sophuwu sophie@skisiel.com
Thu, 25 Apr 2024 01:21:33 +0200
commit

cb2b76c59acd5e8847ace61b4c15b29634b5428f

parent

021e2c1780b6efa056f584b1632959bb24225d3c

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/prompt.cppsrc/prompt.cpp

@@ -65,7 +65,7 @@ char ip[8];

pipe("hostname -I | awk -F '.' ' { printf(\"%X%X%X%X\",int($1),int($2),int($3),int($4)); } ' ", ip); unsigned char ipaddr[4]; for (int i = 0; i < 4; i++)ipaddr[i] = unhex(ip[2*i])<<4 | unhex(ip[2*i+1]); - for (int i = 0; i < 4; i++)printf("\033[38;5;%dm%c", ipaddr[i] & 0xFF, hex[ipaddr[i]>>4&0xFF]); + for (int i = 0; i < 4; i++)printf("\033[38;5;%dm%c", ipaddr[i] & 0xFF, host[host.length()-4+i]); printf("\033[0m\n");