diff --git a/docs/CONFIG.md b/docs/CONFIG.md index eb7c9475..41cb8190 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -25,6 +25,7 @@ - [mac-player](#mac-player---up) - [mpc](#mpc---up) - [network](#network---up) + - [network-public-ip](#network-public-ip---up) - [network-bandwidth](#network-bandwidth---up) - [network-ping](#network-ping---up) - [network-vpn](#network-vpn---up) @@ -645,6 +646,16 @@ Known issues: - If for some reason `iw` is only in the path for root and not the normal user, wifi connections will be considered ethernet connections. +### network-public-ip - [up](#table-of-contents) + +This widget displays the public IP address you're using, by querying the public service `ifconfig.me`. + +Possible nerdfont settings for public IP info: + +```bash +set -g @dracula-network-public-ip-label "󰖟 " +``` + ### network-bandwidth - [up](#table-of-contents) This widget gives the currently used up and download speeds per second for one interface. diff --git a/scripts/network-public-ip.sh b/scripts/network-public-ip.sh index 7a1ccacd..5853410d 100755 --- a/scripts/network-public-ip.sh +++ b/scripts/network-public-ip.sh @@ -19,7 +19,8 @@ main() { IP_SERVER="ifconfig.me" ip=$(curl -s "$IP_SERVER") - echo "$(get_tmux_option "@dracula-network-public-ip-label" "")$ip" > "${DATAFILE}" + network_public_ip_label=$(get_tmux_option "@dracula-network-public-ip-label" "IP") + echo "$network_public_ip_label$ip" > "${DATAFILE}" printf '%s' "$_now" > "${LAST_EXEC_FILE}" fi