Package: laptop-detect
Version: 0.16
Severity: wishlist
Tags: patch

In verbose mode it might be convenient to print the value and description
for chassis_type if found, even when the script determines that we're not
on a laptop.

--- /usr/bin/laptop-detect      2017-08-12 15:24:53.000000000 +0000
+++ /usr/bin/laptop-detect.new  2018-08-24 11:56:54.000000000 +0000
@@ -130,5 +130,37 @@
     fi
 fi
 
-$PRINTIT "We're not on a laptop (no relevant hint found)" >&2
+if [ -n "$chassis_type" ]; then
+    case "$chassis_type" in
+        # https://technet.microsoft.com/en-us/library/ee156537.aspx
+         1) chassis_description="Other";;
+         2) chassis_description="Unknown";;
+         3) chassis_description="Desktop";;
+         4) chassis_description="Low Profile Desktop";;
+         5) chassis_description="Pizza Box";;
+         6) chassis_description="Mini Tower";;
+         7) chassis_description="Tower";;
+         8) chassis_description="Portable";;
+         9) chassis_description="Laptop";;
+        10) chassis_description="Notebook";;
+        11) chassis_description="Hand Held";;
+        12) chassis_description="Docking Station";;
+        13) chassis_description="All in One";;
+        14) chassis_description="Sub Notebook";;
+        15) chassis_description="Space-Saving";;
+        16) chassis_description="Lunch Box";;
+        17) chassis_description="Main System Chassis";;
+        18) chassis_description="Expansion Chassis";;
+        19) chassis_description="Sub Chassis";;
+        20) chassis_description="Bus Expansion Chassis";;
+        21) chassis_description="Peripheral Chassis";;
+        22) chassis_description="Storage Chassis";;
+        23) chassis_description="Rack Mount Chassis";;
+        24) chassis_description="Sealed-Case PC";;
+         *) chassis_description="*UNKNOWN*";;
+    esac
+    $PRINTIT "We're not on a laptop (chassis_type is $chassis_type - 
$chassis_description)" >&2
+else
+    $PRINTIT "We're not on a laptop (no relevant hint found)" >&2
+fi
 $EXIT 1

-- 
Ole G.

Reply via email to