Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Hide Files via Nautilus Right-Click (.hidden file)

  1. #11
    Join Date
    Nov 2007
    Location
    NC, USA
    Beans
    829
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    That's why I used the nautilus variable. It allows for multiple files to be packed into the variable.
    Linux User #460341 || Ubuntu User #19510 || Unanswered Posts Team

  2. #12
    Join Date
    Nov 2006
    Beans
    4

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    Here's a script that works for me under Ubuntu 8.10:

    Code:
    #!/bin/bash
    
    # add filename to .hidden file
    echo "$1" >> "$PWD/.hidden"
    
    #simulate the pressing of the F5 key to refresh the window
    xte "keydown Control_L"; xte "key r"; xte "keyup Control_L"

  3. #13
    Join Date
    Dec 2008
    Location
    Everett, WA
    Beans
    14
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Smile Re: Hide Files via Nautilus Right-Click (.hidden file)

    ryanhaigh,

    I have to say, your solution was flippin great. Worked like a charm. Now I can hide all those pesky files Thanks!

    -cloudstrifejr1

  4. #14
    Join Date
    Sep 2009
    Location
    Michigan
    Beans
    1
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    I have been using Linux (mostly Ubuntu 9.04) for a few months now, but this is my first forum post. I still use Mac OS 10.5 for my main laptop and I have Netatalk and Avahi (as described in this tutorial: http://www.kremalicious.com/2008/06/...achine-volume/ ) to allow me to use AFP between my computers.

    Using Mac OS results in the creation of a ":2eDS_Store" file on any shared directory, I have tried hiding it using the aboved described .hidden method with no luck. Anyone have any other ideas that dont require changing the file name (as it needs to stay named ":2eDS_Store" for Mac OS).

    Thanks in advance, these boards have already proved invaluable with out even posting.

  5. #15
    Join Date
    Feb 2010
    Beans
    1

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    Thank you all for your solutions, now I can hide all those non-dotted Mac OS X generated files!
    As for k6martini's problem, you should edit your /etc/netatalk/AppleVolumes.default file and add to the line of each share "options:usedots"
    ex. for home folder share:
    Code:
    ~/            "Home" options:usedots,upriv
    It creates regular .DS_Store files which are hidden under both Linux and Mac OS X
    I also use the upriv option for the share to use unix privileges, you could although ommit it
    Last edited by Z4mp4n0; February 14th, 2010 at 10:31 AM. Reason: OCD

  6. #16
    Join Date
    Feb 2011
    Beans
    14
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    Quote Originally Posted by PinkFloyd102489 View Post
    ryanhaigh, too much script for a simple action. Open up ~/.gnome2/nautilus-scripts/ and then create a new file with the name of the script you want. Then paste this into it:

    Code:
    #!/bin/bash
    
    touch $PWD/.hidden
    
    echo "$PWD/$NAUTILUS_SCRIPT_SELECTED_URIS" | tee -a $PWD/.hidden
    Much cleaner script and easier to understand what it's doing. Touch creates the file if it doesnt exist. Then the script echoes the name of the file you've right-clicked then appends it to the .hidden file in the directory.
    This is a nice script. I have one problem though. This scripts writes the entire path of the file (even when i remove the $PWD part.)
    for example, it writes "file:///home/pranav/Music/cover.jpg" to the .hidden file. But for the file to hide, we need just "cover.jpg" written in the .hidden file. Can someone tell me how can I remove the other part from the nautilus variable that is being used here?

  7. #17
    Join Date
    Sep 2011
    Beans
    4

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    Quote Originally Posted by pranavkaranjkar View Post
    This is a nice script. I have one problem though. This scripts writes the entire path of the file (even when i remove the $PWD part.)
    for example, it writes "file:///home/pranav/Music/cover.jpg" to the .hidden file. But for the file to hide, we need just "cover.jpg" written in the .hidden file. Can someone tell me how can I remove the other part from the nautilus variable that is being used here?
    use grep

  8. #18
    Join Date
    Sep 2011
    Beans
    4

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    hide hTML folders:

    #!/bin/bash
    touch $PWD/hidden
    find $PWD *_files -maxdepth 0 | tee -a .hidden

    HIde selected:

    #!/bin/bash
    touch $PWD/.hidden
    touch $PWD/.tmp
    echo "$PWD/$NAUTILUS_SCRIPT_SELECTED_URIS" | tee -a $PWD/.tmp
    grep .*/ .tmp|sed /.*\/// > .hidden
    rm -f .tmp

    scripts not debugged!!!!

  9. #19
    Join Date
    Jul 2011
    Location
    South-Africa
    Beans
    678
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    I cant get any one of those two scripts working?

    The first one. I have no idea why its not working? Instead of adding it directly to the menu, I just made a script in the:
    ~/.gnome2/nautilus-scripts
    and set it as executable.

    The second sript gives output of:
    /home/username//home/username/.gnome2/nautilus-scripts/Hide This File.sh
    which doesnt work either...

    Am I missing something? even if I take the $PWD out, it just makes a line saying:
    file:///home/username/.gnome2/nautilus-scripts/Hide This File.sh
    and that doesnt work either... if I manualy delete everything up to "Hide" then it hides the file perfectly fine...

    weird.

    On ubuntu 10.04
    Last edited by zero2xiii; September 14th, 2011 at 02:41 PM.
    Switched away from windows XP to Ubuntu 9.04. Never turned around to look back.

  10. #20
    Join Date
    Sep 2011
    Beans
    4

    Re: Hide Files via Nautilus Right-Click (.hidden file)

    BUGS:

    hide hTML folders:

    #!/bin/bash
    touch $NAUTILUS_SCRIPT_CURRENT_URI/.hidden
    find $PWD *_files -maxdepth 0 | tee -a $NAUTILUS_SCRIPT_CURRENT_URI/.hidden

    HIde selected:

    #!/bin/bash
    touch $NAUTILUS_SCRIPT_CURRENT_URI/.hidden
    touch $NAUTILUS_SCRIPT_CURRENT_URI/.tmp
    echo "$NAUTILUS_SCRIPT_CURRENT_URI/$NAUTILUS_SCRIPT_SELECTED_URIS" | tee -a $NAUTILUS_SCRIPT_CURRENT_URI/.tmp
    grep -P .*/ .tmp | sed 's/.*\///' > .hidden
    rm -f .tmp

    scripts not tested!!!!
    Last edited by yaskhan; September 16th, 2011 at 11:17 AM.

Page 2 of 3 FirstFirst 123 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
  •