Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 67

Thread: [SCRIPT] Easily (un)mounting ISO images without sudo

  1. #11
    Join Date
    Sep 2006
    Location
    Heredia, Costa Rica
    Beans
    45
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    WOW!! This is so cool!! Works great on Debian Lenny. Thank you very much!!!!
    Linux User #431836
    Machine #370145

  2. #12
    Join Date
    Nov 2005
    Location
    Oz
    Beans
    4,408

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    Quote Originally Posted by Milk & Toast & Honey View Post
    Hi, thank you for trying this script!
    I gave it a really good work out last night & it is absolutely brilliant when used to check a dvd.iso that you have just ripped with K9Copy.

    Your script really should be incorporated into Ubuntu I think.

  3. #13
    Join Date
    Jan 2008
    Location
    Romania
    Beans
    403
    Distro
    Ubuntu Development Release

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    Quote Originally Posted by handy View Post
    I gave it a really good work out last night & it is absolutely brilliant when used to check a dvd.iso that you have just ripped with K9Copy.

    Your script really should be incorporated into Ubuntu I think.
    I agree... it would be great for new users. Just one click to mount an .iso
    ...Things To Tweak After Installing Ubuntu 12.04 Precise Pangolin

    http://www.webupd8.org - Daily Ubuntu / Linux news and application reviews.

  4. #14
    Join Date
    Oct 2007
    Location
    Indiana
    Beans
    26
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    First, thanks to Milk & Toast & Honey

    # anybody can tell me how to do this more "right" ?
    isopath=`cat "$isopath" | grep PathToIso | sed "s/PathToIso=//"`
    isopath=$(grep PathToIso $isopath| sed "s/PathToIso=//")


    I took the liberty to adapt this to Kubuntu. I changed the fusemounter dir to $HOME/.fusemounter, if you change this then change the fusemounter script also.
    The template file needs a slight change before you can unmount the iso from the Desktop Icon:

    $HOME/.fusemounter/tpl
    Code:
    [Desktop Action Unmount]
    Exec=$HOME/.fusemounter/fusemounter unmount path.to.iso
    Name=Unmount
    Icon=cdtrack
    
    [Desktop Entry]
    Actions=Unmount
    Encoding=UTF-8
    Version=1.0
    Type=Link
    URL=/tmp/iso.name
    Name=iso.name
    Icon=cdimage
    PathToIso=path.to.iso
    To make it work you need to change file associations in Konqueror:

    Settings -> Configure Konqueror -> File Associations
    Click the + next to applications and scroll down and click on x-iso
    Click Add in Application Preference Order
    Browse to $HOME/.fusemounter/ and click on fusemounter script and click OK
    Back in Application Preference Order select fusemounter and click Edit then click Application tab.
    Change Name to Mount ISO or whatever you like.
    In Command box you should have this:
    /home/<user>/.fusemounter/fusemounter mount %U
    Click OK then Apply.

    The Unmount application is the same except the name will be Unmount ISO and the command will be:
    /home/<user>/.fusemounter/fusemounter unmount %U

    NOTE: This also changes associations for dolphin. Also in the fusemounter script you can change
    browser=konqueror or dolphin if you like.

    Also Works in New KDE4
    To make this work with the new KDE4 only requires a few minor changes to the original procedure for KDE3.

    The file associations are set using System Settings;
    On my computer its KMenu -> System -> System Settings
    Click on Advanced tab then on File Associations.
    Open the Applications and look for x-cd-image.
    Under Application Preference Order you would add /path/to/fusemounter then select fusemounter and Edit. Change the name to Mount and do this one more time and name it UnMount and set the Commands like this:
    Mount command would be /path/to/fusemounter mount %U
    and
    UnMount command would be /path/to/fusemounter unmount %U

    To unmount from the file on the desktop is a little trickier. Maybe there is another way but what I did was to create a new file association, I called it x-fusemounter. The way you do this is under Known Types you click Add, select Applications for the group and choose a unique name, like I said I chose x-fusemounter. Now in the Filename Patterns you click Add and the extension would be *.fusemounter.desktop. You can give it a description if you like. Then in Application Preference Order you add /path/to/fusemounter click OK then select fusemounter and Edit the entry and name it UnMount and change the command to this:
    Command = /path/to/fusemounter unmount-desktop %U

    EDIT:
    Oops! It seems the default action when clicking on the desktop icon is to unmount the iso file which should not be the default. The default action should be to open the mounted iso image with our default browser. To do this we have to add another application to the Application Preference Order in file associations for x-fusemounter.

    Select Add in Application Preference Order. Choose /path/to/fusemounter as the application. Click Ok and then edit the fusemounter entry. I changed the name to Open. Then in the command put this /path/to/fusemounter open %U. Save and Apply.

    Now you have to edit the fusemounter script and add a function to open. Put the function below in the script. I put it right after the conf_open function.

    Code:
    # Open the target dir using default browser
    browser_open() {
    desktopfile="$isopath"
    # $isopath is in the *.iso.fusemounter.desktop file, read the template.
    isopath=$(grep PathToIso $desktopfile| sed "s/PathToIso=//")
    isoname=$(basename "$isopath")
    tmppath="/tmp/$isoname"
    exec $browser "$tmppath"
    return 1;
    }
    Also in the case section add an open) section like this:

    Code:
            open)
                    browser_open
                    ;;
    Make sure when you are done that Open is at the top of Application Preference Order so it will be the default action.


    Making a ServiceMenu
    The Mount and UnMount actions can also be accomplished using a ServiceMenu.

    Code:
    [Desktop Entry]
    Type=Service
    ServiceTypes=KonqPopupMenu/Plugin
    MimeType=application/x-cd-image;
    Actions=MountWithFuse;
    
    [Desktop Action MountWithFuse]
    Exec=/path/to/fusemounter mount %F
    Name=Mount ISO Image with fusemounter...
    Name[af]=Skryf CD of DVD beeld lęer m.b.v. K3b...
    Name[ar]= اكتب صورة على القرص المدمج (CD) او على القرص المرئي الرقمي (DVD) بواسطة  K3b .
    Name[bg]=Запис на CD или DVD образ с K3b...
    Name[bn]=কে-থ্রি-বি দিয়ে সিডি অথবা ডিভিডি ইমেজ লেখো...
    Name[br]=srivań ur skeudenn CD pe DVD gant K3b*...
    Name[ca]=Escriu imatge de CD o DVD amb el K3b...
    Name[cs]=Vypálit obraz CD nebo DVD pomocí K3b...
    Name[da]=Skriv cd- eller dvd-billede med K3b...
    Name[de]=CD/DVD-Abbild mit K3b brennen ...
    Name[el]=Εγγραφή εικόνας CD ή DVD με το K3b...
    Name[eo]=Skribu KD aŭ DVD imagon per K3b...
    Name[es]=Grabar imagen de CD o DVD con K3b...
    Name[et]=Kirjuta CD- vői DVD-tőmmis K3b abil plaadile...
    Name[fa]=نوشتن تصویر دیسک فشرده یا دی وی دی با K3b...
    Name[fi]=Polta levykuva cd- tai dvd-levylle K3b:llä...
    Name[fr]=Graver une image CD ou DVD avec K3b...
    Name[gl]=Escrever unha Imaxe de CD ou DVD con K3b...
    Name[hu]=CD- vagy DVD-képmásfájl írása a K3b-vel...
    Name[is]=Skrifa CD eđa DVD mynd međ K3b...
    Name[it]=Scrivi immagine CD o DVD con K3b...
    Name[ja]=K3b で CD/DVD イメージを書き込み...
    Name[ka]=K3b-ით CD ან DVD გამოსახულების ჩაწერა...
    Name[km]=សរសេរ​​រូបភាព​ស៊ីឌី ឬ​ឌីវីឌី​ដោយ​ប្រើ K3b...
    Name[lt]=Įrašyti CD ar DVD atvaizdą su K3b...
    Name[mk]=Запишете CD или DVD-слика со K3b...
    Name[ms]=Tulis Imej CD atau DVD dengan K3b...
    Name[nb]=Skriv CD- eller DVD-bilde med K3b . . .
    Name[nds]=CD- oder DVD-Afbild mit K3b schrieven...
    Name[nl]=CD of DVD-image schrijven met K3b...
    Name[nn]=Brenn CD- eller DVD-bilete med K3b …
    Name[pa]=K3b ਨਾਲ CD ਜਾਂ DVD ਪ੍ਰਤੀਬਿੰਬ ਲਿਖੋ...
    Name[pl]=Nagraj obraz płyty CD lub DVD na płytę za pomocą K3b...
    Name[pt]=Escrever uma Imagem de CD ou DVD com o K3b...
    Name[pt_BR]=Gravar Imagem de CD ou DVD com o K3b...
    Name[ru]=Записать образ CD или DVD, используя K3b...
    Name[sk]=Zapísať obraz CD alebo DVD pomocou K3b...
    Name[sr]=Упиши CD или DVD одраз помоћу K3b-а...
    Name[sr@Latn]=Upiši CD ili DVD odraz pomoću K3b-a...
    Name[sv]=Skriv cd- eller dvd-avbild med K3b...
    Name[tg]=Сабт кардани тасвири CD ё DVD бо истифодабарии K3b...
    Name[tr]=K3b ile CD ya da DVD görüntüsü Yazdır...
    Name[uk]=Записати штамп КД або DVD у K3b...
    Name[uz]=K3b yordamida CD yoki DVD tasvirini yozish
    Name[uz@cyrillic]=K3b ёрдамида CD ёки DVD тасвирини ёзиш
    Name[zh_CN]=用 K3b 刻录 CD 或 DVD 映像...
    Name[zh_TW]=使用 K3b 燒錄 CD 或 DVD 影像...
    Icon=cdimage
    Paste the above code into a file called fusemounter-mount-iso-image.desktop. Make a copy called fusemounter-unmount-iso-image.desktop then edit it and change these lines
    Code:
    Actions=UnMountWithFuse;
    
    [Desktop Action UnMountWithFuse]
    Exec=/path/to/fusemounter unmount %F
    Name=UnMount ISO Image with fusemounter...
    Now put both of the files in /usr/share/kde4/services/ServiceMenus/

    Make sure you correct the /path/to/fusemounter to match your system.
    Last edited by #!/bin/bash; June 19th, 2009 at 04:25 PM. Reason: Oops I thanked the wrong person.

  5. #15
    Join Date
    Nov 2005
    Location
    Oz
    Beans
    4,408

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    Quote Originally Posted by nilarimogard View Post
    I agree... it would be great for new users. Just one click to mount an .iso
    Why just new users?

    Do the old users prefer to do things the slow way?

    I expect that there are only a tiny percentage of computer users that would not want to take advantage of such an elegant script that mounts & unmounts .iso's in one click of the left mouse button.

  6. #16
    Join Date
    Mar 2007
    Beans
    9

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    Nice work! What is your gtk2 theme? I like it!

  7. #17
    Join Date
    Jul 2007
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    Hi all, thank you for the comments and for using this script!
    I hope this script can be very helpful for many people, so it can be incorporated to Ubuntu or should I fill some form?
    Your comments really gives me spirit, thank you.


    Quote Originally Posted by #!/bin/bash View Post
    isopath=$(grep PathToIso $isopath| sed "s/PathToIso=//")
    Thank you for this! I really forget that "grep" can read files on it's own. Also, thank you for taking the time to adapt this script for Kubuntu, I'll update the first post to refer to your post.

    Quote Originally Posted by resadent
    Nice work! What is your gtk2 theme? I like it!
    I'm using:
    - aero-clone for the "Controls Theme".
    - Murrina-AeroSky for the "Window Border Theme".
    - nuoveXT 2 for the "Icon Theme".
    Mount ISO/MDF/NRG with right-click to your desktop

    Do NOT do or even type "sudo rm -rf anything" or "rm -rf anything", if you're not sure what it'll do.

  8. #18
    Join Date
    Nov 2005
    Location
    Oz
    Beans
    4,408

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    Your script should be incorporated into Hardy, I don't know how to do it, I will ask how, you should too Milk & Toast & Honey.

  9. #19
    Join Date
    Oct 2007
    Location
    Indiana
    Beans
    26
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: [SCRIPT] Easily (un)mounting ISO images without sudo

    The Kubuntu version will probably work on any KDE based distro. I have checked it on Slackware-12.0 and VectorLinux-5.9 and they both work.

  10. #20
    Join Date
    Nov 2005
    Location
    Oz
    Beans
    4,408

Page 2 of 7 FirstFirst 1234 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •