Linux Desktop

ThinkPad T520/W520, NVIDIA, Wide Gamuts, and You!

Update: Linking to a better color profile below.

Update 2: I narrowed down the ACPI issues, and have a better solution.

I recently purchased a brand new, maxed out ThinkPad T520. My old laptop was 4 years old, and while I absolutely loved it (and still do!), an opportunity came up to get a T520 with a nice discount. So I took advantage of that. I like large screen resolutions, as I tend to have a few thousand windows on screen at any given point in time, so I went with the 1920×1080 option, and put Ubuntu Linux on it.

And let me tell you, for an Ubuntu-certified laptop, it sure didn’t work out of the box.

Optimus!

It took a lot of effort to get Ubuntu working, due to some hardware problems. The biggest issue was the display adapter. The T520/W520 (and I believe the T420, etc.) come with two graphics chipsets: An Intel something-or-other, and an NVidia 4200M. By default, this is in “Optimus” mode, meaning that the OS can essentially switch between the cards for performance/power savings reasons, depending on use.

Not surprisingly, this does not work on Linux.

Your system will try to use the Intel card. You won’t have any 3D, and try as you might, that NVIDIA card just will not work. It’s maddening, but there’s a solution. One with its own set of problems, but at least it gets you there..

The trick, it turns out, is to go into the BIOS, go into the video settings, and switch to “Discrete Graphics” and disable auto-detection of Optimus. Once you do this, your NVIDIA card will work! You’ll get 3D, and it’ll be fast and smooth and so wonderful.

If you can boot, that is.

Once I switched over, I found I could no longer boot. Now this was 4:30 in the morning and my brain stopped functioning, so I wasn’t making all the connections. All I know is that booting locked up, and when I went into recovery mode, I started seeing I/O errors on my brand new 160GB SSD. Figuring it was just my luck, I decided I’d call Lenovo in the morning and get a new one. If this sounds at all familiar, stay calm! It’s not your SSD, and your system is not hosed. It’s ACPI.

(Of course it’s ACPI… Nobody ever said it was the Year of the Linux Laptop.*)

Update: I previously said that passing acpi=off in grub would fix things. That disabled battery and other stuff, though. The new solution below is far better. Suspend/resume and brightness work!

So, to fix that, go back to Intel graphics, edit your /etc/default/grub file, and set GRUB_CMDLINE_LINUX_DEFAULT to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=noirq"

Unfortunately, you won’t get Suspend/Resume, and I think the battery monitor is busted, but you’ll get Hibernate. It’ll mostly work. Sometimes. It’s Linux, afterall.

I’m not sure if this is needed anymore, but you may also need to add this to the “Device” section in your xorg.conf:

Option "RegistryDwords" "EnableBrightnessControl=1"

Once you have a working X/Unity/Compiz/3D/Minecraft setup working, you may notice some problems with colors….

Wide Gamut

The T520/W520/T420/etc. line of ThinkPads have a new 95% Wide Gamut LED display. It makes everything all bright and nice. And it butchers your colors.

Applications that support color management should in theory compensate for this. Not all apps do, though. What bothered me was my web browsing experience. Every color was broken, and as someone who writes webapps, I needed accurate colors. I was about to throw out this laptop before I managed to figure out a solution.

Modern Ubuntus should come with a Color Profiles control panel under System -> Preferences. From here, you can load ICM profiles and get things working. That will solve some of your issues, so let’s start there. Note that this is in Ubuntu 11.04 (I think), but I’m running 10.10 (I thought originally 11.04 was the source of my problems), so for me I had to:

apt-get install gnome-color-manager

And here, I the Color Profiles applet was causing problems, and I couldn’t directly use it, so I installed dispcalGUI, which allowed me to load in a profile and install it into Color Profiles, and activate it.

On some site, I found a working color profile (ICM file). I don’t know where I originally found it, but you can download it here. Note that this is only tested on my 1920×1080 display, so YMMV.

I’m not confident that this profile is 100% correct, but it’s close. At least as far as I can tell.

You’re free to try that profile, but I found a better one which preserves the crispness of the display with the actual accuracy you’d want on the web. WordPress is even looking correct now.

NotebookCheck’s review of the ThinkPad W520 links to a color profile that works much better.

Firefox Color Profiles

Now, you’ll still notice problems with Firefox and Google Chrome. Chrome doesn’t seem to understand color profiles, but Firefox does. You just have to tweak it.

