Add "Eject/Close CD ROM" to menu / desktop / panel

Please post all general support questions for LXDE here.
Locked
Bob E
Posts: 72
Joined: Wed Oct 12, 2011 1:37 am

Add "Eject/Close CD ROM" to menu / desktop / panel

Post by Bob E »

Image

This is for Lubuntu and LXDE based distros with one installed CD/DVD drive. (I'm running Zorin Lite 6.2)

FIRST: Open your terminal and make sure the commands work.

To open, enter

Code: Select all

eject cdrom
To close, enter

Code: Select all

eject -t cdrom
If for any reason those commands don't work, try "eject sr0 and eject -t sr0".
(That is sr"zero", NOT sr"capital letter O".)
-------------------------------------------------------------------------------

Next, you have to make two .desktop files.

I'll start with the "Open" file. Open your text editor and add the following information:

Code: Select all

[Desktop Entry]
Name=CD Open
Exec=eject cdrom
Icon=     
Type=Application
Categories=Audio; 
((( Leave "Icon=" blank for now. I'll explain this part shortly. )))

Then save the file as "open.desktop" to any location on your computer that is easy for you to find again.

Now make another one for the "Close" file like this:

Code: Select all

[Desktop Entry]
Name=CD Close
Exec=eject -t cdrom
Icon=
Type=Application
Categories=Audio; 
Save this one as "close.desktop".

Image

Now move both of these files to: /usr/share/applications
(You will have to open this folder as root to add these files.)

Click on your menu button on the desktop panel and look in your "Sound and Video" sub-menu. They should both be there without icons. Click on them to make sure they work.

- If you want them in a different sub-menu, change the .desktop files "Categories" entry.
-- For "Accessories" menu, change it to: Categories=Utility;
-- For "System Tools" menu, change it to: Categories=System;

-----------------------------------------------------------------------------------------------------

Now for the Icon. You can use any icon you want, or even make your own icon image. Do a web search for something you like and stash the image files somewhere on your computer.

Then go to Menu > Sound and Video > CD Close and RIGHT CLICK on CD Close. You will get another sub-menu that says "Add to desktop" and "Properties". Click on Properties and you will get another window called "Application Shortcut". Click on "Change Icon". You will get another window. Click on "Image files" and locate the image file on your computer you want to use. Click on it, then click OK. You will see it has changed on the Application Shortcut window. Click OK.

Then do the same for "CD Open".

Image

-------------------------------------------------------------------------------------------------------

To add them to your desktop, go to Menu>Sound and Video> and right click on one, and in the sub-menu click on "Add to desktop".

To add them to the panel, just add them to the "Application Launch Bar" applet.

-------------------------------------------------------------------------------------------------------

That's it!
Rex Bouwense
Posts: 1093
Joined: Sat Aug 27, 2011 5:44 pm
Location: Sierra Vista, Arizona USA
Contact:

Re: Add "Eject/Close CD ROM" to menu / desktop / panel

Post by Rex Bouwense »

Once again you have posted excellent stuff. Unfortunately I do not have a CD drive on my ASUS EeePC to try it, but I am sure that folks will find this useful if they want those shortcuts on their desktop. Thank you.
Rex
Locked