Created
April 30, 2016 19:40
-
-
Save plugnburn/d2664271b06dfe602ed06b0b99044bcd to your computer and use it in GitHub Desktop.
DClock: statusbar widget for DWM
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 | |
while true; do | |
loadAvg=$(cat /proc/loadavg | cut -d ' ' -f -4) | |
timeStr=$(date '+%a %b %d %H:%M:%S') | |
memAvail=$(grep -Po 'MemAvailable.*\d+' /proc/meminfo|cut -d ':' -f 2) | |
memTotal=$(grep -Po 'MemTotal.*\d+' /proc/meminfo|cut -d ':' -f 2) | |
memBusy=$(( $memTotal - $memAvail )) | |
xsetroot -name "RAM: $(( 100 * memBusy / memTotal ))% | CPU: $loadAvg | $timeStr" | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment