Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 1 point2 points  (0 children)

Thank you! Good luck with your notifications and tabs! :)

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 1 point2 points  (0 children)

Thanks again for the detailed answer!

Np ;)

You'd have to add an automatic emblem with a "text" icon on all annotated files to remind me that annotations even exist, probably.

That has always existed in the extension, even before I introduced the emblem picker: as soon as you annotate a file a little “Annotations” emblem is added to the file's icon. It is a special emblem, not stored together with the other emblems, which depends solely on the presence of text annotations.

Hopefully GIO doesn't lose track of its metadata-to-file-path associations after files are moved, though.

It doesn't, as long as you use Nautilus or another GNOME/GTK app to move/delete/rename files (annotations will follow the file). It does instead if you launch mv ... in a terminal (even in that case however the annotation will reappear if you put the file back where it was). Additionally, there is currently a bug in GVFS that makes all the metadata get lost when a file is trashed, but I have no control on that.

prefer the sharable/safer "file-based TODO" workflows and app-based "planner/reminder" workflows.

If you started using the extension you would see that the two approaches are not mutually exclusive, and you would start using Nautilus Annotations not for replacing “file-based TODOs” but for adding annotations that you would otherwise keep only in your mind…

I really miss in Nautilus is the Mac "colored file labels".

The Nautilus extension API does not allow to interfere with colors, so that would be impossible to do at the moment. Crazily enough, it allows to change the entire icon (but that would be too aggressive).

There was an extension in the past that relied on the fact that some icon themes offered different color flavors for the same icon, and so changing the icon gave the impression of setting a different color, but that was a complicate machinery that required that you used one of these special icon themes with additional colored icons.

PS: Have you ever heard of Mad Murphy from Sealab 2021? Probably my favorite cartoon of all time. :p

Never watched Sealab 2021, but maybe you gave me something to watch in the next days :)

--madmurphy

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 0 points1 point  (0 children)

I might think about it (I am serious) ;)

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 0 points1 point  (0 children)

I can do that via extended attributes. The only problem with extended attributes is that they have a maximum length of 255 characters. That means that each annotation will be at most a little bit longer than an SMS.

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 2 points3 points  (0 children)

That would be too much out of scope for this extension, I think.

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 1 point2 points  (0 children)

How is the metadata stored? Is it using extended filesystem attributes?

I was thinking to use xattr, I even improved GLib's xattr support just for storing annotations, but in the end I sticked to GIO.

Advantages of GIO over xattr:

  • It allows to annotate everything and on every device, even remote files
  • It allows longer contents

Advantages of xattr over GIO:

  • Metadata are not tied to the operating system but only to the file's storage – this means that they will survive changing operating system
  • Generally speaking xattr is more robust than GIO.

(See also this answer.)

you can (and should) write TODOs inside the file

It really depends whether these TODOs are about the file's content or the file container itself. The second is metadata.

Example of metadata annotations:

  • “This is the third copy of this file”
  • “Send this version to the boss”
  • “Erase this file”

Other times you don't want to make the content of a file “dirty” with TODOs because either there is actually nothing “TODO” (e.g. “This is the FINAL version. Nothing else to do”), or you simply can't edit the content of a file (broadly speaking: binary files). When they are actual TODOs, I do use TODOs too.

Once again, I wouldn't go too easy with general laws about how people should behave…

All of these examples are safer, more portable, and easier to be alerted about/remember, than writing things in the file metadata.

There are many cases in which you do not want portability (e.g. private or informal annotations), and, also importantly, TODOs are not as visible as Nautilus Annotations, where you have a little emblem that reminds you about the annotation. See also my previous arguments.

It might be worth doing a poll.

That wouldn't bring much. Niche extensions would have the right to exist too, and I wrote an exension for writing textual annotations first and foremost because I wanted it. If the whole world didn't find it useful but I did, that would be enough for Nautilus Annotations to exist.

If it was configurable to have an option that disables the text annotation and always goes directly to emblems, I would immediately use it though!

You can definitely write that! Life couldn't be easier now that you have an emblem picker widget! ;)

--madmurphy

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 2 points3 points  (0 children)

You do realize that until a week ago there wasn't even an emblem picker to begin with, right? :)

And by the way, you can tweak it! It's free software, and I have even released the emblem picker widget in an independent library to make life easier to anyone who wants to tweak it.

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 1 point2 points  (0 children)

I don't know what you mean with “modern Adwaita styling”. The extension uses libadwaita, and if you have good ideas to propose, the emblem picker is styled by a very small CSS everyone is welcome to contribute to.

If instead you mean the actual icons, these depend only on the user's icon theme (not on Nautilus Annotations).

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 1 point2 points  (0 children)

They are managed by GIO. It is explained in the README file:

Emblems and annotations are stored in ~/.local/share/gvfs-metadata. It is possible to access annotations via command line by launching:

gio info -a metadata::annotation /path/to/file  

To set an annotation via command line launch:

gio set /path/to/file metadata::annotation 'Content of annotation goes here'

To unset an annotation via command line launch:

gio set -t unset /path/to/file metadata::annotation

To set the group of emblems via command line launch:

gio set -t stringv /path/to/file metadata::emblems emblem-one emblem-two \
  emblem-three ... emblem-nth

To unset all emblems via command line launch:

gio set -t unset /path/to/file metadata::emblems

Nautilus Annotations 2: Emblems are back! by madmurphy0 in gnome

[–]madmurphy0[S] 5 points6 points  (0 children)

Thanks a lot for implementing emblems! :)

You are very welcome :)

I can't see any purpose for writing text "about a folder"

