Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] kde iPod device icon, eject without rmmod sbp2
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message

Joined: 22 Sep 2004
Posts: 33
Location: Seattle, WA

PostPosted: Sat Apr 23, 2005 11:54 pm    Post subject: [SOLVED] kde iPod device icon, eject without rmmod sbp2 Reply with quote

I posted a few weeks ago that I discovered that the eject app can eject an iPod just like iTunes does. In all of the Linux iPod docs I've read they say to rmmod the sbp2 module to get the iPod to switch from the "Do Not Disconnect" mode to the "Ok to Disconnect" mode. You don't have to do that.

I've got my iPod connecting via firewire (I assume the USB will work this way as well) and it shows up as scsi device /dev/sda2. I wanted to have a device icon on my KDE desktop that had both the mount and eject options available in the right click menu for convenience.

First start off by creating a new link to a hard drive device by right clicking on your desktop and selecting: create new > link to device > hard drive device... Go ahead and name it iPod and go find a cool iPod icon to use and change the device path on the device tab to be the location of the iPod device node; in my case it is /dev/sda2.

Now if you right click on the iPod device node you will notice that it has a mount option but no eject. That's fine, you're going to add the eject option manually. Go find the config file for your device link. It should be in a folder called Desktop or where ever you have the KDE desktop folder set to. Open it up in a text editor and make it look like the following:


[Desktop Action Eject]
Exec=sudo eject %v

[Desktop Entry]

The section starting with [Desktop Action Eject] defines the Eject action. Then down under the [Desktop Entry] section be sure to add Actions=Eject to add Eject to the right click context menu for the device icon.

You'll notcie that the command to execute for eject is: sudo eject %v. This is because the eject application must be run by root for it to have sufficient permissions to eject the iPod. I guess that a uDev rule could be written to set the dev node permission correctly to allow users to run eject directly, but I'm unfamiliar with uDev and sudo is the easier way around the problem.

To complete the hack you've got to modify your /etc/sudoers file to give you the permission to sudo the eject application. Here's what I added to my /etc/sudoers file:


Cmnd_Alias              IPOD_EJECT = /usr/bin/eject /dev/sda2
your_username   ALL=IPOD_EJECT

That's it. Now you'll have an Eject option in your right click context menu and it will run sudo eject on your iPod device file and eject your iPod.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum