Gentoo Wiki


I've modified KMilo to adjust brightness on the SZ330 (Intel video). This should work on all Vaio laptops supporting the Linux kernel-based sony controls. If you have a file /sys/class/backlight/sony/brightness, you can use Fn-F6/F7 to adjust your brightness now!

First download the modified source files and put them somewhere sensible. I used /usr/src/kmilo/kmilo_vaio

Enable overlays in make.conf

# cat /etc/make.conf | grep PORTDIR_OVERLAY

Configure portage overlay for kmilo:

mkdir -p /usr/local/portage
mkdir -p /usr/local/portage/kde-base/kmilo
cp /usr/portage/kde-base/kmilo/* /usr/local/portage/kde-base/kmilo/*

Modify kmilo-3.5.5.ebuild to copy over new files during emerge:

File: /usr/local/portage/kde-base/kmilo/kmilo-3.5.2.ebuild
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/kde-base/kmilo/kmilo-3.5.5.ebuild,v 1.9 2006/12/11 13:38:31 kloeri Exp $

inherit kde-meta eutils

DESCRIPTION="kmilo - a kded module that can be extended to support various types of hardware
input devices that exist, such as those on keyboards."
KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~x86-fbsd"
IUSE="kdehiddenvisibility pbbuttonsd"
DEPEND="pbbuttonsd? ( app-laptop/pbbuttonsd )"

src_compile() {
	local myconf="$(use_with pbbuttonsd powerbook)"

	echo *** +++++++++++++++ COPY kvaiodriverinterface.cpp +++++++++++++++++ ***
	cp -f /usr/src/kmilo/kmilo_vaio/kvaio.cpp /var/tmp/portage/kde-base/kmilo-3.5.5/work/kmilo-3.5.5/kmilo/kmilo_kvaio/kvaio.cpp
	cp -f /usr/src/kmilo/kmilo_vaio/kvaiodriverinterface.cpp /var/tmp/portage/kde-base/kmilo-3.5.5/work/kmilo-3.5.5/kmilo/kmilo_kvaio/kvaiodriverinterface.cpp


(Note this is not a proper ebuild because some paths are hardcoded, and these source files should be patches. But this howto is based on HARDWARE_Sony_VGN_S580/kvaio.cpp_hack and it does work, just don't submit this to Gentoo!)

Update digest on kmilo-3.5.5.ebuild

ebuild /usr/local/portage/kde-base/kmilo/kmilo-3.5.5.ebuild digest

Build kmilo, this will rebuild kde libs dependent on kvaio

emerge kmilo

Restart kde



Make sure your user has read/write access to /sys/class/backlight/sony/brightness! This can be accomplished by adding the following line to your startup scripts:

File: /etc/conf.d/local.start
# /etc/conf.d/local.start

# This is a good place to load any misc programs
# on startup (use &>/dev/null to hide output)

chmod 666 /sys/class/backlight/sony/brightness

This gives all users on the system write access, so consider the security implications of someone changing your backlight brightness ;)

If /sys/class/backlight/sony/brightness does not exist, you may need to upgrade your kernel version or enable the following kernel options:

Retrieved from ""

Last modified: Sun, 20 Jul 2008 21:21:00 +0000 Hits: 953