Announcement

Collapse
No announcement yet.

eject ipod automatically

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    eject ipod automatically

    I would like to be able to write a script which I can run as user which would eject my ipod. The command is eject /dev/sda, but it requires root permissions. I can always write the script and then call it with sudo, but then I have to type in the password etc. and what I really want to do is associate it with a button on the taskbar. In my previous os: slackware 10.0, I added an entry in the sudoers file which gave me root permissions when running "eject" without having to enter my password. But I can't find a sudoers file in kubuntu.
    Does anyone have a solution?

    Thanks.

    #2
    Re: eject ipod automatically

    Theoretically, you shouldn't have to write that script.
    Can't you just right-click the iPod desktop icon and select "safely remove"?
    Linux is ready for the desktop--but whose desktop?<br />How to install software in Kubuntu

    Comment


      #3
      Re: eject ipod automatically

      Actually no you can't it will be unmounted BUT your ipod will still write Do not disconnect.
      you have to type sudo eject /dev/sda2 to eject your ipod.

      What I did , I created a small shellscript to do that and created a shortcut in my taskbar.

      Bu now with amarok 1.3 you can actually mount and unmount the Ipod directly in the configuration of the Media Device you an set the mount and the unmount command and use the Button inside Amarok

      Hope it helps a bit

      Comment


        #4
        Re: eject ipod automatically

        Read this thread please:
        http://www.ubuntuforums.org/showthread.php?t=56515

        It's working for my iPod. Maybe it's a G3 vs. G4 issue. There have been a couple of people on the Ubuntu Forums who haven't been able to GUI eject a G4 iPod.
        Linux is ready for the desktop--but whose desktop?<br />How to install software in Kubuntu

        Comment


          #5
          Re: eject ipod automatically

          Originally posted by !nkubus

          >What I did , I created a small shellscript to do that and created a shortcut in my taskbar.

          Right, that's what I'm trying to do. The problem is how do you give the shellscript root privileges so that you can run it as a user? (Please excuse my bash ignorance, I suppose that's the real problem).

          Comment


            #6
            Re: eject ipod automatically

            I figured it out. There *is* a sudoers file (of course), it just doesn't show up with "locate" unless you have root privileges. It's in the usual place, /etc/sudoers. So I edited the sudoers file and added the entry "[myusername] ALL = NOPASSWD: /usr/bin/eject", and it works fine. Then I create a script with "sudo eject /dev/sda" in it and place it in the menu or on the taskbar.

            Comment

            Working...
            X