Re: Option to show dotted files/directories with specific colors/icons



On 07/01/2008, Alexander Larsson <alexl redhat com> wrote:
> > I have been looking around the web for a way to display hidden files
> > and folders with icons (or colors, or label applied on the icon as it
> > is done for the symlinks) slightly different from regular visible
> > files and folders.

> This sounds like a very good idea. Unfortunately its not currently
> possible with nautilus.

You can do some things like this. I've just attached a script (needs
the nautilus python extension, then drop it in
~/.nautilus/python-extensions and restart nautilus) that marks any
files that start with a "." with a "generic" emblem. Admittedly, this
then means duplicating the "what's a hidden file" logic, it only works
with local files, and changing the emblem can only currently be done
by editing the script, but it illustrates the basic idea.

Tom
from os.path import basename
import nautilus

class DotEmblem(nautilus.InfoProvider):
	def __init__(self):
		print dir(self)
		pass

	def update_file_info (self, f):
		pth = f.get_uri()[7:]
		if f.get_uri_scheme() != 'file':
			return
		if basename(pth)[0]!=".":
			return
		try:
			f.add_emblem('generic')
		except KeyError:
			pass
		


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]