From 48b8cfaf2a851780a1552c4bc9f4473e6c38eea2 Mon Sep 17 00:00:00 2001 From: SharkPlush <86890204+SharkPlush@users.noreply.github.com> Date: Wed, 26 Nov 2025 20:27:11 +0200 Subject: [PATCH 1/4] Update 10-welcome --- usr/lib/tik/modules/pre/10-welcome | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/lib/tik/modules/pre/10-welcome b/usr/lib/tik/modules/pre/10-welcome index 4d35b80..1aefc1a 100644 --- a/usr/lib/tik/modules/pre/10-welcome +++ b/usr/lib/tik/modules/pre/10-welcome @@ -19,7 +19,7 @@ checkLaptop() { #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'` + updevices=`/usr/bin/upower -e|grep -E 'line_power|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'` From 8814de6ef4e2078d4a4f91ac2ac2ab9b75d82442 Mon Sep 17 00:00:00 2001 From: SharkPlush <86890204+SharkPlush@users.noreply.github.com> Date: Wed, 26 Nov 2025 21:42:20 +0200 Subject: [PATCH 2/4] Update 10-welcome --- usr/lib/tik/modules/pre/10-welcome | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/usr/lib/tik/modules/pre/10-welcome b/usr/lib/tik/modules/pre/10-welcome index 1aefc1a..0d1d678 100644 --- a/usr/lib/tik/modules/pre/10-welcome +++ b/usr/lib/tik/modules/pre/10-welcome @@ -12,27 +12,17 @@ displayACWarningMsg() { } checkLaptop() { - chassis=`cat /sys/class/dmi/id/chassis_type` #Test for respectively Handheld, Notebook, Laptop, and Portable + chassis=`cat /sys/class/dmi/id/chassis_type` #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 'line_power|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 + [[ "$chassis" =~ ^(8|9|10|11)$ ]] || return + #Only check for Battery status with upower + updevices=`/usr/bin/upower -e|grep -E 'DisplayDevice'` + if [[ `/usr/bin/upower -i $updevices|awk '/state:/ {print $2}'` == discharging ]]; then + #if we are discharging show AC warning log "AC Power disconnected and Battery is not charging" displayACWarningMsg - fi + fi } verify_efi() { From b8c3d106ac21c568c83c2b773dae03106fe6b928 Mon Sep 17 00:00:00 2001 From: SharkPlush <86890204+SharkPlush@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:59:20 +0200 Subject: [PATCH 3/4] Update 10-welcome --- usr/lib/tik/modules/pre/10-welcome | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr/lib/tik/modules/pre/10-welcome b/usr/lib/tik/modules/pre/10-welcome index 0d1d678..4bfe570 100644 --- a/usr/lib/tik/modules/pre/10-welcome +++ b/usr/lib/tik/modules/pre/10-welcome @@ -15,10 +15,8 @@ checkLaptop() { #Test for respectively Handheld, Notebook, Laptop, and Portable chassis=`cat /sys/class/dmi/id/chassis_type` #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 - #Only check for Battery status with upower - updevices=`/usr/bin/upower -e|grep -E 'DisplayDevice'` - if [[ `/usr/bin/upower -i $updevices|awk '/state:/ {print $2}'` == discharging ]]; then + [[ "$(< /sys/class/dmi/id/chassis_type)" =~ ^(8|9|10|11)$ ]] || return + if [[ `systemd-ac-power -v` == "no" ]]; then #if we are discharging show AC warning log "AC Power disconnected and Battery is not charging" displayACWarningMsg From 6b2ff9142460cde69444e0ee7162d6d6bb8f2ece Mon Sep 17 00:00:00 2001 From: SharkPlush <86890204+SharkPlush@users.noreply.github.com> Date: Mon, 1 Dec 2025 14:04:44 +0200 Subject: [PATCH 4/4] Correct chassis type variable usage in checkLaptop Fix chassis type check in checkLaptop function --- usr/lib/tik/modules/pre/10-welcome | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/lib/tik/modules/pre/10-welcome b/usr/lib/tik/modules/pre/10-welcome index 4bfe570..d1b93a6 100644 --- a/usr/lib/tik/modules/pre/10-welcome +++ b/usr/lib/tik/modules/pre/10-welcome @@ -15,7 +15,7 @@ checkLaptop() { #Test for respectively Handheld, Notebook, Laptop, and Portable chassis=`cat /sys/class/dmi/id/chassis_type` #if chassis variable matches 8 9 10 or 11 function continues else it proceeds to test AC power and Battery - [[ "$(< /sys/class/dmi/id/chassis_type)" =~ ^(8|9|10|11)$ ]] || return + [[ $chassis =~ ^(8|9|10|11)$ ]] || return if [[ `systemd-ac-power -v` == "no" ]]; then #if we are discharging show AC warning log "AC Power disconnected and Battery is not charging"