aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/syshealth
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/.local/bin/personal/syshealth')
-rwxr-xr-xscripts/.local/bin/personal/syshealth21
1 files changed, 5 insertions, 16 deletions
diff --git a/scripts/.local/bin/personal/syshealth b/scripts/.local/bin/personal/syshealth
index 5c7ebe5..6320056 100755
--- a/scripts/.local/bin/personal/syshealth
+++ b/scripts/.local/bin/personal/syshealth
@@ -5,8 +5,10 @@
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
export DISPLAY=":0"
+NOTIFIER="/usr/bin/notify-send -u critical "
+# NOTIFIER="/usr/local/bin/herbe "
+
acpi_report="$(acpi | grep -v unavailable | head -n 1)"
-sensors_report="$(sensors | grep "Package id 0:")"
# Battery charge check
local_percent="$(echo $acpi_report | awk '{print $4}')"
@@ -15,25 +17,12 @@ local_time="$(echo $acpi_report | awk '{print $5}')"
battery_message=("Warning:" "Battery VOLTAGE critical")
temperature_message=("Warning:" "Core TEMPERATURE critical")
+ $NOTIFIER "${battery_message[0]} ${battery_message[1]}" &
if ((${local_percent::-2} <= 15)); then
if [[ "${local_state::-1}" == "Discharging" ]]; then
- /usr/bin/notify-send -u critical " ${battery_message[0]} ${battery_message[1]}" &
- # espeak "${battery_message[0]}${battery_message[1]}"
- fi
-elif ((${local_percent::-2} >= 90)); then
- if [[ "${local_state::-1}" == "Charging" ]]; then
- /usr/bin/notify-send -u critical " ${battery_message[0]} ${battery_message[1]}" &
+ $NOTIFIER " ${battery_message[0]} ${battery_message[1]}" &
# espeak "${battery_message[0]}${battery_message[1]}"
fi
fi
-# Core temperature check
-local_temp="$(echo $sensors_report | awk '{print $4}' | sed 's/+//g')"
-local_temp_high="$(echo $sensors_report | awk '{print $7}' | sed 's/+//g')"
-
-if ((${local_temp::-4} >= 90)); then
- /usr/bin/notify-send -u critical " ${temperature_message[0]} ${temperature_message[1]}" &
- # espeak "${temperature_message[0]}${temperature_message[1]}"
-fi
-