Yet another way to mount Windows shared folder on Linpus

Discussion in 'Linux' started by Guest, Oct 19, 2008.

  1. Guest

    Guest Guest

    Hi,

    Just received my brand new Aspire One A110L and really love it!

    Wanted to share with you a simple hack that allows one to access any folder shared on a Windows PC from the "Files" section on a default Linpus interface:

    1) create a new file /root/windows-share.sh (replace //192.168.1.100/BitTorrent with the IP address and a shared folder name of your setup):
    Code:
    #!/bin/bash
    /bin/df -k | /bin/grep /mnt/windows > /dev/null
    if [ $? != 0 ]; then
        sudo /sbin/mount.cifs //192.168.1.100/BitTorrent /mnt/windows -o guest
    fi
    /usr/bin/launch-thunar.sh /mnt/windows
    2) make this file executable: chmod 755 /root/windows-share.sh

    3) create a new desktop file /usr/share/applications/Windows.desktop:
    Code:
    [Desktop Entry]
    Name=My Windows Share
    Comment=Files shared on Windows PC
    Exec=/root/windows-share.sh
    Icon=mydownload.png
    Terminal=0
    4) add the new entry to the "Files" section on a default Linpus interface by adding the following line to the group 8 in /home/user/.config/xfce4/desktop/group-app.xml file (replace 6 by the first free sequence number):
    Code:
    <app sequence="6">/usr/share/applications/Windows.desktop</app> 
    Voila, you've got a new icon in "Files" section of the default Linpus interface that, when clicked, mounts your windows share and opens it in a new file manager window.

    Enjoy,
    Alex
     
    Guest, Oct 19, 2008
    #1
  2. Guest

    tiggerman

    Joined:
    Oct 30, 2008
    Messages:
    5
    Likes Received:
    0
    Hi,

    This looked really elegant but I am failing to follow the steps, being a bit of a newcomer to Linux. I suspect I am getting the syntax wrong or not appreciating one of the steps.
    Basically, I am OK until I get past entering line 2 ending "> /dev/null".
    Thereafter, at the end of each line (exactly as you have them) I hit return and just get > rather than a return to "root@localhost #". Each line I enter thereafter seems to do nothing and I get to the end of the 1st section of your script and seem ot have created nothing.
    Attempts to do stage two also just get ">" lines generated.
    Equally, your step 3 - is the script to create the file that you head the section with or do you have to do that first before actioning the script, and if so how?

    Sorry if I am being very dense but I have been struggling for ages to get my One to network without much success and this very attractive.

    Any help appreciated,

    John
     
    tiggerman, Dec 19, 2008
    #2
  3. Guest

    Guest Guest

    Hi John,

    I guess I wasn't clear enough that the "code snippets" are actually the content of the new files that you create.
    You can use mousepad to do the job - e.g. type sudo mousepad /root/windows-share.sh, copy-paste the content into it, save the file and close the window. Then repeat the same for the 2nd file.

    As for the last bullet (adding new entry to the menu) - you can use the following command instead:
    Code:
     dca add 13 "file='/usr/share/applications/Windows.desktop'"
    And you even won't need to reboot - the new entry will be immediately available.

    Cheers,
    Alex
     
    Guest, Apr 15, 2009
    #3
  4. Guest

    Gru

    Joined:
    Jul 21, 2008
    Messages:
    26
    Likes Received:
    0
    Hello,

    It has been a while since this was posted, but I just used the method and it worked great.

    I was not seeing any files so I had to add SUDO in front of

    /usr/bin/launch-thunar.sh /mnt/windows

    under fi section.

    Now I am am able to see the files. The only problem is that it takes a minute or two for process to finish. Is there a reason for this, and is there a way to speed this up?

    So once I double click the folder under Files, it takes 2 minutes for it to open...

    Thanks!
     
    Gru, Jul 8, 2009
    #4
  5. Guest

    Guest Guest

    Very strange... It takes a few seconds on my Aspire One...
    Can you try to manually execute
    Code:
    sudo /sbin/mount.cifs //192.168.1.100/BitTorrent /mnt/windows -o guest
    command from the "Terminal" and see whether it's the one that's taking so long?
    And, by the way, do you use IP address or hostname to specify your Windows PC?
     
    Guest, Jul 9, 2009
    #5
  6. Guest

    Jace

    Joined:
    Jul 17, 2009
    Messages:
    2
    Likes Received:
    0
    Nice One Alexgr.

    Worked a treat!

    :cool:
     
    Jace, Jul 17, 2009
    #6
  7. Guest

    ed_o_brain

    Joined:
    Dec 31, 2008
    Messages:
    5
    Likes Received:
    0
    Worked a treat for me.
    Thank you!
     
    ed_o_brain, Jul 26, 2009
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.