Laptop Config

Before you start installing and using ltpconf:

DISCLAIMER

I TAKE ABSOLUTELY NO WARRANTY OR RESPONSIBILITY FOR USING LTPCONF AND THE
RELATED TOOLS IN THIS PACKAGE. YOU MAY LOOSE ALL YOUR DATA, DESTROY YOUR
COMPUTER, USE IT ON YOUR VERY OWN RISK! SEE THE COPYING FILE FOR DETAILS!

TO SAY IT AGAIN:

!!! YOU USE IT ON YOUR OWN RISK !!!

PLEASE READ ALL THE TEXT BELOW IF YOU DON'T KNOW WHAT YOU ARE DOING!

THANK YOU VERY MUCH!

This package provides a qt-gui for accessing features of laptops like
hotkeys, acpi-events, display-brightness and powersaving in a platform independent
way, so it is possible to run it on different laptops.

As for now (version 0.4), there is usable support only on ASUS(tm) notebooks, a very
early Toshiba(tm)-driver and Sony(tm)-Vayo(tm)-driver and generic ACPI-support.
I found some infos for IBM Thinkpads(tm), we will see how far I come writing support for it
without having exact specs.
This may change if I get more information of different laptops and they need a specific
acpi-kerneldriver (like Julien Lerouges acpi4asus-project, see at http://acpi4asus.sourceforge.net )

Table of contents :

--------------------------------------------------------------------------------
1. Requirements

2. Compilation

3. Usage

4. Patches, Errors, Questions:
--------------------------------------------------------------------------------

1. Requirements:

First of all, you need acpi-kernel support, compiled all features in. You may
check this by checking if there is an entry acpi in your /proc directory.

If you own a ASUS(tm) laptop, you need to install Julien Lerouges kernel-patch,
this patch is included in kernelversion 2.4.22 and above.

See http://sourceforge.net/projects/acpi4asus for details.

Then you need a recently new qt ( 3.1 will work fine ), get it at

http://trolltech.no or install it via your distributions package-tool.


You need also a working c++ compiler, g++ 3.2 works fine, I use it on Debian SID.


--------------------------------------------------------------------------------
2. Compilation:

Just type in your shell a normal user:

$ cd ~
$ tar xvjf ltpconf.tar.bz2
$ cd ltpconf
$ qmake
$ make

then you have to get root:
$ su
type in your root-password

make install will copy all the stuff to the right place under /usr/local
# make install

chmod 4755 will set the suid-bit for setltp

# chmod 4755 /usr/local/sbin/setltp

You are finished installing ltpconf now!

If you encounter problems compiling ltpconf you can use binaries under the bin
directory. I am really sorry for these problems, please contact me with a detailed
error-description.

If you are willing to package it for your favourite distro, let me know about it, i'll
put in on the website. I will make packages for Debian but it shouldn't be a hard job
to package it for whatever distro you want.

There are three different programs, the frontend ltpconf, an user_acpid daemon and
a tool for setting the laptop to specific modes named setltp .
The last tool (setltp) needs the setuid-bit enabled which may be a security-risk, but for enabling
CPU throttling and setting the performance states you need root-privilegues.

You need the acpid to run on your machine, install it via your distos package-tool
( apt-get install acpid on Debian ) or get it at

http://acpi4linux.sf.net and follow the installing instructions in the README.

Note for Debian users:

You have to enable socket-support which is disabled by default.
Just comment out the folling line in /etc/default/acpid

OPTIONS="-S"

it needs to be like this:

#OPTIONS="-S"

Afterwards you have to restart the daemon as root with

# /etc/init.d/acpi restart

Unfortunately the acpid only support system-wide settings of the events, so you can't
bind commands on a per user base.
To encompass this, this packages contains a tool named user_acpid, which is based on Julien Lerouges
asus_acpid. It will be build automatically and you find it under /usr/local/bin.
user_acpid handles all acpi events and lets the user choose the action to perform on it.

There is a samples directory in this package which you can put in your $HOME with:

cp samples ~/.user_acpi

To start the program you have to add the following line to your ~/.xsession or ~/.xinitrc file:

user_acpid

Note for Debian users: be sure to enable the session "Debian" in your displaymanager,
otherwise the .xsession may not be processed.

Check a succesful install with

ps -ax

You should find an user_acpid entry!

--------------------------------------------------------------------------------
3. Usage:

run ltpconf:

$ ./ltpconf

------------------
1.Section "Laptop"
------------------

The programm lets you set different things on your laptop, first of all, you can
toggle your LCD-brightness. I have tested it only with ASUS-laptops, I have no other
machines, so you have to send me specs for your model, maybe I will write support for it.
Feel free to write your own, use the implemention in asusmodel.cpp as a starting-point
and you are welcome to ask me for help! My email is on bottom of this README-file.

------------------
2.Section "Events"
------------------

Here you can control so called ACPI-events, which can be emited through many different
kinds of actions. For instance if your laptop has special hotkeys, a working ACPI-bios
and proper kernelsuppport (I tested it on ASUS only but I know there is a Toshiba-Support
on the way), you can bind your favourite apps to it.

There are some events already defined in the programm, such events as the LID-button
(if you close your display on a laptop), the power-button, low battery-warning etc.
You can edit the events under the "Events" section, click on it in the left list and
you will see an list which may be empty if you start lptconf the first time.

Press "New" and give it a name, maybe "Hotkey1" if your laptop has special hotkeys.
You will see a new entry in the list:

"ACPI-Event" in the left column and "Hotkey1" in the right column.
Click on the small + left to "ACPI-Event" - this will open to subitems: "Event" and "Action".

Click on the subitem "Event" - in the right column will now appear a combobox where you can
choose some predefined events, or type in the event string as a regular expression as described
in the acpid documentation. But you don't have to do this by hand, just click on the small
"..." button right to the combo.

A window will open where you can generate this cryptic string by easily pressing the appropriate
key. If you press a key (some laptops emit acpi-events if you press the F-keys as under Windows(tm)).
the window will automatically close (can be turned off with disabling the "auto-close" button)
and you will see the appropriate event string in the combobox.

Now click on the "Action" subitem. You can specify an application or script to start,
maybe your webbrowser, emailtool, an autoshutdown script, whatever you want, by typing in
the location of the program on your harddisk or by clicking on the small "..." button right
to the text-field in the right column. This will open a dialog where you can search for the
program to start.

--------------------------
3.Section "Power Profiles"
--------------------------

The idea behind power profiles is to define some profiles with special LCD-brightness,
CPU-throttling etc. which you can easily switch between.
Imagine you are surfing in the internet and don't need the full speed of your computer because
that would safe your battery. Then a friend comes in and wants you to play a game, where you
need the full speed of your laptop and even the full LCD-brightness. It would be a mess
to toggle all these settings by hand under /proc/acpi.

Here come power profiles in. You can define your own profiles, for instance a profile
"surfing" and a profile "gaming" or "development" and preset all the desired acpi-settings.
You can the switch between this profiles with the tool setltp (/usr/local/sbin/setltp):

/usr/local/sbin/setltp --cycle

The tricky thing is to bind a special key (many ASUS laptops have such a hotkey, but every key
which can emit acpi events will do fine) via the "Event" section of ltpconf to the
"setltp --cycle" command. See above in paragraph 2.

There are two predefined profiles "Max performance" and "Max powersaving".
You can add new ones by pressing "New" or remove existing ones by pressing "Remove".

---------------------------------------------------------------------------------
4. Patches, Errors, Questions, Thanks:

Feel free to contact me for suggestions, patches or questions at mmlr@gmx.net
The design of the program is independent from ASUS laptops, if you want to get support
for your own laptop, just implement the driver inheriting from cGenericACPIModel and write
its interface (this should be a simple task) or send me the specs of your laptop-extensions.

The next steps planned:

- support for configuring the synaptics touchpad driver
- better support for more laptops
- let me knwo

Markus Mueller
mmlr@gmx.net

Credits:

The PropertyWidget is inspired by Trolltechs Designer, it is based on their
very well done work and I borrowed some parts of it.
The idea for the Sony Vayo support came from looking through kde3.2 sources (impressive work folks),
there is a project named kmilo and I found the interface in Mirko Boehms Vayo-code -
thank you Mirko.

Thanks have also to go to Julien Lerouge for his acpi4asus-project and all
people who contributed to it. I wish to thank Trolltech for making the
incredibly powerful and handy qt-toolkit, Linus Torvalds and the kernelcommunity
for making linux, the Free Software Foundation for giving us the wonderful world of
free software and the whole opensource community for making such useful and
powerful tools - THANK YOU ALL FOLKS!

Markus


