dwyl / learn-raspberry-pi

🥧 Learn how to get started with a Raspberry Pi so you can use your imagination to build/make *ANYTHING*!
GNU General Public License v2.0
7 stars 1 forks source link

Display IP Address in Menu Bar on Ubuntu (RaspberryPI) #25

Open nelsonic opened 2 years ago

nelsonic commented 2 years ago

I find myself constantly having to check the IP address of the PI before attempting to SSH into it. Want to have the IP address visible somewhere so that I never need to check for it again.

This looks like it might do the trick: https://askubuntu.com/questions/1024866/is-it-possible-to-show-ip-address-on-top-bar-near-the-time

image

Going to try it now. 🤞

nelsonic commented 2 years ago

tried:

ip_address=$(ifconfig "$default_interface" | awk 'sub(/.* inet addr:/, "") {print $1}')

Got:

: error fetching interface information: Device not found

Replaced with:

ip_address=$(hostname -I)

Now:

echo $ip_address
192.168.1.196

Success.

nelsonic commented 2 years ago
mkdir ~/bin
vi ~/bin/indicator-sysmonitor-display
#!/bin/bash

ip_address=$(hostname -I)
echo "$ip_address" # sysmon-indidicator will echo string 

exit 0

Install Sysmonitor Indicator

sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt-get update
sudo apt-get install indicator-sysmonitor
nelsonic commented 2 years ago

Sadly, this turned out to be more than the T5m I was hoping it would be. so I'm shelving it for now. Just going to run hostname -I whenever I need the IP and will revisit this when I have more time.

Note: if you know of an easier way, please share!!