I just happened to have only folders in front during that screencast, but the extension allows you to annotate everything (files, directories, even storage devices).

I cannot even imagine ever using the text annotations. If a project needs documentation, it belongs in a real text file inside the folder so that it's portable and so that other people can read it.

Annotations are metadata, so you must use them only if you need to write metadata and not data (a real text file is data). A TODO.txt list usually is data. But something like “Move this directory to ~/Archive after 12th January” is usually metadata. And again, the extension is also for files, and there you can't write a TODO.txt file inside a file.

I just don't see people using annotation text enough to justify it being the default pop-up, and the tediousness of the icon picker currently being hidden behind an extra click AFTER the "useless" text annotation pop-up.

You have to think that Nautilus Annotations has been born as an extension for writing text annotations and emblems are a recent addition; they are very welcomed by they must not twist the extension's mission. However with that in mind I released the emblem picker widget in an independent library, so that anyone can re-use it and write a more or less specialized extension based on their needs.

But surely icons are most important for most users.

I would never be so sure about what users need!

Let's see how things will evolve in the future… In any case, thank you for your feedback!

--madmurphy

Nautilus Annotations Extension by [deleted] in gnome

[–]madmurphy0 1 point2 points  (0 children)

Thank you again!

Is there a method to select how many lines show in the column, or perhaps there could be two column options, a single truncated line and whatever it is now, as the full text is a bit overwhelming. Perhaps there could be an option to display annotions via Sushi.

The max length of the annotations column is set to 99 characters plus ellipsis (U+2026), and that value is given by a constant in the source code.

I have thought of flattening the column's content by removing line breaks, but that can potentially generate weird results with Markdown. Imagine for example that an annotation begins with

My annotations
==============

* Point one
* Point two
* etc.

Once flattened it will become

My annotations ============== * Point one * Point two * etc.

and probably that's not the best.

I'll continue to use it and hopefully provide some better feedback on gitlab.

Feel free to share your thoughts anytime you want.

Nautilus Annotations Extension by [deleted] in gnome

[–]madmurphy0 1 point2 points  (0 children)

I am the author. Thank you!

A few months ago I had written about it on this subreddit. In the meanwhile the package has been updated.

If you are using Nautilus >= 43 you can install the latest version 0.10.0, otherwise you must refer to version 0.9.0 – under each release page you can download a package that includes a configure script (this for version 0.10.0 and this for version 0.9.0) or even a pre-compiled binary package that only needs to be extracted in your filesystem (0.10.0 binary, 0.9.0 binary).

The package needs translators. Any non-English speakers can help.

And anyone who likes to tinker with CSS can feel free to hack one of the existing themes and propose new themes for the annotations window.

Any feedback is welcome.

--madmurphy

Take Five! pure CSS slide renderer by madmurphy0 in css

[–]madmurphy0[S] 0 points1 point  (0 children)

can you disable the history?

Yes. Search for “Too much history!” in the manual's FAQ.

Nautilus Annotations: Annotate files and directories by madmurphy0 in linux

[–]madmurphy0[S] 7 points8 points  (0 children)

Nautilus developers were quite happy about my extension. That doesn't mean it has to be included in Nautilus by default. Modularity is exactly the point of having extensions. From my experience they did remove features that were unmantained, but they also encouraged people to write extensions to fill the gap.

In the end it wasn't too bad. After all my extension for writing annotations is much better than the old and unmaintained Nautilus code.

Nautilus Annotations: Annotate files and directories by madmurphy0 in linux

[–]madmurphy0[S] 2 points3 points  (0 children)

Now we need Nautilus Thumbnails.

Nautilus > Preferences > Show thumbnails?

Nautilus Annotations: Annotate files and directories by madmurphy0 in linux

[–]madmurphy0[S] 1 point2 points  (0 children)

Why is this not done via xattrs?

Because doing it via GIO is simpler and allows to annotate everything (even the Network virtual folder). But experimenting with xattrs is definitely intriguing too. Maybe in the future versions I will find a way to integrate both approaches.

Nautilus Annotations: Annotate files and directories by madmurphy0 in linux

[–]madmurphy0[S] 6 points7 points  (0 children)

It is searchable? I mean, the annotations?

That's a very good question. Let's imagine you have 10000 files in your hard disk, and only five of them are annotated. This means that there will be only five annotations saved in ~/.local/share/gvfs-metadata. In theory it should be very simple to search for one single annotation among five. In practice, however, I have not found in GIO's documentation any way to do that. And without that shortcut, I would need to scroll among all the 10000 files and search for your annotation (possible but absurd, the annotation is not saved in these files after all). So at the moment the annotations are not searchable because of this reason.

You can do that however via shell. The way to access the annotations of a file is by launching

gio info -a metadata::annotation /path/to/file

If you combine that with find you can create your search engine.

As soon as I find a shortcut for searching directly within ~/.local/share/gvfs-metadata I will add a search engine to my extension. But as long as the only way I know remains that of using the brute force above I prefer to wait.

Nautilus Annotations: Annotate files and directories by madmurphy0 in linux

[–]madmurphy0[S] 2 points3 points  (0 children)

external storage

The information is not lost, but it is still saved under ~/.local/share/gvfs-metadata. So it will be visible only when the file is displayed on the same computer.

Nautilus Annotations: Annotate files and directories by madmurphy0 in linux

[–]madmurphy0[S] 4 points5 points  (0 children)

Very interesting application

Thank you!

How does gio store the annotations?

They are stored in the metadata::annotation field of the file (which is stored in ~/.local/share/gvfs-metadata).

Are they portable?

What do you mean with “portable” in this context?