Friday, 18 May 2012

Restore u300s touchpad on resume in Ubuntu

I have finally found the time to fix the touchpad on my u300s. It was causing problems on resume from hibernate (as per notes from before). After a bit of poking around I've found a work-around.

I have synaptics which applies its changes on boot, however I have a problem with resume. Solution is this script:

# Restore three finger tapping

case "${1}" in
        # faster speed and acceleration
        DISPLAY=:0.0 su  -c "/usr/bin/synclient MinSpeed=1 MaxSpeed=2.81 AccelFactor=0.13"
        # 2 fingers scroll
        DISPLAY=:0.0 su  -c "/usr/bin/synclient VertTwoFingerScroll=1 HorizTwoFingerScroll=1"
        # enable tap to click (2 fingers for middle click, 3 fingers for right click)
        DISPLAY=:0.0 su -c "/usr/bin/synclient TapButton1=1 TapButton2=2 TapButton3=3"
Put in /etc/pm/sleep.d/ called something like 80_touchpad_restore and remember to make it executable. Done - mouse settings will be set as per this script on resume from hibernate.

Solution was cobbled together from here, here and here.

Playing with <audio>

I was looking for a better option than directory listings for making a folder of mp3 files accessible on a website so I wrote a very simple php loop.
Initially I omitted the firefox support (firefox doesn't play mp3 files) then, when adding it, I needed to convert my mp3 files into oggs. Step forward dir2ogg which is completely perfect:
dir2ogg -d .
Will quite happily convert all the mp3 files in the current dir to oggs. What more could you ask for?

Getting it on ubuntu is as simple as:
apt-get install dir2ogg

Friday, 11 May 2012

How to play Star Wars - Harmy's Despecialised Edition

Are you one of those fans who think the Star Wars original trilogy has gotten worse with each successive release? Do you get angry watching Han Solo step on Jabba's tail and not get his face shot off? Do you go on about Han shooting first? Or wonder where the mountain went in the twin sun sunset?

In short, are you a human being?

Help is at hand, from a chap named Harmy. This colossus of a man has created a "despecialized" edition - basically an upscaling with all the new additions taken out. You can find the iso files here.

Actually playing them is a bit of a trick. The first (platform non-specific) tip is:

Make sure your files are not corrupted.

Seriously. That cost me a couple of evenings.

Windows 7

* mount the iso as a drive using daemon tools
* download vlc - I have this running with version 2.1
* in vlc do media -> open file -> select your virtual drive -> bdmv -> stream -> m2ts file

Et voila!


* mount the drive thus:
sudo mount -o loop -t udf $path_to_iso/ANH.ISO $mountpoint
* download vlc or pull it from a repository (package name vlc in ubuntu)
* in vlc do media -> open file -> mountpoint -> bdmv -> stream -> m2ts file

Suddenly you're back in the past, watching Star Wars version awesome.

Thursday, 10 May 2012

Installing Ubuntu 12.04 on a Lenovo u300s

After a bit of faffing I have Ubuntu 12.04 running on my Lenovo u300s.

Important info:

* You can build a usb installer using the utility here
* It is possible to keep One Touch restore working and nuke all of Windows if you're brave with the partition table
* Windows will keep booting until you remove the small partition no matter how many times you think you've deleted it - presumably the mbr is in there?
* The touchpad is a pain - you need to install the synaptics drivers and tune it there, but it will reset when you wake from hibernate. Found a fix for this.
* Hibernate and Suspend are easy to fix using this script
* Hibernate can be re-enabled in the power menus using this fix
* To save battery power, Bluetooth can be disabled on startup using the first answer here
Don't forget to install build-essential and synaptic packet manager. You want also probably want rcconf to update applications running at startup (command line tool). Finally, you might want to move the window buttons.

Unity seems quite good on the u300s. This isn't the first time I've encountered this environment but it's the first time I've not utterly hated it. The extra width on the laptops screen (over a standard 4:3 ratio screen) makes the left menu bar work - especially once it has been shrunk as far as it will go. There are a couple of oddities (such as some programs sometimes not appearing in the alt-tab list) which I hope will be fixed soon.

Note about the touchpad. This is the first modern (ie less than 7 years old) touchpad I've used and it took some getting used to. Sensitivity and cursor speed can all be configured in the synaptics driver menu obviously but it's worth mentioning the "disable touchpad on keyboard use" option. If you're using the keyboard to navigate (such as alt-tab) you will find this triggers the mouse disable regardless of the "ignore multiplier combinations" setting which is really annoying. Also, the mouse responds to taps thus:

* one finger tap - left click
* two finger tap - right click
* three finger tap - middle click (needs enabling)

Horizontal and vertical two finger scrolling can be enabled in the synaptics interface.