The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Wrangler::Plugin::ColourLabels - Colour labeling for files and directories in Wrangler

DESCRIPTION

Does what it says on the tin. When activated, this Plugin enables users to label files and folders (arbitrary inodes) with a colour. This has the effect that FileBrowser (and possibly other contexts as well) associate a colour with this file/dir, change it's background colour from usually white to the selected one. This helps users with the organisation of files and folders.

The status of this Plugin is a work-in-progress. OS X interoperability is largely untested.

BACKGROUND

Colour labeling is mostly known to people coming from Macintosh OS X, where Finder allows users to "label" files with a colour, one of 7, mutually exclusive. The actual metadata is written into a file's/ directory's user.kMDItemFSLabel extended attribute (xattr), which means that labeling-info sometimes ends up in the (hidden/ sidecar) file .DS_Store on filesystems that do not support xattribs.

The name "kMDItemFSLabel" seems to come from a vocabulary of Apple internal MDItem* constants, each prefixed with a lower-cased k, then a namespace reference "FS" for a file-system scope, and then the pointer to its function, "labeling". The values of this key range from 0-7, referencing an, again, Apple specific list of colours: None, Orange, Red, Yellow, Blue, Purple, Green, Gray.

As this is pretty much a de-facto standard, with Apple being first here and many people using it and relying on this attribute, this scheme is used as the default internal way Wrangler::Plugin::ColourLabels stores colour labeling information.

Other schemes

On Linux, some file-managers do support file-labeling. The downside is that each implements a different, unportable approach. All of them break with the unwritten law of keeping metadata "as close" to an object as possible. Nautilus at one point allowed files to be emblemised and colour-labeled, storing the data about that in GNOME's GVFS, which maintains an internal database which is queried with every gvfs-info call. But Nautilus dropped support for these functions and even Add-Ons meant to bring that back are currently unusable.

Marlin allows users to "Set a Colour" for directory items, one from a set of 9. The actual labeling information is then saved to a Marlin-specific SQLite database stored in Marlin's per-user ~/.config sub-directory. And this database stores numeric values mapped to a Marlin-internal colour "vocabulary".

Thunar solves this in a very similar way, but takes it one step further by storing labeling information in a proprietary ThunarDB (.tdb) file-database.

Both approaches render file/directory colour labeling as opaque for other applications or services. Upcoming releases of this Plugin here may offer a facility that allows very basic export and/or using of all these stores in parallel.

SEE ALSO

As of this writing, the freedesktop project hasn't proposed any metadata keys for colour-labeling directory items. Compare CommonExtendedAttributes

Apple Spotlight Metadata Attributes

COPYRIGHT & LICENSE

This module is part of Wrangler. Please refer to the main module for further information and licensing / usage terms.