In Firefox, go to about:config. In there, search for gfx.color_management. Set gfx.color_management.mode to 1, and then set gfx.color_management.display_profile to the path of that ThinkPad ICM file I linked to earlier.

Restart Firefox. You should now see more or less correct colors!

Now it’s not perfect. The ThinkPad screen is very bright, and some things can get a bit washed out and perhaps slightly tinted. As I type this, I’m noticing that the WordPress UI is a bit off, and things blend together more than they should (lots of light grays on a bright screen). But it should be much better than it was!

If you use a T520/W520/T420/etc. and have other solutions or tips for color management on Linux, I’d love to hear about them! And hopefully this saved someone else hours or days of rage.

* Thanks to James Farwell for the “Year of the Linux Laptop” snark.

ThinkPad T520/W520, NVIDIA, Wide Gamuts, and You! Read More »

Ubuntu and Desktop Notifications

This past Monday, Mark Shuttleworth wrote about their plans for an overhaul of desktop notifications (the little popup bubbles telling you someone IM’d you or there’s updates available). Many people have asked me about this, some concerned, and wanted to know what I thought. Being the maintainer of libnotify, notification-daemon and the Desktop Notifications specification, some people were concerned that this work would supersede my own.

The reality is, this isn’t a replacement of my project. This is a new joint effort between Ubuntu, KDE, and myself. What’s been written in Mark’s post may not end up being the end result. We’re still deciding how this will progress, and Ubuntu wants to experiment a bit. Aaron Seigo’s post on the subject sums up a lot of my thoughts on this, and I recommend reading it, though I’ll go further and discuss where this all started and how it’ll affect the project.

First of all, libnotify/notification-daemon isn’t going anywhere. It’s not being replaced, nor is an alternate spec being drafted. Ubuntu’s User Experience team has some new things they want to try, and that’s fine. The plan is to see how this stuff goes in their codebase, with the intention of migrating code back upstream.

A couple of weeks ago, during the Ubuntu Summit, I was invited to speak with some of the developers and User Experience guys from Ubuntu about their plans. They showed me the mockup that’s on Mark’s blog and told me about their plans. They have things they want to do that could definitely improve the experience. Some things are pretty controversial, such as the removal of actions on notifications. We sat down, discussed and debated various aspects of the proposals for a while, and I believe reached a general course of action for the project. The highlights include:

  • Actions will be removed for applications packaged in Ubuntu. The developers will try to replace them with something that they feel makes more sense, with the hope of pushing these changes upstream.
  • The released notification-daemon will, I believe, support actions, since many non-packaged applications do use them. They will, however, appear as old-style notifications and not appear in the new window stack demoed in Mark’s blog post.
  • We’ll be drafting new additions to the notification spec in order to address the needs of KDE and Mozilla.
  • The work will be done by their developers in either a fork or a whole new notification-daemon implementation, allowing them a greater ability to experiment. These changes (or parts of them) will make their way upstream. It will be spec-compatible so users won’t have to worry too much about losing features (aside from actions, perhaps).
  • In the end, it’ll likely be that the Ubuntu theme specifically works this new way, and that other themes will work differently (they may support actions more directly, for example).

Now I should point out that I don’t believe actions are a bad thing. There’s many use cases where actions are very much warranted, and it seems Aaron agrees. While the Ubuntu team has discussed the possibility of deprecating this in the spec, I believe the end result will be that actions will live on. I’m also pretty adamant that upstream notification-daemon will still support actions and some other features. Ubuntu can choose what experience to give their packaged applications, but that may differ a bit from what we decide upstream.

Time will tell how this all turns out. I personally think it’s great that there’s some momentum on this project. I know I haven’t had much time to work on it as of late, between VMware and Review Board, which is why getting some new people on board with fresh thoughts will probably be a good thing.

On a related note, I’d like to welcome Andrew Walton to the project. He’s going to be working as a co-maintainer and helping out when I’m busy (which will be a lot of the time for a while).

Over the next month or two, the project should start to pick up. We’re beginning to look at ways to improve the spec and at what work needs to be done in the near future for the project. These discussions will take place on xdg-list.

And with that, I wish everyone a Merry Christmas (or just a very good December 25th for those who don’t celebrate Christmas)!

Ubuntu and Desktop Notifications Read More »

Vista’s gremlins, now on Linux

