aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/notistats
blob: cd5027657d72129e48a3fdb94664fe2dab8c760b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

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 'Core 0' | sed 's/Core 0/CPU temp/' | awk '{print $1 $2 "\t" $3}';
sensors | grep 'fan')
if [ -f /sys/class/power_supply/BAT0/uevent ]; then
  body=$body"\n"$(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"\n"$(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
if [ -f /sys/class/drm/card0/device/hwmon/hwmon1/temp1_input ]; then
	body=$body"\n"$(echo print\(\'GPU temp:\\t{}C\'.format\($(cat /sys/class/drm/card0/device/hwmon/hwmon1/temp1_input)/1000\)\) | python)
fi

notify-send "Hardware status" "$body"