Compal Laptop Control
=====================

Author:		Krzemin <pkrzemin@o2.pl>
Website:	http://krzemin.iglu.cz/compal-laptop-control

This software is distributed under the GNU General Public License.

Compal Laptop Control is small software for Linux that can switch
bluetooth or wireless lan power and manage lcd brightness on Compal
IFL90/FL90 and similar laptops.

It requires compal-laptop kernel module by Cezary Jackiewicz you can
find here: http://eko.one.pl/index.php?page=compal-laptop


Installing
==========

Firstly, you have to install kernel headers package for your distro
or download and unpack full kernel sources from http://kernel.org
and point /lib/modules/$(uname -r)/build to kernel sources directory.
Next you should download compal-laptop module sources from
http://eko.one.pl/index.php?page=compal-laptop and unpack it:

$ tar -zxvf compal-laptop-version.tar.gz

Enter to the created directory:

$ cd compal-laptop-version

Compile module:

$ make

And install it to the kernel modules tree:

$ sudo make -f install.mk install

Now you have module compal-laptop installed and you can load it:

$ sudo modprobe compal-laptop

If you get error like "No such device", you should pass parameter
force=1. This will force module to load:

$ sudo modprobe compal-laptop force=1

To enable automatic loading compal-laptop module after reboot
add line "compal-laptop" at the end of /etc/modules file (or similar
proper to your Linux distribution).

If module loads, now you can compile Compal Laptop Control GUI.
You will need Qt4 libraries (qt4-core and qt4-gui). Usually you can
find it in your distributions' repositories. For example in Ubuntu
you can install them by apt-get:

$ sudo apt-get install libqt4-core libqt4-gui

Next, enter to the Compal Laptop Control directory:

$ cd path_where_you_unpacked_sources/compal-laptop-control-version

If you want to recompile program executable, you will also need
Qt4 developer headers (in Ubuntu: libqt4-dev package).

$ make

Will recompile executable. But usually recompiling isn't required.

Install compal-laptop-control in /usr/ filesystem tree:

$ sudo make -f install.mk install

And run it:

$ sudo compal-laptop-control

Another way is set SUID permissions for the executable:

$ sudo chmod +s /usr/bin/compal-laptop-control

Now you can run application without sudo:

$ compal-laptop-control

WARNING: this allows program to get root privillages, so be careful with it!

To avoid running application with root privillages, you can set files'
permissions at system startup. Add following line:

chmod 666 /sys/devices/platform/compal-laptop/{bluetooth,lcd_level,wlan}

...to the file named like /etc/rc.local or similar, proper for your distribution.

To uninstall application, type following command in sources directory:

$ sudo make -f install.mk uninstall


Contact
=======

If you find a bug, want to add translation or you have any suggestions,
feel free to contact with me (pkrzemin@o2.pl) or visit program's webpage
at http://krzemin.iglu.cz/compal-laptop-control
