Last active
November 11, 2015 06:20
-
-
Save cabrinha/58d08cead9d364d91dc2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PANEL_FIFO=/tmp/bar.fifo | |
| PRINTER='/Users/yuppie/devel/bar/bin/printer.js' | |
| NODE=/usr/local/bin/node | |
| [ -e $PANEL_FIFO ] && rm "$PANEL_FIFO" | |
| mkfifo $PANEL_FIFO | |
| # Run bar and keep reading from fifo | |
| #tail -n +1 -f $PANEL_FIFO | $NODE $PRINTER & | |
| cat $PANEL_FIFO | node $PRINTER & | |
| while :; do | |
| date=`date "+%d %b - %I:%M %p"` | |
| batt=`pmset -g batt | tail -n1 | awk '{print $2}' | sed s/\;//` | |
| echo "S$batt $date" > $PANEL_FIFO | |
| sleep 5 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment