human choroinic gonadotropin

GGTSdotNET

The notes of a madman

Archive for May, 2008

Adding keyboard shortcuts to Ubuntu Hardy

Posted by grigsby on May 13, 2008

I wanted to set three shortcut combos that I use in Windows all of the time. After a bit of work I managed to get all three defined. Here are the shortcut keys I wanted to ma:

  1. Super Key – L -> Lock the screen
  2. Super Key – C -> Open shell
  3. Super Key – E -> Open Nautilus

The first thing you need to do is to enable the Super Key (I.e. the windows flag key) to work as a meta key (e.g. alt, super, ctrl). To do this select:

  1. System - Preferences - Keyboard
  2. Select the Layouts tab
  3. select the Layouts Options... button.
  4. Expand the Alt/Win key behavior option
  5. Select Super is mapped to the Win-keys.

The shell shortcut is easy. This can be added by doing the following:

  1. System - Preferences - Keyboard Shortcuts
  2. In the desktop section select Run a Terminal
  3. Hold the Super Key and the c key
  4. Select the Lock Screen and delete the existing mapping

For some reason the Home Directory and Lock Screen selections don’t work. You can map them, but nothing happens. I found a way around using gconf-editor. It takes a few steps, but it gets it done.

  1. select Alt-F2 and enter gconf-editor
  2. select apps - metacity - global_keybindings - run_command_1 to <Mod4>L
  3. select apps - metacity - global_keybindings - run_command_2 to <Mod4>E
  4. select apps - metacity - keybinding_commands - command_1 to gnome-screensaver-command --lock
  5. select apps - metacity - keybinding_commands - command_2 to nautilus

Now exit the Configuration Editor and that’s it.

Update: Just found a bug report on this on Launchpad. Looks like gnome does not like super-L, and super-E. Other keys seem to work. Odd, eh? Link

“Reading files needed to boot”

Posted by grigsby on May 13, 2008

After upgrading to Hardy, hibernate stopped working. Usplash would show the animated splash screen for a few seconds on boot, then it would go away an I would see a text boot screen starting with the “Reading files needed to boot” text. The system would go into hibernate normally, but would never boot back to where I was, it was like I’d never hibernated. After a bit of digging, I found the problem. The UUID for my swap file system was not the same as the value entered for the resume file system in initramfs. Here is the steps required to fix this problem:

1. Make sure you have the initramfs-tools update

sudo apt-get install initramfs-tools

2. Run the blkid util to show what your existing UUIDs are.

root@hardy-desktop:~# sudo blkid
/dev/sda1: UUID="a76fe101-7951-4a65-af1e-50b2902c5b35" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="8dd072f1-25b3-4a7f-888f-2314697d60b9"

3. Verify that the UUID listed for the swap partition in the previous step matches what is listed in /etc/fstab

root@grigsby-desktop:~# cat /etc/fstab
proc /proc proc defaults 0 0
# /dev/sda1
UUID=a76fe101-7951-4a65-af1e-50b2902c5b35 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=8dd072f1-25b3-4a7f-888f-2314697d60b9 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

4. Modify the UUID in /etc/initramfs-tools/conf.d/resume file to match the UUID listed for the swap partition from blkid.

root@hardy-desktop:~# cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=617b4b90-112e-497a-bc6b-dda2a3e7565e
root@hardy-desktop:~# sudo vi /etc/initramfs-tools/conf.d/resume

5. Update the initramfs.

sudo update-initramfs -u

6. Restart the system.