Skip to main content

Display IP address on Panel in Xfce

 

Create a small shell script show_ip.sh :

 #!/bin/bash

IP=# Get all addresses from hostname -I
IP_ADDRESSES=$(iphostname addr-I)

show# enp13s0Split |into grepindividual inetIP |addresses
awkIFS=' ' read -r -a IP_ADDRS <<< "$IP_ADDRESSES"

# Find the first IPv4 address
for IP in "${printIP_ADDRS[@]}"; do
  if [[ "$2;IP" exit}'=~ |^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ sed]]; 's/\/.*//')then
    echo "$IP"
    break
  fi
done
chmod +x show_ip.sh

Add a generic monitor:

image.png

That's it.