<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://wever.org/java/rdf'>
    <s:Snip rdf:about='http://wever.org/java/rdf#linux/Fujitsu-Siemens+Lifebook+E8020'
         s:cUser='michaelwever'
         s:oUser=''
         s:mUser='michaelwever'>
        <s:name>linux/Fujitsu-Siemens Lifebook E8020</s:name>
        <s:content>\\&#xD;&#xA;Work laptop from Schibsted S?k AS.\\&#xD;&#xA;Running Gentoo GNU/Linux.\\&#xD;&#xA;\\&#xD;&#xA;Was remarkably easy to install. Thanks to good linux competence from work peers with the same model!\\&#xD;&#xA;Centrino wireless adaptor uses ipw2200, with fantastic connectivity.\\&#xD;&#xA;Using ATI prop. drivers to run &quot;Big Desktop&quot; when in the office.\\&#xD;&#xA;\\&#xD;&#xA;Power management is followed almost to the word from http://www.gentoo.org/doc/en/power-management-guide.xml , an *excellent* guide from Dennis Nienh?ser. Except I have four runlevels instead of just the two: &#xD;&#xA;   - default (battery, no network)&#xD;&#xA;   - batterynetwork (battery, network)&#xD;&#xA;   - power (power, no network)&#xD;&#xA;   - powernetwork (power, network)&#xD;&#xA;\\&#xD;&#xA;So my /etc/acpi/actions/pmg_switch_runlevel.sh instead looks like:&#xD;&#xA;{code}&#xD;&#xA;#!/bin/bash&#xD;&#xA;&#xD;&#xA;# BEGIN configuration&#xD;&#xA;RUNLEVEL_AC=&quot;power&quot;&#xD;&#xA;RUNLEVEL_AC_ONLINE=&quot;powernetwork&quot;&#xD;&#xA;RUNLEVEL_BATTERY=&quot;default&quot;&#xD;&#xA;RUNLEVEL_BATTERY_ONLINE=&quot;batterynetwork&quot;&#xD;&#xA;# END configuration&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;# Pre-conditions:&#xD;&#xA;#  - all runlevels exist&#xD;&#xA;#&#xD;&#xA;&#xD;&#xA;if [ ! -d &quot;/etc/runlevels/${RUNLEVEL_AC}&quot; ]&#xD;&#xA;then&#xD;&#xA;        logger &quot;${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting.&quot;&#xD;&#xA;        exit 1&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;if [ ! -d &quot;/etc/runlevels/${RUNLEVEL_AC_ONLINE}&quot; ]&#xD;&#xA;then&#xD;&#xA;        logger &quot;${0}: Runlevel ${RUNLEVEL_AC_ONLINE} does not exist. Aborting.&quot;&#xD;&#xA;        exit 1&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;if [ ! -d &quot;/etc/runlevels/${RUNLEVEL_BATTERY}&quot; ]&#xD;&#xA;then&#xD;&#xA;        logger &quot;${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting.&quot;&#xD;&#xA;        exit 1&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;if [ ! -d &quot;/etc/runlevels/${RUNLEVEL_BATTERY_ONLINE}&quot; ]&#xD;&#xA;then&#xD;&#xA;        logger &quot;${0}: Runlevel ${RUNLEVEL_BATTERY_ONLINE} does not exist. Aborting.&quot;&#xD;&#xA;        exit 1&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;logger &quot;Checking power and network status against current runlevel&quot;&#xD;&#xA;&#xD;&#xA;if on_ac_power&#xD;&#xA;  then&#xD;&#xA;&#xD;&#xA;  # Power plugged in.&#xD;&#xA;  if ifconfig | grep -A 2 eth | grep --silent &quot;inet addr&quot; ; then&#xD;&#xA;&#xD;&#xA;    # Power plugged in. Network connected. --&gt; RUNLEVEL_AC_ONLINE&#xD;&#xA;    if [[ &quot;$(cat /var/lib/init.d/softlevel)&quot; != &quot;${RUNLEVEL_AC_ONLINE}&quot; ]]&#xD;&#xA;        then&#xD;&#xA;        logger &quot;Switching to ${RUNLEVEL_AC_ONLINE} runlevel&quot;&#xD;&#xA;        /sbin/rc ${RUNLEVEL_AC_ONLINE}&#xD;&#xA;    fi&#xD;&#xA;&#xD;&#xA;  else&#xD;&#xA;&#xD;&#xA;    # Power plugged in. No network. --&gt; RUNLEVEL_AC&#xD;&#xA;    if [[ &quot;$(cat /var/lib/init.d/softlevel)&quot; != &quot;${RUNLEVEL_AC}&quot; ]]&#xD;&#xA;        then&#xD;&#xA;        logger &quot;Switching to ${RUNLEVEL_AC} runlevel&quot;&#xD;&#xA;        /sbin/rc ${RUNLEVEL_AC}&#xD;&#xA;    fi&#xD;&#xA;&#xD;&#xA;  fi&#xD;&#xA;&#xD;&#xA;else&#xD;&#xA;&#xD;&#xA;  # Running on battery.&#xD;&#xA;  if ifconfig | grep -A 2 eth | grep --silent &quot;inet addr&quot; ; then&#xD;&#xA;&#xD;&#xA;    # Running on battery. Network connected. --&gt; RUNLEVEL_BATTERY_ONLINE&#xD;&#xA;    if [[ &quot;$(cat /var/lib/init.d/softlevel)&quot; != &quot;${RUNLEVEL_BATTERY_ONLINE}&quot; ]]&#xD;&#xA;        then&#xD;&#xA;        logger &quot;Switching to ${RUNLEVEL_BATTERY_ONLINE} runlevel&quot;&#xD;&#xA;        /sbin/rc ${RUNLEVEL_BATTERY_ONLINE}&#xD;&#xA;    fi&#xD;&#xA;&#xD;&#xA;  else&#xD;&#xA;&#xD;&#xA;    # Running on battery. No network. --&gt; RUNLEVEL_BATTERY&#xD;&#xA;    if [[ &quot;$(cat /var/lib/init.d/softlevel)&quot; != &quot;${RUNLEVEL_BATTERY}&quot; ]]&#xD;&#xA;        then&#xD;&#xA;        logger &quot;Switching to ${RUNLEVEL_BATTERY} runlevel&quot;&#xD;&#xA;        /sbin/rc ${RUNLEVEL_BATTERY}&#xD;&#xA;    fi&#xD;&#xA;&#xD;&#xA;  fi&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;This gives me even finer control on my services, instead of just letting them fail. Especially since I&apos;ve found there&apos;s a bigger difference in which services are running between network and no-network then there is between power and battery! This approach saves alot of time at startup.</s:content>
        <s:mTime>2006-02-09 03:53:51.0</s:mTime>
        <s:cTime>2006-02-09 03:51:51.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#Linux'/>
                <rdf:li rdf:resource='http://wever.org/java/rdf#java/Why Eclipse is not opensource'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#java'/>
                <rdf:li rdf:resource='http://wever.org/java/rdf#linux/AMD Athlon XP/DWL-G122 and ndiswrapper'/>
                <rdf:li rdf:resource='#snipsnap-notfound'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
