Setting attribute visibility programmatically

Is it possible to set custom Tracker file attributes programmatically?

I’ve tried adding the following, but when my app opens a Tracker window the attributes are not visible unless I use FileTypes to add them and mark them as visible:

attributes.AddBool("attr:visible", true);

https://git.sr.ht/~politebot/Zed/commit/fafff1fd56d64674a06def76313824789237a24b

To my understanding, you need to add the indexes to the filesystem where your files will live.

Here’s how I implemented that in my playground app:

1 Like

I’m pretty sure Tracker can display attributes that aren’t indexed - as you know, because FileTypes can make them visible.

1 Like

Name is attr:viewable.

1 Like

I may have misused the feature, but my experiments on the subject lead me to understand the contrary. Maybe I faced bugs of the Tracker, I had many strange behaviour when I was playing with it.

It’s only after crawling the people app that I deduced the need to create indexes on the FS so they would appear in the Tracker window

1 Like

The attribute columns that you can add to a Tracker window are tied to the file file type identified. But it makes no sense to display all attributes in columns, some are only visible in attributes tab of Tracker file information window.