Tuesday, April 5, 2016

Ubuntu on Lenovo P50: using NVidia proprietary drivers

I managed to dual boot Ubuntu (Kubuntu 14.04, actually) on my shiny new Lenovo P50. With the default Nouveau driver, the experience left a lot to be desired. Graphics performance was slow and suspend-resume worked only once. For every boot, suspend will work once. After that, suspending will do nothing—the machine will just stay on forever.

I followed the prompts to install the proprietary drivers, which didn’t really help. After installing the drivers, X would simply not start. So I had to revert to the open source Nouveau driver. (You’d do this by getting a root shell from recovery boot and purging all Nvidia packages.)

Today, as a wild guess, I decided to install the proprietary driver and disable the Intel GPU altogether. (You’d do this by choosing Discrete Only option in BIOS display settings. The default is Hybrid, which keeps both Intel and NVidia GPUs active.) Maybe that could help, I thought, and to my surprise it did work. Graphics is now fast, and suspend-resume works too. Initial display of LightDM and logging into KDE are a bit slow, but everything else is nice and snappy.

Tuesday, June 11, 2013

Watch Apple WWDC keynote video in Linux

Make your browser lie to apple.com that you’re using a Windows machine. I made my Chrome to use the UserAgent string of Firefox on Windows. The video player loaded. Ubuntu seems to have a QuickTime plugin installed, so the video just played.

To change UserAgent of Chrome (i.e. to make Chrome pretend it’s Firefox running on Windows), open Menu > Tools > Developer Tools. Click on the Gear icon at the bottom-right corner and select UserAgent checkbox.


Sunday, October 21, 2012

Seeing GTK mouse cursor in KDE?

If you have upgraded to Kubuntu 12.10, you’d notice that KDM has been replaced with LightDM.  LightDM looks pretty, but somehow doesn’t play well with KDE.  One annoying issue I have noticed is that GTK applications run in KDE use GTK mouse cursor under certain circumstances.  When Chrome shows a menu, the mouse cursor changes to a GTK one and it looks jarring.  Turns out, there’s a fix for that.

1. Install LightDM KDE greeter
sudo apt-get install lightdm-kde-greeter
2. Make LightDM use KDE greeter, and all will be well again. To do that, edit the file /etc/lightdm/lightdm.conf and change the value of greeter-session.  The file will look something like this after the change.  (Boldface text is the change you’d have to make.)
[SeatDefaults]
greeter-session=lightdm-kde-greeter
user-session=ubuntu
3. Save the file and test your changes by running LightDM in test mode:
lightdm --test-mode
If LightDM doesn’t open correctly, check if you have made any typing errors in the config file.  If you cannot fix the issue, just restore the file as it was before you edited; you’ll still have the ugly mouse cursor issue, but at least your computer will continue to work.

Sunday, October 7, 2012

Map Windows (aka Super) key to Escape

Did you know I have mapped Caps Lock on my computer to open a new browser tab?  Only today I figured my Vim sessions can be a lot better if I mapped ‘Windows’ key (aka Super key) to Escape.  It can be done by adding a single line to your ~/.Xmodmap file:
! Map left Windows key to Escape.
keysym Super_L = Escape
(Okay, that was two lines, but a little comment in obscure configuration files can be very helpful.)

Also, if you don’t feel like logging out and logging back in after these changes (or if you want to try the change before touching your config file), you can run this on a terminal to have the keybinding take effect immediately:
xmodmap -e 'keysym Super_L = Escape'

Tuesday, September 11, 2012

Prettier fonts in KDE

If you’re a KDE user and have always envied Gnome for its font rendering (especially with fonts like Ubuntu and Ubuntu Mono), read on.

All you need to do is select ‘Enabled’ for System Settings > Application Appearance > Fonts > Use anti-aliasing.  Click on the Configure button and set Hinting style to ‘Slight’.  If you like ClearType style font rendering, enable subpixel rendering too.

Any program that’s opened after this change will use the new font rendering settings.  So you may want to restart your open apps or logout and log back in.