Vista is an interesting operating system. They have done a number of very cool things with it, and yet it has confused and frustrated me in all new ways. I have been running Vista in a VM for a little while now. I think in many ways it is a better operating system. And there is one thing Vista comes with that beats us hands-down.

It has a Gremlin clock.

Vista's Gremlin skin

The little clock applet on the side has several skins, and one of them is a pink, furry gremlin. I fell in love with this little guy and decided that we must have a Gremlin clock skin ourselves. So I set out to create one, using MacSlow’s cairo-clock. After a couple hours of work, I ended up with this:

I think it’s a cute little thing. I hope others like it too. Just download it and untar into $HOME/.cairo-clock/themes or /usr/share/cairo-clock/themes.

A couple of notes about the theme. cairo-clock doesn’t tend to like themes with different widths and heights and expects the clock face to be in the center of the images. Since the clock face on the Gremlin theme is a bit lower, near the bottom of the gremlin, the theme images had to be made to give a lot of whitespace below the clock. The actual gremlin is on the upper-half of the images. This is not a huge problem except that there appears to be a bug where you can click and drag the clock on parts of the lower region, where it’s completely transparent. Hopefully this isn’t a big problem for most people.

Oh, and MacSlow, if you want to bundle this as part of cairo-clock, I’d be all for it 😉

Now we’re on par with Vista. Yep.

Vista’s gremlins, now on Linux Read More »

Time to rethink GTK+ Tab Dragging

I’ve been planning on adding tab drag-and-drop functionality to VMware Workstation 6.0. Rather than implementing this ability from scratch (which I did with Gaim, and would rather not do again), I took the sane approach and started investigating the GTK+ 2.10 API for GtkNotebook tab drag-and-drop.

This is functionality that many applications have had to implement themselves, so it’s great that support had finally gone into GTK+ 2.10. So I must wonder, with all the various applications that would benefit from this new API, how did we get it so wrong?

Now, before I continue, let me say that I applaud the effort in getting this into GTK+ in the first place. Reordering tabs looks smooth, it’s only one API call, and the basics are trivial. Where this all falls down is when you try to do anything complicated with it, and by complicated I mean anything beyond a simple text editor.

Before starting, I investigated how many projects were using this API. A quick Google Code search shows that almost nobody does, aside from maybe the tab reordering API. I did find this list of complaints, which I remember reading before. I won’t repeat everything on this list, but I will list what I’ve ran into, and how I think we can improve this API.

Global functions are very bad. (Bug 386935)

In order to allow for a tab to be dragged out and form a new window, the application must call gtk_notebook_set_window_creation_hook and pass a callback function. When a tab marked as detachable is dragged to the root window, this function will be called. It is expected that the function create a new window, position it as per the x and y coordinates of the drop (if it so desires), show it, and return the resulting notebook. GTK+ will then add the tab to that notebook.

While useful, this suffers from a major design flaw. You can’t set a window creation hook per-notebook. You get exactly one window creation hook function, which must be responsible for any and all notebooks in the program. The hook function can only distinguish between them using the notebook’s group ID.

For smaller programs, this isn’t a huge limitation. Simple text editors and the like only need one function. However, imagine if your application has multiple notebooks that each need to be dragged, and imagine if the code for those notebooks are in two separate parts of the tree. Maybe you have a nice separation of the different parts of the project. Regardless, now you have to have one common function that knows about both and handles their window creations.

The problem gets far worse for applications separated into different libraries, or those using widget utility libraries. Two separate libraries both providing a notebook with drag-and-drop with their own window creation won’t be able to set up a hook. They would require that the main application handle determining the group IDs of the notebook widgets they care about and then calling the proper functions in the libraries. While doable, it’s a horrible burden on the application, and it doesn’t always work.

Of course, the whole thing completely breaks down when you’re writing a plugin with a notebook rather than an application. The plugin won’t be able to offer its own window creation, due to possible conflicts with the main application and other plugins.

The solution, of course, is to have per-notebook window creation hooks. GTK+ could attempt to call one of these and then fall back to the global hook, if it exists. If calling the global hook, GTK+ could spit out a warning informing the user that the program should be upgraded to the new API and that the existing method is deprecated.

Rather than functions, though, a signal handler may make more sense. It could use a collector and call the handlers until it finds one that returns a GtkNotebook. I could see this being useful if a widget component library (as part of a larger project) provides a default window creation handler that the calling application wants to override for a specific case.

