diff options
author | Julian T <julian@jtle.dk> | 2019-04-28 14:30:07 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2019-04-28 14:30:07 +0200 |
commit | 96bc496f36e479fd7db0dab017a2339a6051171f (patch) | |
tree | 3caf83a71179d98380b71844c30eb3fc3703314a | |
parent | e5b32832dcf52e7e991be0f23fc5ddb1adc78672 (diff) |
Added status scripts
-rw-r--r-- | dwm/Scripts/mic.sh | 19 | ||||
-rw-r--r-- | dwm/Scripts/net.sh | 19 | ||||
-rw-r--r-- | dwm/Scripts/ram.sh | 19 | ||||
-rw-r--r-- | dwm/Scripts/status.sh | 20 |
4 files changed, 77 insertions, 0 deletions
diff --git a/dwm/Scripts/mic.sh b/dwm/Scripts/mic.sh new file mode 100644 index 0000000..78afaa8 --- /dev/null +++ b/dwm/Scripts/mic.sh @@ -0,0 +1,19 @@ +PIDFILE=/tmp/statMic.pid +STATUSFILE=/tmp/dsbAMic + +kill `cat $PIDFILE` +if [ $? -eq 0 ]; then + echo "Shutting down" + rm $STATUSFILE + exit +fi + +echo $$ > $PIDFILE + +while true; do + + MIC=$(amixer get Capture | grep "Front Left:" | sed 's/.*\[\(.*\)\].*/\1/') + + echo "$MIC " > $STATUSFILE + sleep 1 +done diff --git a/dwm/Scripts/net.sh b/dwm/Scripts/net.sh new file mode 100644 index 0000000..d443091 --- /dev/null +++ b/dwm/Scripts/net.sh @@ -0,0 +1,19 @@ +PIDFILE=/tmp/statNet.pid +STATUSFILE=/tmp/dsbANet + +kill `cat $PIDFILE` +if [ $? -eq 0 ]; then + echo "Shutting down" + rm $STATUSFILE + exit +fi + +echo $$ > $PIDFILE + +while true; do + + IP=$( ip -4 a | grep "inet " | sed "s:inet \(.*\)/.*:\1:" | tr -d " " | grep -v "0.1" | tr "\n" " ") + + echo "$IP " > $STATUSFILE + sleep 10 +done diff --git a/dwm/Scripts/ram.sh b/dwm/Scripts/ram.sh new file mode 100644 index 0000000..b0c2442 --- /dev/null +++ b/dwm/Scripts/ram.sh @@ -0,0 +1,19 @@ +PIDFILE=/tmp/statRam.pid +STATUSFILE=/tmp/dsbRfree + +kill `cat $PIDFILE` +if [ $? -eq 0 ]; then + echo "Shutting down" + rm $STATUSFILE + exit +fi + +echo "Starting up" + +echo $$ > $PIDFILE + +while true; do + echo " $(free -h | grep Mem: | awk '{print $3}') " > $STATUSFILE + sleep 2 +done + diff --git a/dwm/Scripts/status.sh b/dwm/Scripts/status.sh new file mode 100644 index 0000000..3d1eba4 --- /dev/null +++ b/dwm/Scripts/status.sh @@ -0,0 +1,20 @@ +PIDFILE=/tmp/stat.pid +STATUSFILE=/tmp/dsbMain + +kill `cat $PIDFILE` +if [ $? -eq 0 ]; then + echo "Shutting down" + rm $STATUSFILE + exit +fi + +echo $$ > $PIDFILE + +while true; do + + BATT=$( acpi -b | sed 's/.*[charging|unknown], \([0-9]*\)%.*/\1/gi' ) + TIME=$(/bin/date +"%H:%M") + + echo "$IP $TIME $BATT%" > $STATUSFILE + sleep 10 +done |