Unity’s default shortcut to use <Super>+T to open the trash has been bugging me for some time, mostly because it conflicts with my open terminal shortcut. Judging from the questions I found by googling, I don’t seem to be the only person who would like to configure it.

Turns out, there is no easy way. Although there are two different places where I can configure keyboard shortcuts, none of them can be used to change the shortcut used to open the trash window. It’s kind of odd how this is a shortcut at all. I mean, how often do I actually look into the trashcan to see what’s in there? That’s not even remotely close to being a common operation.

The cumbersome way

This being free software, there is of course another way, which you might or might not consider to be worth doing, that is downloading the source-code for a package, change it and compile it into a .deb package again (If you don’t know how to do that, consult the link I provided below).

Turns out changing the source code was really easy. Simple searching for “trash, I soon found “plugins/unityshell/src/TrashLauncherIcon.cpp” where I found the following code:

TrashLauncherIcon::TrashLauncherIcon(Launcher* IconManager)
  : SimpleLauncherIcon(IconManager)
  , proxy_("org.gnome.Nautilus", "/org/gnome/Nautilus", "org.gnome.Nautilus.FileOperations")
{
  tooltip_text = _("Trash");
  SetIconName("user-trash");
  SetQuirk(QUIRK_VISIBLE, true);
  SetQuirk(QUIRK_RUNNING, false);
  SetIconType(TYPE_TRASH);
  SetShortcut('t');

I changed the last line to set ‘x’ as the shortcut and build the package, which turned out to be multiple .deb files of which I found the right one by unpacking them into a temp directory and looking for the TrashLauncherIcon symbol.

I’m not sure the amount of work required to do this is really worth it, especially considering that I have to redo it every time the unity package is updated again, but for now I’m really satisfied.

Links:

Update: Added bugtracker URL for this.

Update2: Build and uploaded new .deb for new version (12.11.2011)