Numeric group IDs lead to namespace collisions. (Bug 386930)

Right now, in order to indicate which notebooks are compatible for drag-and-drop operations, each GtkNotebook gets a group ID. This is an unsigned integer with absolutely no rules on how an ID should be picked. This is very dangerous, as it could cause namespace collisions in larger applications, resulting in tabs being droppable onto incompatible notebooks. This could easily crash such applications.

There’s no reason for us to be using integers. Take a look at GtkRadioButton. They also have groups, but they work a bit differently. The first GtkRadioButton defines the group, and the rest get passed that as the group identifier. In gtkmm, you actually have a Gtk::RadioButtonGroup object that you simply instantiate and then pass to each radio button.

Now, in any well-designed program, there should be only one place creating the notebook for a certain type of window, and usually that’s the only type of notebook capable of accepting tabs from the same class of notebook. So, why not do something like what gtkmm does and have some sort of static object that represents that group, define it once, and pass it to each notebook? This is guaranteed to be unique, and solves the namespace collision issue.

Signals need to be more clear. (Bug 386943)

You can determine if a page was added to a notebook or removed from it, but there’s no clear way of determining if it was due to an API call, or a drag-and-drop operation. We worked around it in VMware Workstation, but it would have been very helpful to know precisely that a page was added due to drag-and-drop. Same with the removed signal. I know they wanted to condense the signals and figured it would work in all cases, but it doesn’t, so please, give us some more specific signals!

Drop operations should be able to be programatically rejected. (Bug 386950)

There are times when you want to allow a tab to be draggable, but want to reject it in notebooks under certain circumstances. For example, in VMware Workstation, we have the “Home” tab. I would like to be able to drag this to empty windows, but if that window has a “Home” tab already, I want to reject the drag. To my knowledge, there is no way to do this currently.

Detaching tabs into new windows requires a drag to the desktop. (Bug 360225)

In most any program with tab drag-and-drop, you can drag a tab off into any area not in the tab bar and it will detach into a new window. With the GTK+ tab dragging, you have to actually drag it to the root desktop. Even dragging off into another window isn’t good enough. This sucks. Let’s fix this properly. We’re not doing anybody any favors.

I’m missing a few annoyances I ran into, but I’ll be blogging about them separately once I remember.

So, to recap, I believe we should:

  • Deprecate gtk_notebook_set_window_creation_hook and add a new create_window signal, returning a GtkNotebook.
  • Ditch the numeric group IDs and use some sort of identifier object or generic pointer to a static variable and pass that in instead.
  • Add new signals or something telling us specifically how the tab was added/removed.
  • Provide a way to reject a tab drop on a particular notebook programatically.
  • Call the window creation hook any time the tab is dragged off the tab portion of the notebook.

It would be great to see these things fixed so that more applications can actually use this API without major headaches. Anyone up for the task?

I plan to put up a new post soon giving a couple of tips for using the current API.

Update: Bugs have been filed for the above. They’re in the topic headers.

Time to rethink GTK+ Tab Dragging Read More »

New libnotify, notification-daemon and notify-python releases

I’m very tired, so I’ll keep this brief.

I just put out libnotify 0.4.0, notification-daemon 0.3.5, and notify-python 0.1.0 releases. Most of the really annoying bugs people have reported have been fixed. More information is available on the news post.

I made a decision that will be unpopular to some, and I expect some disagreement on it. notification-daemon 0.3.5 does not ship with the Bubble theme. A large number of the problems people have reported to me on IRC and in e-mail centered around this theme, and until I have the time to give it the attention it needs, I’m removing it from the default install. It’s still in SVN and the tarball, and development will resume on it at a later date. However, I want to give people the best out-of-the-box experience as possible, and the Bubble theme currently makes that hard. If people want to chip in and help, you’re more than welcome.

Aside from that, it’s a very good release and I highly recommend people update. As always, please make sure to report bugs.

I have a couple of neat things I plan to work on. One is a little event notifier for scheduled events on online calendars (30Boxes.com to start). This will be using the new libnotify Python bindings. If it proves useful, I hope to add Google Calendar support as well. I’ll make some sort of announcement once I get a prototype working.

New libnotify, notification-daemon and notify-python releases Read More »

Taggable Desktop


Luis: You wanted a taggable desktop? Oh, okay.

