aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-01-10 04:50:16 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-01-10 04:50:16 +0300
commit56378af36068d4f214299bc31c62d84928c921f5 (patch)
treeaf5dfdfae37080bfa1d3c3c90425a3a4a04d2ff0 /dotfiles/.local
parent42cc3419c70b2622cf37ab290a6293577a58eadc (diff)
downloadswayrice-56378af36068d4f214299bc31c62d84928c921f5.tar.gz
swayrice-56378af36068d4f214299bc31c62d84928c921f5.zip
notistats: GPU temp
Diffstat (limited to 'dotfiles/.local')
-rwxr-xr-xdotfiles/.local/bin/notistats7
1 files changed, 5 insertions, 2 deletions
diff --git a/dotfiles/.local/bin/notistats b/dotfiles/.local/bin/notistats
index 3d7c7ba..83e2f80 100755
--- a/dotfiles/.local/bin/notistats
+++ b/dotfiles/.local/bin/notistats
@@ -6,10 +6,13 @@ 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')
if [ -f /sys/class/power_supply/BAT0/uevent ]; then
- body=$(printf "%s\n%s" "$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)")
+ 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=$(printf "%s\n%s" "$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)")
+ 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"