/uebersicht-widget-raspberryData

Übersicht widget to display data of your Raspberry Pi

Primary LanguageCoffeeScriptMIT LicenseMIT

GitHub release made-with-bash GitHub license GitHub issues GitHub issues-closed contributions welcome GitHub contributors Github All Releases

raspberryData widget

Widget for Übersicht http://tracesof.net/uebersicht/ to display data of your Raspberry


Version History

  • 20200413: 1.0 - Initial Release

banner.png


Features

Currently the following data is collected from your Raspberry Pi

Name Command
Device Model cat /sys/firmware/devicetree/base/model
OS Release Name cat /etc/os-release | grep "PRETTY_NAME" | awk -F"=" '{print $2}' | sed 's/"//g'
kernelVersion uname -r
IP Address hostname -I | awk '{print $1}'
Uptime uptime -p
CPU Model cat /proc/cpuinfo | grep "model name" | awk -F":" '{print $2}'
CPU Type cat /proc/cpuinfo | grep "Hardware" | awk -F":" '{print $2}' | tr -d " "
CPU Revision cat /proc/cpuinfo | grep "Revision" | awk -F":" '{print $2}' | tr -d " "
CPU Temperature /opt/vc/bin/vcgencmd measure_temp | tr -d "temp=" | tr -d "'C"
Running processes /bin/ls -d /proc/[0-9]* | wc -l'
Memory usage (Total) free -m -t | grep 'Mem' | awk '{print $2}'
Memory usage (Free) free -m -t | grep 'Mem' | awk '{print $3}'
Disk usage df -hP | grep root | tr -s " " " " | sed 's/G//g' | sed 's/%//g'

Becoma a part of it
Do you have any ideas to improve or extend the existing functionality? Feel free to raise an issue or create a pull request. Thanks.

Setup

1. Create ssh keys for passwordless access

First prerequisite is, that you have enabled ssh on your Raspberry Pi. You can find instructions here: https://www.raspberrypi.org/documentation/remote-access/ssh/

After that to be able to get the data out of your Raspberry Pi without the need of entering a password, ssh keys need to be created (More info about that can be found here: https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md). Open a terminal on your Mac and go to your home directory /Users// (Enter cd ~ in the terminal and press enter):

Now start the generation of the keys:

ssh-keygen
  • Save the keys in the file /Users//.ssh/id_rsa when prompted - should be the default location
  • Enter NO passphrase (just press two times ENTER when prompted)

Then copy the keys to your Raspberry Pi:

ssh-copy-id <USERNAME>@<IP-ADDRESS>

Now once for copying the file, the password needs to be entered. After logging in the next time on your Raspberry PI through ssh, no password is needed anymore.

2. getData.sh file for config

First of all you need to enter your username and hostname of your Raspberry Pi in the getData.sh file:

# Configuration\
username='your username'\
hostname='ip address or hostname of raspberry'

Afterwards you need to make the file executable: Open a terminal and go to the widget folder (usually located under /Users/<yourUser/Library/Application Support/Übersicht/widgets/raspberryData.widget/). Then apply the following:

chmod 755 getData.sh

3. Start the engines

If steps 1 and 2 were successful, then you should see already data of your Raspberry Pi on your widget on the desktop. Enjoy :) Now you can change the position of the widget in the index.coffee file:

# Position of the widget on your screen\
pos_top		= '180px'\
pos_left	= '330px'

The "Raspberry Pi" and the Raspberry logo are registered trademark(s) of the Raspberry Pi Foundation: https://www.raspberrypi.org/

© 2020 | Johannes Hubig