From 4b981fcaa5684db40b1d15d88b1308234c9604c5 Mon Sep 17 00:00:00 2001 From: SharkPlush <86890204+SharkPlush@users.noreply.github.com> Date: Sun, 5 Jul 2026 22:47:46 +0000 Subject: [PATCH] Update 10-welcome --- usr/lib/tik/modules/pre/10-welcome | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/usr/lib/tik/modules/pre/10-welcome b/usr/lib/tik/modules/pre/10-welcome index 568a857..98e767e 100644 --- a/usr/lib/tik/modules/pre/10-welcome +++ b/usr/lib/tik/modules/pre/10-welcome @@ -13,25 +13,8 @@ displayACWarningMsg() { } checkLaptop() { - chassis=$(cat /sys/class/dmi/id/chassis_type) - # Test for respectively Handheld, Notebook, Laptop, and Portable - # If chassis variable matches 8 9 10 or 11 function continues else it proceeds to test AC power and Battery - [[ "$chassis" =~ ^(8|9|10|11)$ ]] || return - # Tested machine is confirmed mobile - givePowerRecommendation=false - # Only check for AC and Battery power connections with upower - updevices=$(/usr/bin/upower -e | grep -E 'AC|BAT') - for pdev in $updevices; do - # Get detailed info for each AC and BAT device in upower - upinfo=$(/usr/bin/upower -i "$pdev" | grep -E 'online|state') - # Check for discharging state or AC power offline which is equal to no state - if [[ "$upinfo" =~ (discharging|no) ]]; then - # Give power recommendation only once, so set this to true - givePowerRecommendation=true - fi - done - if [ "$givePowerRecommendation" = true ]; then - log "[welcome] AC Power disconnected and Battery is not charging" + if ! systemd-ac-power; then + log "[welcome] AC Power disconnected and battery is not charging" displayACWarningMsg fi }