Search This Blog

Friday, March 16, 2007

xmms2

As everyone knows,xmms is a great audio player,except it depends on gtk+,so I turned to bmp which depends on gtk+-2.0.But letting bmp to play flac is diffculty,so I choosed bmpx.
At first,bmpx satisfied me,until version 3.
1.compiling bmpx take 99% of my memory!you know,I have 1GB ram,it sucks!
2.shout cast or something is cool,BUT,I did,do,and will never need that!But everytime bmpx tries to access the stupid network address that I cat not connect to from my network in order to get information about shout cast which makes bmpx's starting up take at least 5 minutes!What's more,bmpx does not provide an option to close the sucking function until a recent version.
So,now I give bmpx up and get xmms2,a C/S audio player.I can choose different clients as I wish to communicate with the xmms2 server,it's cool.

Thursday, March 15, 2007

hdaps now works

At last I found an hdaps protect patch for kernel 2.6.20,patch it:


#patch -p1 < /path/to/hdaps_protect-2.6.20.patch

remember to compile hdaps as a module
then install the tp_smapi with hdaps support:

#USE="hdaps" emerge tp_smapi
#modprobe tp_smapi

and install hdapsd:

#emerge hdapsd
#rc-update add hdapsd default battery

after reboot,try it with updatedb,when I shake my laptop,the hard drive stops working,and when I stop,it remains working,cool!
ps:
first,when a boot the laptop with the new patched kernel,something goes wrong:
my ethernet card can not be brought up,due to EEPROM checksum error,
then I insert a cable,remove the e1000 module and probe it again,it works.Then I use a script from lenovo,run it:

#./vidalia-eeprom-mod-script eth0

now problem resolved
:P

Saturday, March 10, 2007

hibernate-ram,special keys,etc,on x60

At last,with a suspend2-sources-2.6.20,I have make the hibernate-ram work,it's great!I use acpid to grab fn+f4 or lid off to get hibernate-ram activate automatically:


x60 shelling # cat /etc/acpi/events/tp_hotkey
event=ibm/hotkey.*
action=/etc/acpi/actions/tp_hotkey.sh "%e"



x60 shelling # cat /etc/acpi/actions/tp_hotkey.sh
#!/bin/bash

#receive our hotkey event
event=$1

#ibm thinkpad x60 hotkeys
nop="ibm/hotkey HKEY 00000080 00000000"
fnf1="ibm/hotkey HKEY 00000080 00001001"
fnf2="ibm/hotkey HKEY 00000080 00001002"
fnf3="ibm/hotkey HKEY 00000080 00001003"
fnf4="ibm/hotkey HKEY 00000080 00001004"
fnf5="ibm/hotkey HKEY 00000080 00001005"
fnf6="ibm/hotkey HKEY 00000080 00001006"
fnf7="ibm/hotkey HKEY 00000080 00001007"
fnf8="ibm/hotkey HKEY 00000080 00001008"
fnf9="ibm/hotkey HKEY 00000080 00001009"
fnf10="ibm/hotkey HKEY 00000080 0000100a"
fnf11="ibm/hotkey HKEY 00000080 0000100b"
fnf12="ibm/hotkey HKEY 00000080 0000100c"
fnbksps="ibm/hotkey HKEY 00000080 0000100d"
#fnhome="ibm/hotkey HKEY 00000080 00001010"
#fnend="ibm/hotkey HKEY 00000080 00005010"
wireless_switch="ibm/hotkey HKEY 00000080 00007000"

case $event in
$nop)
;;
$fnf1)
;;
$fnf2)
/usr/bin/xscreensaver-command -lock
;;
$fnf3)
;;
$fnf4)
sudo /usr/sbin/hibernate-ram
;;
$fnf5)
;;
$fnf6)
;;
$fnf7)
;;
$fnf8)
;;
$fnf9)
;;
$fnf10)
;;
$fnf11)
;;
$fnf12)
;;
#$fnhome)
# echo 'up' > /proc/acpi/ibm/brightness
# ;;
#$fnend)
# echo 'down' > /proc/acpi/ibm/brightness
# ;;
$wireless_switch)
if [ -f /var/run/ipw3945d/ipw3945d.pid ]
then
/etc/init.d/ipw3945d stop
else
/etc/init.d/ipw3945d start
fi
;;
esac



x60 shelling # cat /etc/acpi/events/lm_lid
event=button[ /]lid
action=/etc/acpi/actions/lm_lid.sh %e



x60 shelling # cat /etc/acpi/actions/lm_lid.sh
#!/bin/bash

test -f /usr/sbin/hibernate-ram || exit 0

# lid button pressed/released event handler

#
#/usr/sbin/laptop_mode auto
/usr/sbin/hibernate-ram




The volume controlling keys are actually valid without any configuration,and using a tpb with xosd support,we can see it working;

And the BACK and FORWARD key need xmodmap:

x60 shelling # cat .Xmodmap
! Page left
keycode 234 = F19
! Page right
keycode 233 = F20

Now make a little mod to firefox:

#cd /usr/lib/mozilla-firefox/chrome
#unzip browser.jar

and add the following two lines (the lines with "TP") to content/browser/browser.xul:

<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
<key id="goBackTP" keycode="VK_F19" command="Browser:Back"/>
<key id="goForwardTP" keycode="VK_F20" command="Browser:Forward" />

restart firefox,now BACK makes firefox back and FORWARD makes firefox forward.

Friday, March 09, 2007

my new laptop:lenovo thinkpad x60

with core 2 duo T5500,512m ram,60g hd,it provides me an excellent experience.
however,without an internal cdrom,it's difficult to install an os.I still choose gentoo,but whose livecds can not be booted from a usb drive.so at last,I use a knoppix liveusb to boot the laptop,and installed gentoo 2006.1 for x86(for knoppix is 32bit,I have no choise but install a 32bit os).
anyhow,it's beautiful,and my ethernet card,wireless card,sound card are all driven,hdpas not configured yet.
now I am writing this blog via wireless network,it's great.