Install nautilus-actions using whatever your normal method is (or just click the link)
Save the following code in /home/yourusername/.hidefile.sh or just save the attachment which is the same thing.
Code:
#!/bin/bash
#bash script to be called from nautilus actions
#change to the directory where the file is
cd "$1"
#the filename passed as the argument is added to the .hidden file
echo "$2" >> ./.hidden &&
#simulate the pressing of the F5 key to refresh the window
xte "key F5"
exit
Then make it executable, open terminal then:
Code:
chmod +x ~/.hidefile.sh
Open nautilus actions configuration (system>preferences>nautilus actions configuration) and add a new action with the following:
Menu Item And Action
Label: Hide This File
Tooltip: Add file to .hidden so that it is hidden
Icon: usr/share/pixmaps/nautilus/erase.png
Path: /home/
YOURUSERNAME/.hidefile.sh
Parameters: %d %f
Conditions
Filenames: *
Mimetypes: */*
Selection Contains: both
Multiple Files: unchecked (no)
Advanced Conditions
Only local files
Restart nautilus by pressing alt-f2 and entering nautilus -q to quite (don't do this if you are currently copying files etc) then open go to places > home or any other location to restart. Alternately you can just logout and back in. Now when you right click on a file or folder there will be a Hide This File option.
Bookmarks