Wednesday, January 05, 2005

the .hidden trick


hide | show
Hi there, here's a new tip of the day;

You can hide files/folders from showing up in nautilus by creating a file with the name .hidden in the directory where those files/folders are and adding lines to it with the name of the file/folder you want to hide. This come in handy if you use your home-directory as Desktop directory (you can do this in gconf if you want to) and don't want to see e.g. the Evolution directory.

ciao!

Labels:


2 Comments:

Blogger Karel Demeyer knowledgely replied ...

I'm glad I could help you. I have more tips to blog about and some drafts for full articles to publish after my exams! thanks for reading and commenting on my blog. Spread the word ;)

6:10 PM, January 05, 2005  
Anonymous Anonymous knowledgely replied ...

I wrote this nautilus script to easily hide files from view.

#!/usr/bin/env python
#
# (c) Wouter Bolsterlee <uws@xs4all.nl>
#
# DESCRIPTION
# This script appends the names of the selected files to a .hidden
# file, so that they won't show up in Nautilus.
#
# INSTALLATION INSTRUCTIONS
# Copy this file into ~/.gnome2/nautilus-scripts/ and make it
# executable. The script will show in the "Scripts" context menu in
# Nautilus (right-click on a file).
# This script was originally written for nautilus 2.8, although
# other versions may work too.
#
# VERSION HISTORY
# v1.0 (2005-01-10): Initial release.
#
# LICENSE
# Creative Commons Attribution-ShareAlike 2.0; see
# http://creativecommons.org/licenses/by-sa/2.0/ for more
# information.
#

import os, os.path, sys
from urllib import unquote

prefix = 'file://'
dot_hidden = os.path.join(os.environ['NAUTILUS_SCRIPT_CURRENT_URI'], '.hidden')

# only works for local files:
if dot_hidden.startswith(prefix):
# strip off the prefix and remove %xx sequences:
dot_hidden = unquote(dot_hidden[len(prefix):])

names = sys.argv[1:]
if len(names) > 0:
# append the names to the file
f = file(dot_hidden, 'a')
for name in names:
name = unquote(name)
f.write('\n%s\n' % name)
f.close()

2:00 PM, January 11, 2005  

Post a Comment

<< Home

-->