Announcing Leaftag, our desktop tagging framework. This is an evolution of the original prototype we created, originally named fstaglib (isn’t leaftag just so much better?).

The main part of Leaftag is a library called (oddly enough) libleaftag, which interfaces with the tag database. It’s GObject-based, and the API is quite small. It can tag anything with a URI.

There’s tagutils, a small app used for working with tags and files. It is able to tag and untag files, list all known tags, list all files with a specified tag, and manipulate tag properties (such as icons and descriptions). It also includes some symlinks that provide shortcuts to common tagutils functions (tag, untag, tagls, tags, and tagprop).

leaftag-python contains Python bindings for libleaftag. It simplifies the already simple libleaftag library.

And then there’s leaftag-gnome, which will contain all future GNOME support for tagging. Currently, it supports only a Deskbar handler. Future releases will hopefully include Nautilus search integration and property pages.

Now, it’s important to point out that the screenshots on my previous blog entry are of the old implementation, and have not been ported over to Leaftag yet. This is largely due to lack of time as of late (because of Galago and VMware Server work, on my part), but it’s also because we want to re-implement this correctly. In the meantime, we’re hoping additional apps will start supporting this.

This is the first public release of the Leaftag framework, so please report any bugs to us. In time, after a server migration, I plan to put together a dedicated Leaftag site and bug tracker.

Taggable Desktop Read More »

Pretty new notifications… And a release!

I’ve been inspired by the December GNOME mockups. A lot of them are quite nice, and in the area of notifications, it had some good ideas on sprucing up the look and feel. So I present to you, notification-daemon v0.3.4!

Along with the usual assortment of bug fixes, I’ve improved the style quite a bit. There’s now a countdown timer on notifications with actions, a close button, themed urgency-based stripes, and actual buttons.

Before After
Old urgency stripesOld icons and actions New urgency stripesNew icons and actions

Pretty new notifications… And a release! Read More »

A few project updates

I’ve been putting off several posts for a few days now, due to just being busy with things. So, here we go.

Notification Framework

I just put out a couple of good releases of notification-daemon and libnotify. A few days ago, I released version 0.3.2 of both components, and tonight I put out notification-daemon v0.3.3, which contains a few nice bug fixes such as a fix to prevent notifications when the screen saver is active or when something is running full-screen. The style of the notifications has been changed to resemble the look from notification-daemon v0.2.x. It now supports theme engines, so that other looks can be developed. The protocol has improved and stabilised a bit, and the API and general code of both components have been cleaned up, thanks to J5’s work.

Galago

Galago’s been on hold lately due to work and trying to get the new notification-daemon and libnotify ready for distros. Development has picked up again, and I’m hoping I have very little to do before I can put out the 0.5.0 releases of all the components. Finally, libgalago will be GLib/GObject-based, and the API will be a lot more sane. Plus, Python bindings! Yay!

Oh, and I’m moving to Trac for our bug tracking (see trac.galago-project.org). This is real nice, because I can now reference bugs in commit messages and they’ll close automatically with the commit message. It’s also quite clean and easy to use. I’m slowly moving some bugs over, but I’ll continue to monitor the bugzilla for a while.

Leaftag

Remember those screenshots of our tag integration I posted? It too has been on hold, but it’s far from vaporware. We’re calling it leaftag, and I think our logo is somewhat cute :). I have very little left to do before the library is released, and I should be able to redo the Nautilus support quickly. I’ve been using the tagging almost every day. Now I just need to find the time to get this ready. Maybe at one of these upcoming hackfests I’ve been doing (and really hope to do more) with friends.

VMware

Busy busy busy, but good. I’m working on some pretty exciting stuff. More about this later 🙂

Oh, and someone needs to remind me to put up a picture of our cool new Workstation 5.5 sweaters featuring Mario!

A few project updates Read More »

Tagging and the GNOME Desktop

Just a little preview. It’s not done yet, but will be shortly. What you see below is a small python module, a useful command line utility (well, that’s not shown, but if you check the gallery these are in there will be a full-size screenshot showing one), and plugins for Nautilus, GNOME-VFS, and Deskbar. There are plans for Beagle support in the near future, and to make the system more robust.

Stay tuned. There should be a release soon.

Tags in Nautilus lists

Tags in Nautilus lists

tags URI

Deskbar Integration 1

Deskbar Integration 2

Tagging and the GNOME Desktop Read More »

Scroll to Top