diff options
author | Sebastian Reichel <sre@ring0.de> | 2015-12-06 12:03:53 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2015-12-06 12:03:53 +0100 |
commit | a68ee4c5ec5bd12b42d26a46cb1d592ff00dea8d (patch) | |
tree | a9c512e1055eccbcc5aa63e3e9223931a68ce588 | |
parent | 78d71e916b8df3957f00aac07467419d04ae0910 (diff) | |
download | openbox-config-a68ee4c5ec5bd12b42d26a46cb1d592ff00dea8d.tar.bz2 |
pipemenu for space status
-rwxr-xr-x | menu-space-status | 22 | ||||
-rw-r--r-- | menu.xml | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/menu-space-status b/menu-space-status new file mode 100755 index 0000000..38dfa81 --- /dev/null +++ b/menu-space-status @@ -0,0 +1,22 @@ +#!/bin/sh +IFS=" +" +APIDATA=$(curl -s "http://status.mainframe.io/api/spaceInfo") +NAME=$(echo $APIDATA | jq -r '.space' -) +OPEN=$(echo $APIDATA | jq '.state.open' -) +MSG=$(echo $APIDATA | jq -r '.state.message' -) +PEOPLE=$(echo $APIDATA | jq -r '.sensors.people_now_present[0].names[]' -) +ENERGY=$(echo $APIDATA | jq '.sensors.power_consumption[0].value' -) + +echo '<openbox_pipe_menu>' +echo ' <separator label="'$NAME'" />' +echo ' <item label="State: '$MSG'" />' +echo ' <item label="Energy: '$ENERGY' Watt" />' +echo ' <menu id="space-people" label="People">' + +for person in ${PEOPLE}; do +echo ' <item label="'$person'" />' +done + +echo ' </menu>' +echo '</openbox_pipe_menu>' @@ -13,6 +13,7 @@ <item label="Web browser" icon="/usr/share/icons/Tango/16x16/apps/internet-web-browser.png"> <action name="Execute"><execute>x-www-browser</execute></action> </item> + <menu id="space-status" label="Hackspace Status" execute="~/.config/openbox/menu-space-status" /> <!-- This requires the presence of the 'menu' package to work --> <menu id="/Debian" icon="/usr/share/pixmaps/debian-logo.png" /> <separator /> |