Create a Shortcut and Hotkey to Eject Your CD/DVD Drive in Linux [HowTo]

by Anoop Engineer 3 comments

The How-To Geek weblog recently made a post on creating desktop and keyboard shortcuts to eject your CD/DVD drive. Wow! this is so coool... I mean, I have been using Linux for a couple of years now. I have been using keyboard and desktop shortcuts to eject (and close) CD/DVD tray in my Ubuntu/Fedora box long back and never once realized that this was a hot blogable topic that could hit the front of lifehacker.
Me dump. Me idiot. Well, since How-To Geek doesn't appear to know about a stuff called "Linux", here goes my How-To on doing the same on Linux... Better late than never.

HowToGeek uses a piece of software from NirSoft to do the above said magic. Linux users might be a bit disappointed here, because they don't have to install another software to do this magic. ;)

Create a Shortcut to Eject the CD/DVD Drive

  1. Right click anywhere on the desktop and select "Create Launcher..."

  2. Enter the name as "Eject DVD" and command as "eject /dev/scd0"

  3. Do you mind if I don't spoon feed you on getting a CD/DVD icon for your shortcut?

Create a Shortcut to Close the CD/DVD Drive

Same as above, except that the command is eject -t /dev/scd0

Assign a Hotkey to the Shortcut

Well, (unlike in Windows) you don't have to create a shortcut to have a Hot Key in Linux.
  1. Hit Alt + F2. In the run dialog enter "gconf-editor" and hit enter.
  2. Go to "apps" -> "metacity" -> "global_keybindings"
  3. Double click on e.g. "run_command_1"
  4. Type in <Control><Alt>c
  5. Go to "apps" -> "metacity" -> "keybinding_commands"
  6. Double click on e.g. "command_1"
  7. Type in "eject /dev/scd0"

This creates a hot key - Control + Alt + c to eject your CD/DVD drive. Similarly create another hot key with run_command_2 = <Control><Alt>v and command_2 = eject -t /dev/scd0 which will eject your CD drive using Control + Alt + v.

Happy Ejecting.

Comments 3 comments
Anonymous said...

It´s so simple. Thanks. I´ve been looking for this HOWTO for dummies on several ubuntu forums and this one it´s the only one I undestood.

Anonymous said...

An even more simpler command (if you just have one drive) is:

eject -T

This will automatically open/close your cdrom drive and would require just one hokey :)

Victorinox replica watches said...

Excellent post.I want to thank you for this informative read, I really appreciate sharing this great post.

Post a Comment

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Advertise on this site Sponsored links

Subscribe feeds rss Recent Entries


Subscribe feed rss Popular posts

Subscribe comments rss Recent Comments


My authority on technorati
Add this blog to your faves