Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want that whenever I open Rhythmbox player It will auto mount the Windows Partition where all my music files are placed. Is there anyway I can invoke the mounting of Windows partition in the .desktop file

Please note that I don't want to automount windows partition on every login. I just want the windows parition to be mounted automatically whenever I open rhythmbox player.

Thanks in Advance.

share|improve this question
    
Maybe a script can help you do that but I'm no script expert so is just an idea. –  Engels Peralta Dec 15 '11 at 14:12

1 Answer 1

You could build a little shell script "/usr/local/bin/myrythmbox" like #!/bin/bash
mount /media/musicfiles
rythmbox (or however the commandline would be for starting it ina terminal)
umount /media/musicfiles

This would first mount the drive, start your player and when that is "done with", unmount the drive again. For this to work, you would need to do three things:

  1. add an entry in fstab mapping your music partition to an (empty) folder /media/musicfiles, making it available for non-roots /dev/sda8 /media/musicfiles noauto,user,unhide(...otherOptionsIGuess) 0 7
  2. find out the commandline name of rythmbox
  3. chmod u+x "/usr/local/bin/myrythmbox" to make it executable and put a link to the script into your menu or onto your desktop/starterpage.

I am not quite sure as for the line in the fstab regarding the "otheroptions", but "noauto" should keep the system from mounting the drive automatically and "user" allowing it non-roots to mount it.

Hope that helps,

share|improve this answer
    
Thanks ....... I 'll try it :-) –  Aamir Dec 15 '11 at 15:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.