/usr/lib/plainbox-providers-1/checkbox/bin/check_is_laptop is in plainbox-provider-checkbox 0.3-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #!/bin/bash
# Establish the system type based on DMI info
TYPE=$(dmidecode -t 3 | awk '/Type:/ { print $2 }')
echo "Type: " $TYPE
BATTERY="NO"
for device in `find /sys -name "type"`
do
if [ "$(cat $device)" == "Battery" ]; then
BATTERY="YES"
fi
done
echo "Battery: " $BATTERY
case $TYPE in
Notebook|Laptop|Portable)
exit 0
;;
*)
# Give the system a second chance based on the battery info
if [ $BATTERY == "YES" ]; then
exit 0
else
exit 1
fi
;;
esac
|