diff --git a/00opensensemap.r.3m.sh b/00opensensemap.r.3m.sh new file mode 100755 index 0000000..50d4fd6 --- /dev/null +++ b/00opensensemap.r.3m.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# export OSEM_BOX=yourboxid +BOX=${OSEM_BOX:-5b26181b1fef04001b69093c} +API="https://api.opensensemap.org" + +boxMeta=`curl "${API}/boxes/${BOX}"` +sensors=`curl "${API}/boxes/${BOX}/sensors"` +updated=`echo $boxMeta | jq -r '.lastMeasurementAt'` +weblink=`echo $boxMeta | jq -r '.weblink'` + +echo $boxMeta | jq -r '.name' + +echo "---" +echo $sensors | jq -r '.sensors[] | .title + ": " + .lastMeasurement.value + " " + .unit' + +echo "---" +echo "last measurement from `date -d $updated +'%d.%m. %H:%M'`" +echo "refresh | refresh=true" + +echo "---" +echo "view on openSenseMap.org | href='https://opensensemap.org/explore/$BOX'" +[ ! $weblink == "null" ] && echo "open weblink | href='$weblink'" + diff --git a/README.md b/README.md index aa5b793..03ce8c9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,27 @@ -# osem_gnome_dash +# opensensemap.org box dashboard for Gnome -openSenseMap dashboard for gnome shell \ No newline at end of file +Small dashboard displaying live sensor readings of senseBoxes on [opensensemap.org][osem] in your Gnome Shell top bar. + +![screenshot](screenshot.png) + +## installation + +1. Install [argos][argos] and [jq][jq] + +2. run the following command to install the current version: + ```sh + scriptsrc="https://git.nroo.de/opensensemap/osem_gnome_dash/raw/branch/master/00opensensemap.r.3m.sh" + curl $scriptsrc > ~/.config/argos/00opensensemap.r.3m.sh + ``` + You can change the filename to change the refresh rate and display position + +3. Open `~/.config/argos/00opensensemap.r.3m.sh` and insert your favourite box ID. + Alternatively you can export it as `OSEM_BOX` in your bashrc (untested) + +[osem]: https://opensensemap.org +[argos]: https://github.com/p-e-w/argos +[jq]: https://stedolan.github.io/jq/ + +## license +Unlicense / Public Domain. +Still it would be nice if you'd let me know of enhancements you made! diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..bb9cbc2 Binary files /dev/null and b/screenshot.png differ