Re: suspend in fedora ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 19 March 2007 14:28:36 Valent Turkovic wrote:
> > Hi Valent, I wrote a small script in order to suspend my Thinkpad R50e.
> > It's not the same as your, that's obvious but you might be able to
> > customize it to your our requirements.
> > It uses /sys/power/state and stuff...
> > You want the whole script, just contact me :)
> > My 0,02
>
> Please send me the script and some short instructions on how you are using
> it.
>
> Thanks!

This my script, it works for me perfectly:
The comments are in spanish, but I know you will understand the code by 
passing the comments :-)
Hope this helps

#!/bin/sh

# Buscamos el ID de la tarjeta de video
ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`

# creamos un fichero temporal
TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`
trap 'rm -f $TMP_FILE' 0 1 15

# cambiamos al terminal 1
chvt 1

# Escribimos todos los datos al disco
sync

# Volcamos los datos de la tarjeta de video al fichero temporal
cat /proc/bus/pci/$ID > $TMP_FILE

# hibernamos
echo -n mem > /sys/power/state

# restauramos, desde el fichero temporal,los datos de la tarjeta de video

cat $TMP_FILE > /proc/bus/pci/$ID

# volvemos al terminal 7 (X-Window)
chvt 7

# borramos el fichero temporal
rm -f $TMP_FILE

Section "Device"

Identifier "Videocard0"

Driver "i810"

VendorName "Videocard vendor"

BoardName "Intel Corporation 82852/855GM Integrated Graphics Device"

Option "VBERestore" "true"

-- 
Manuel Arostegui Ramirez.

Electronic Mail is not secure, may not be read every day, and should not
be used for urgent or sensitive issues.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux