dotfiles/config/polybar/scripts/network/ip.sh
2023-02-06 17:56:36 -05:00

7 lines
188 B
Bash

#! /bin/sh
local_interface=$(route | awk '/^default/{print $NF}')
local_ip=$(ip addr show "$local_interface" | grep -w "inet" | awk '{ print $2; }' | sed 's/\/.*$//')
echo "# $local_ip"