laptop-detect-0.13.7ubuntu2/0000755000000000000000000000000011104204754012560 5ustar laptop-detect-0.13.7ubuntu2/debian/0000755000000000000000000000000011344445317014012 5ustar laptop-detect-0.13.7ubuntu2/debian/compat0000644000000000000000000000000211104204753015177 0ustar 5 laptop-detect-0.13.7ubuntu2/debian/install0000644000000000000000000000003011104204753015363 0ustar laptop-detect usr/sbin/ laptop-detect-0.13.7ubuntu2/debian/copyright0000644000000000000000000000042511104204753015735 0ustar Upstream Author: Thom May Copyright 2004-2007 Thom May Copyright 2006-2008 Otavio Salvador This software is licensed under the BSD license. For further information please see /usr/share/common-licenses/BSD. laptop-detect-0.13.7ubuntu2/debian/rules0000755000000000000000000000046211104204753015063 0ustar #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk VERSION=$(shell dpkg-parsechangelog \ | grep Version: \ | sed 's,^Version: \(.*\),\1,g') install/laptop-detect:: sed -e "s/@VERSION@/${VERSION}/g" < laptop-detect.in > laptop-detect clean:: rm -f laptop-detect laptop-detect-0.13.7ubuntu2/debian/control0000644000000000000000000000120211104204753015377 0ustar Source: laptop-detect Section: utils Priority: optional Maintainer: Ubuntu Core Developers XSBC-Original-Maintainer: Otavio Salvador Build-Depends: cdbs, debhelper (>= 5) Standards-Version: 3.7.3 VCS-Git: git://git.debian.org/git/collab-maint/laptop-detect.git VCS-Browser: http://git.debian.org/?p=collab-maint/laptop-detect.git Package: laptop-detect Architecture: any Depends: dmidecode (>> 2.8-2) [amd64 i386 lpia] Description: attempt to detect a laptop laptop-detect attempts to determine whether it is being run on a laptop or a desktop and appraises its caller of this. laptop-detect-0.13.7ubuntu2/debian/manpages0000644000000000000000000000002011104204753015507 0ustar laptop-detect.8 laptop-detect-0.13.7ubuntu2/debian/dirs0000644000000000000000000000001111104204753014655 0ustar usr/sbin laptop-detect-0.13.7ubuntu2/debian/changelog0000644000000000000000000001372211344445317015671 0ustar laptop-detect (0.13.7ubuntu2) lucid; urgency=low * rebuild rest of main for armel armv7/thumb2 optimization; UbuntuSpec:mobile-lucid-arm-gcc-v7-thumb2 -- Alexander Sack Sat, 06 Mar 2010 13:30:07 +0100 laptop-detect (0.13.7ubuntu1) jaunty; urgency=low * Merge from debian unstable, remaining changes: - lpia has dmidecode as well, update debian/control to reflect that -- Michael Vogt Mon, 10 Nov 2008 13:35:33 +0100 laptop-detect (0.13.7) unstable; urgency=low * Fix package description. Closes: #493707 -- Otavio Salvador Mon, 04 Aug 2008 09:44:09 -0300 laptop-detect (0.13.6ubuntu1) intrepid; urgency=low * Merge from debian unstable (LP: #229596), remaining changes: - lpia has dmidecode as well, update debian/control to reflect that -- Tormod Volden Mon, 12 May 2008 17:12:34 +0200 laptop-detect (0.13.6) unstable; urgency=low * Add copyright information at debian/copyright * Change package priority to optional. Closes: #478210 -- Otavio Salvador Mon, 28 Apr 2008 12:51:48 -0300 laptop-detect (0.13.5) unstable; urgency=low [ Joey Hess ] * Support the /sys power interface in 2.6.24. Closes: #463662 -- Otavio Salvador Sun, 03 Feb 2008 16:21:37 -0200 laptop-detect (0.13.4) unstable; urgency=low * Bump standards-version to 3.7.3 (no changes required) * Replace XS-VCS-* fields with the now supported VCS-* ones -- Otavio Salvador Sun, 16 Dec 2007 19:28:05 -0200 laptop-detect (0.13.3) unstable; urgency=low [ Thom May ] * Remove myself from Maintainers/Uploaders [ Otavio Salvador ] * Applied patch from Sven Joachim to hide modprobe error messages. Closes: #438093 -- Otavio Salvador Sun, 16 Dec 2007 19:00:57 -0200 laptop-detect (0.13.2ubuntu1) gutsy; urgency=low * lpia has dmidecode as well, update debian/control to reflect that -- Adam Conrad Tue, 31 Jul 2007 15:19:26 +1000 laptop-detect (0.13.2) unstable; urgency=low [ Otavio Salvador ] * Drop the hack used during the package building and use dependencies architeture specific handling for it. * Add versioned dependency to dmidecode 2.8-2 since we use chassis-type. * Add XS-VCS-{Git,Browser} fields. [ Tormod Volden ] * laptop-detect.in: Load battery module before probing for acpi batteries. Closes: #432407 -- Otavio Salvador Tue, 17 Jul 2007 00:22:13 -0300 laptop-detect (0.13.1) unstable; urgency=low * Change package priority to important to match override. * Revert conversion to architecture independent package since dpkg lacks support to handle architecture specific dependencies, execept for the building ones. -- Otavio Salvador Sat, 26 May 2007 10:27:47 -0300 laptop-detect (0.13) unstable; urgency=low * Merge changes done by Joey Hess: Closes: #412775 - Merge changes from Ubuntu: . Check that '/dev/mem' is readable before running 'dmidecode' . Add support for looking for an APM battery Closes: #314874 - Current standards-version. - Use debhelper's udeb support. * Simplifie dmidecode checking code. Thanks to "Steinar H. Gunderson" by the suggestion. Closes: #381957 * Apply patch from Sven Mueller to add verbosing options and usage help. Closes: #382119 * Repack to remove {arch} files. Closes: #382112 * Add a man page contributed by "Franklin PIAT" . Closes: #396637 * Convert to arch all. Closes: #355727 * Convert to use CDBS for package building -- Otavio Salvador Fri, 25 May 2007 10:17:12 -0300 laptop-detect (0.12.1) unstable; urgency=low * First upload to Debian. Add Otavio Salvador as an Uploader. -- Thom May Tue, 14 Jun 2005 11:38:10 +0100 laptop-detect (0.12) breezy; urgency=low * Fix argument positioning warning with new findutils. -- Colin Watson Fri, 10 Jun 2005 18:35:13 +0100 laptop-detect (0.11) hoary; urgency=low * be silent! (Ubuntu: #7771) NOTE: This means that we no longer print "We are a laptop"; apps depending on this shouldn't ever have been, and should be checking the return code. -- Thom May Thu, 17 Mar 2005 16:23:41 +0000 laptop-detect (0.10) hoary; urgency=low * Test for the presence of dmidecode (Ubuntu: #5608) -- Thom May Tue, 18 Jan 2005 22:08:08 +0000 laptop-detect (0.9) warty; urgency=low * Quote arguments to test correctly (Closes: Warty #2294) -- Thom May Thu, 14 Oct 2004 13:56:56 +0100 laptop-detect (0.8) warty; urgency=low * Check for /proc/acpi/battery before trying to find in it (Warty #1249) -- Thom May Mon, 20 Sep 2004 11:34:02 +0100 laptop-detect (0.7) warty; urgency=low * Increase script's robustness (Closes Warty #1132) -- Thom May Fri, 10 Sep 2004 21:00:04 +0100 laptop-detect (0.6) warty; urgency=low * Remove debugging output and add another seen in the wild chassis type -- Thom May Wed, 18 Aug 2004 17:42:02 +0100 laptop-detect (0.5) warty; urgency=low * fix dependencies for the udeb -- Thom May Wed, 18 Aug 2004 11:29:51 +0100 laptop-detect (0.4) warty; urgency=low * Add udeb -- Thom May Mon, 16 Aug 2004 16:01:20 +0100 laptop-detect (0.3) warty; urgency=low * Remove set -x. D'oh -- Thom May Thu, 12 Aug 2004 14:35:48 +0100 laptop-detect (0.2) warty; urgency=low * ensure dmidecode is pulled in on i386 and amd64 only, change to arch any -- Thom May Wed, 11 Aug 2004 20:33:27 +0100 laptop-detect (0.1) warty; urgency=low * First release -- Thom May Wed, 11 Aug 2004 18:40:55 +0100 laptop-detect-0.13.7ubuntu2/laptop-detect.in0000644000000000000000000000503711104204753015661 0ustar #!/bin/sh -e usage () { echo "Usage: $0 [-h|--help|-v|--verbose]" echo "" echo " -h | --help print this help" echo " -v | --verbose be verbose (messages go to STDOUT)" echo " -V | --version print version information" echo "" echo " Possible return values:" echo " 0 most likely running on a laptop" echo " 1 most likely NOT running on a laptop" echo " 2 called with unknown option, -h, --help, -V or --version" } PRINTIT="/bin/true" # /bin/true accepts any option but never prints anything # Check wether we were asked to be verbose if [ "$1" != "" ]; then case "$1" in "-v"|"--verbose") PRINTIT="echo" ;; "-V"|"--version") echo "Version: @VERSION@" exit 2 ;; "-h"|"--help") usage exit 2 ;; *) echo "UNKNOWN OPTION: $1" usage exit 2 ;; esac fi # Are we a mac? if test -d /proc/pmu; then batteries=$(grep Battery /proc/pmu/info | cut -f2 -d:) if test "$batteries" -ne 0; then $PRINTIT "We're a laptop (Mac: batteries found)" >&2; exit 0 fi exit 1 fi if [ -r /dev/mem -a -x /usr/sbin/dmidecode ]; then # dmidecode to grab the Chassis type dmitype=$(dmidecode --string chassis-type) if test "$dmitype" = "Notebook" || test "$dmitype" = "Portable"; then $PRINTIT "We're a laptop (dmidecode returned $dmitype)" >&2 exit 0 fi # turn back on for debugging #echo "$dmitype" fi # check for any ACPI batteries /sbin/modprobe battery 2> /dev/null || true if [ -d /sys/class/power_supply ]; then if grep -q Battery /sys/class/power_supply/*/type 2>/dev/null; then $PRINTIT "We're a laptop (ACPI batteries found)" >&2 exit 0 fi fi # old interface: if [ -d /proc/acpi/battery ]; then results=`find /proc/acpi/battery -mindepth 1 -type d` if [ ! -z "$results" ]; then $PRINTIT "We're a laptop (ACPI batteries found)" >&2 exit 0 fi fi # check for APM batteries. This sucks, because we'll only get a valid response # if the laptop has a battery fitted at the time if [ -f /proc/apm ]; then battery=`awk '{print $6}' &2 exit 0 fi fi $PRINTIT "We're not on a laptop (no relevant hint found)" >&2 exit 1 laptop-detect-0.13.7ubuntu2/laptop-detect.80000644000000000000000000000244311104204753015420 0ustar .\" '\" t .\" ** The above line should force tbl to be a preprocessor ** .\" Man page for man .\" .\" Copyright (C), 2006, Franklin PIAT .\" .\" This manpage is licensed under the BSD license. For further .\" information see the copying that comes with the laptop-detect .\" distribution. .\" .\" .\" Wed Nov 1 16:43:02 CET 2006 Franklin PIAT (fpiat@bigfoot.com) .\" .\" .pc .TH "laptop-detect" "8" "0.12" "Franklin PIAT" "System administration commands" .SH "NAME" .LP laptop\-detect \- attempt to detect a laptop .SH "SYNOPSIS" .LP laptop\-detect [\fI\-h\fR|\fI\-\-help\fR|\fI\-v\fR|\fI\-\-verbose\fR|\fI\-V\fR|\fI\-\-version\fR] .SH "DESCRIPTION" .LP Laptop\-detect attempts to determine whether it is being run on a laptop or a desktop and appraises its caller of this. .SH "OPTIONS" .LP .TP \fB\-h\fR \fB\-\-help\fR Output help information and exit. .TP \fB\-v\fR \fB\-\-verbose\fR be verbose (messages go to STDOUT) .TP \fB\-V\fR \fB\-\-version\fR Output version information and exit. .SH "EXIT STATUS" .br .nf \fB0\fR most likely running on a laptop \fB1\fR most likely NOT running on a laptop \fB2\fR usage error (arguments supplied) .SH "FILES" .LP \fI/proc/acpi/battery\fP .br \fI/proc/pmu/info\fP .SH "AUTHORS" .LP Franklin PIAT .SH "SEE ALSO" .LP dmidecode(8) laptop-detect-0.13.7ubuntu2/README0000644000000000000000000000020011104204753013427 0ustar Package to attempt to detect whether we're on a laptop, and then do the right thing. exits 0 if we're on a laptop, 1 otherwise.