ASUS U56E – Best Linux Laptop Ever
March 13, 2012 8 Comments
I debated between a Mac Book Pro or jumping back into the potential nightmare of building a Linux laptop. Mac Books are fantastic, to say the least. They work right out of the box. They’re cool. They’re beautiful to look at. And did I mention, they work right out of the box. No configuring. No installing. No guessing. No late nights combing Google for a configuration tweak.
I decided, however, that all that ease of use and cool factor stuff is just not for me. OK, maybe that’s not quite true. It’s more like I wasn’t willing to part with $1,500 or more for a Mac Book. The problem for me is once you start down that road, you very quickly end up at $2,200. Because once you decide you’re willing to part with $1,500, and you realize that you’re going to use a Mac Book for the next 3 years or more , you might as well get everything you want. All the bells and whistles easily push the price into the $2,200 neighborhood.
I won’t bore you with all the details of the odd number of trips back and forth between BJ’s Wholesale Club and Best Buy comparing laptops. What’s important is that I arrived at the purchase of an ASUS U56E. It’s a great looking machine. In fact, I would argue it might be the best looking non-Apple on the market right now. The brushed aluminum case, thin profile, chiclet style extended keyboard, black trim, black rubber palm rests, and hidden speakers all combine to create a clean design. Under the hood it has plenty of fire power coming from an Intel Core i5, 6GB of memory and 750GB hard drive. Plus it sports a 15.6″ display and close to 8 hours of battery life. For about $700, you can’t beat it.
Now the challenge- installing Linux. I started off with Fedora 16. I quickly got frustrated at the lack of Google search results when attempting to get the wireless card to work, so I moved on. Probably the most popular Linux desktop is Ubuntu. I attempted Ubuntu 11.10, and most everything worked with the exception of the wireless card. I dropped the Kernel from 3.0 down to 2.6. That fixed the wireless card, but caused the touch pad to be recognized as a PS/2 mouse. I kept at it. Finally I arrived at nirvana- Ubuntu 12.04 LTS installed with wireless card, touchpad, dual monitors, volume controls, and brightness controls all working.
Here are some shortcuts:
Wireless Card
This is what gave me the most trouble. For the U56E, the wireless card was recognized, and it could see all the available wireless networks. The card is an Intel 6150 +WiMax. The problem was that despite being able to see available networks, it would not connect. It would not even connect to an unsecured network. It just plain refused.
During the install process the wireless card needs to work. To make this happen, boot from a Live CD and run the following before starting the install:
sudo modprobe -r iwlagn sudo modprobe iwlagn bt_coex_active=0
After the install, make the solution permanent by creating an executable script named iwl.conf in /etc/modprobe.d. It will contain the following line:
options iwlwifi bt_coex_active=0
Monitor Brightness
I don’t know why, but Ubuntu likes to turn the brightness dial all the way up as high as it will go each time the machine boots. Annoying. I had this experience on previous laptops. I think Fedora also did this. I found a handy python script that sets the brightness to whatever setting you prefer. I prefer 0. (You would think 0 equals off, but it’s just a low brightness that doesn’t make my eyes bleed.) Create this script in your home directory. Call it whatever you like. Make it executable and add it to your Startup Applications. The last line controls the brightness level.
#!/usr/bin/env python
import dbus
bus = dbus.SessionBus()
proxy = bus.get_object('org.gnome.SettingsDaemon',
'/org/gnome/SettingsDaemon/Power')
iface=dbus.Interface(proxy,
dbus_interface='org.gnome.SettingsDaemon.Power.Screen')
iface.SetPercentage(0)
Touchpad
I don’t really like touchpads -not even on the Mac. When I’m at a desk I plug in a wireless mouse or trackball. If the wireless receiver for my mouse or trackball is plugged into a USB port when the computer starts, then I want the touchpad turned off automatically. Note that the fn-f9 touchpad on/off function does work. I just don’t want to have to hit every time the computer starts or wakes up.
Below is a script that handles this. Put this in your home directory and call it touchpad.sh. Set the permissions so that it is executable, and add it to your Startup Applications. Notice that the script takes a parameter: on | off. If no parameters are passed, then it assumes you want the touchpad turned off. It works by using the input command, so you’ll need to review ‘xinput –list’ and adjust the script to work with your pointing device.
#!/usr/bin/bash
selection=`echo $1 | tr [a-z] [A-Z]`
device=`xinput --list | grep "ETPS/2 Elantech Touchpad" | \
awk -F = '{ print $2 }' | awk '{ print $1 }'`
if [ "$selection" == "OFF" ] || [ "$selection" == "ON" ]; then
if [ "$selection" == "ON" ]; then
state=1 else state=0
fi
xinput set-int-prop ${device} "Device Enabled" 8 ${state}
else
# if no input, then we ran from startup. check to see
# if logitech device installed. if so, turn off touchpad
cnt=`xinput --list | grep -c "Logitech Unifying Device"`
if [ $cnt -gt 0 ]; then
xinput set-int-prop ${device} "Device Enabled" 8 0
fi
fi
I also run this after resuming from sleep or hibernate mode. If you don’t, the touchpad will automatically turn back on. Place the following script in /etc/pm/sleep.d and call it 99_touchpad. Make it executable, and replace <username> with your user account.
#!/bin/bash
case "$1" in
resume|thaw)
echo "Calling touchpad.sh"
DISPLAY=:0.0 su -c '/home/<username>/touchpad.sh'
;;
esac
Background
I like the desktop background to change every so often. Mac OSX has this feature built in so you can control how frequently it changes. There doesn’t seem to be a way to make Unity do this. I tried installing Desktop Nova, but I could not get it to work. It used to work on 11.04 and did a nice job.
There’s nothing else in the Software Center related to changing the background, so I did some digging and found a python script that is simple and does the trick. It comes from a post in the Ubuntu forms from way back in ’09.
Put it in your home directory, make it executable and add it to your Startup Applications. Adding it to Startup Applications will make sure that it picks up any new images the next time the system reboots. If you want it to pick up changes more frequently, you can certainly add it to your crontab. By default it reads image files from /usr/share/backgrounds.
Note: This replaces the .xml file found in /usr/share/backgrounds/contest. Give yourself read and write access to this directory and the .xml file.
I modified the original code so that it no longer prompts for setting values. Since I’m running it at start up, it should just do it’s thing without bothering me.
#!/usr/bin/env python
import os, random
# Default settings
defaultPath = "/usr/share/backgrounds"
path = defaultPath
showTime = '600'
interval = '3'
# Some minor error control
if path == '':
path = defaultPath
#lets set some default values if they didn't specify anything
if showTime == '':
showTime = '60'
#lets set some default values if they didn't specify anything
if interval == '':
interval = '3'
#Get the list of files in our directory
listing = os.listdir(path)
# Create the XML file header in the TMP folder.
headers="""<background>
<starttime>
<year>2009</year>
<month>08</month>
<day>04</day>
<hour>00</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at midnight. -->"""
i = 0
x = 0
# Randomize the images to be displayed
random.shuffle(listing)
FILE = open("/tmp/new.xml", "w+")
FILE.writelines(headers)
# Loop through and get max, as max is not working correctly.
for counter in listing:
x = x + 1
numImages = str(x)
print "\n\n"
print "Results\n"
print "Number of images in the directory: " + numImages
print "Writing the new XML file"
# Loop through the list again, and write the XML config file
for infile in listing:
i = i + 1
if i > 0:
currentFile = listing.index(infile)
if currentFile < (x - 1):
nextFile = listing.index(infile) + 1
else:
nextFile = 0
staticImage = """ <static>
<duration>""" + showTime + """.0</duration>
<file>""" + path + "/" + infile + """</file>
</static>"""
transitionImage = """ <transition>
<duration>""" + interval + """</duration>
<from>""" + path + "/" + infile + """</from>
<to>""" + path + "/" + listing[nextFile] + """</to>
</transition>"""
# lets carry on writing the config file
FILE.writelines(staticImage)
FILE.writelines(transitionImage)
# Clean up and exit
FILE.write("\n</background>")
FILE.close()
print "Done writing the XML file"
print "Creating a backup if needed"
# Create the backup
if os.path.exists(path+"/contest/background-1.xml.backup") == False:
os.system("gksudo --description 'We need admin rights to " +
path + "/contest' cp " + path + "/contest/background-1.xml " +
path + "/contest/background-1.xml.backup")
print "Loading new XML file"
# Add the file to the folder and start the magic
os.system("cp /tmp/new.xml " + path + "/contest/background-1.xml")
exit()
For the above to work, right-click on the desktop and choose Change Desktop Background. One of the default pictures is the Contest picture. When you click on it the title under the display will change to Contest and below that you will see “Changes throughout the day.”
After you run the script for the first time the image will change every 10 minutes. If you want it to change the frequency, adjust the value of showTime near the top of the script.
