aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-04-03 14:20:49 +0300
committerYaroslav <contact@yaroslavps.com>2020-04-03 14:20:49 +0300
commit55e3173602454f55c1306ad6bc4953f5d3a376a8 (patch)
treeeded8c768d83b185623a2f78a462982a20ef61ff /dotfiles
parent47157939845ddbc94eb3a179ac20285e6f270529 (diff)
downloadswayrice-55e3173602454f55c1306ad6bc4953f5d3a376a8.tar.gz
swayrice-55e3173602454f55c1306ad6bc4953f5d3a376a8.zip
display more useful things
Diffstat (limited to 'dotfiles')
-rwxr-xr-xdotfiles/.local/bin/notistats15
1 files changed, 10 insertions, 5 deletions
diff --git a/dotfiles/.local/bin/notistats b/dotfiles/.local/bin/notistats
index 0da5b7b..76221ef 100755
--- a/dotfiles/.local/bin/notistats
+++ b/dotfiles/.local/bin/notistats
@@ -1,10 +1,15 @@
#!/bin/sh
-body=$(echo -e "Screen brightness:\t$(xbacklight -get)";
-lscpu | grep 'CPU MHz';
+body=$(df -h / | tail -1 | awk '{print "Free space on /:\t" $4}';
+free -m | sed '2!d' | awk '{print "Memory in use:\t" $3"/"$2"MB"}';
+lscpu | grep 'CPU MHz' | awk '{print "CPU clock:\t" $3"MHz"}';
sensors | grep 'Package id 0' | sed 's/Package id 0/CPU temp/' | awk '{print $1 $2 "\t" $3}';
-sensors | grep 'fan';
-echo print\(\'BAT0 drainage:\\t{}W\'.format\($(grep 'POWER_SUPPLY_POWER_NOW' /sys/class/power_supply/BAT0/uevent | awk -F '=' '{print $2}')/1000000\)\) | python;
-echo print\(\'BAT1 drainage:\\t{}W\'.format\($(grep 'POWER_SUPPLY_POWER_NOW' /sys/class/power_supply/BAT1/uevent | awk -F '=' '{print $2}')/1000000\)\) | python)
+sensors | grep 'fan')
+if [ -f /sys/class/power_supply/BAT0/uevent ]; then
+ body=$body:$(echo print\(\'BAT0 drainage:\\t{}W\'.format\($(grep 'POWER_SUPPLY_POWER_NOW' /sys/class/power_supply/BAT0/uevent | awk -F '=' '{print $2}')/1000000\)\) | python)
+fi
+if [ -f /sys/class/power_supply/BAT1/uevent ]; then
+ body=$body:$(echo print\(\'BAT1 drainage:\\t{}W\'.format\($(grep 'POWER_SUPPLY_POWER_NOW' /sys/class/power_supply/BAT1/uevent | awk -F '=' '{print $2}')/1000000\)\) | python)
+fi
notify-send "Hardware status" "$body"