Skip to content

Instantly share code, notes, and snippets.

@lattera
Created August 28, 2015 18:33
Show Gist options
  • Save lattera/e20f2e2e991df3594f02 to your computer and use it in GitHub Desktop.
Save lattera/e20f2e2e991df3594f02 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/zsh
echo '{ "version": 1 }'
echo '['
echo '[]'
while true; do
cat <<EOF
,[
{
"name": "battery",
"full_text": "Battery: $(sysctl -n hw.acpi.battery.life)"
},
{
"name": "volume",
"full_text": "Volume: $(mixer -s vol | awk '{print $2;}')"
},
{
"name": "date",
"full_text": "$(date '+%A, %d %b %Y')"
},
{
"name": "time",
"full_text": "$(date '+%T')"
}
]
EOF
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment