diff --git a/usr/lib/tik/modules/pre/10-welcome b/usr/lib/tik/modules/pre/10-welcome index 4d35b80..d1b93a6 100644 --- a/usr/lib/tik/modules/pre/10-welcome +++ b/usr/lib/tik/modules/pre/10-welcome @@ -12,27 +12,15 @@ 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 '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 + [[ $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" displayACWarningMsg - fi + fi } verify_efi() {