How can you set tags on files on Ubuntu?
I want to tag all kind of files:
- Images
- Audio
- Text
- Office
- Directories
The only solution I found was MetaTracker.
But this projects seems to be dead.
How can I solve this desktop issue?
It would be mind blowing super great if you could sync these tags with a server like nextcloud.
The best way seems to be the tagging file system tagsistant.
From the homepage:
This seems to me the most consistent and elegant approach for file tagging on Linux. It's around for more than 10 years, so it's a mature solution as well, without the risk of disappearing soon.
A similar question was asked previously: Selecting files from different folders
The accepted answer with 6 up-votes was "No, unfortunately it is not possible.".
Refusing to be dissuaded I wrote a bash script to tackle the problem.
Bafman Begins
In response to the question I developed
bafman
(Born Again File Manager) which was only somewhat successful because there was little interest in the answer.There are 13 screens in the answer, so here is one of them to give you the idea:
Bafman Returns
The bash code was posted in a separate answer below the first but revisions made it too large to fit within the 30K limit so the answer was deleted. If someone is interested in the bash script I'd be happy to resurrect the project and post it in github.
If the files you are looking to tag are hosted in Nextcloud for file sharing, then you can use the Nextcloud files automated tagging app along with manual tagging.
Automated tagging
The official description reads:
It works for Nextcloud 12 and 13.
Manual tagging
And here you can see how the manual tagging of files is available since Owncloud/Nextcloud 9.x using the file manager in the web view.
GOTCHA
If you wish to search the tags through the Ubuntu desktop file manager, then this might not work unless you use WebDAV to mount the network share and do something with the Nextcloud WebDAV API.
I needed to tag files too and decided that in the absence of a built-in way of doing it, I would implement my tags in the filenames of files. That way you have the full power of bash expressions to search for files with particular tags, there is no issue of cp and mv etc losing the tags, and the tags are visible in a gui file manager.
For example you could decide to add (tag1,tag2...)" to the end of each of the filenames.
Edit: this suited me well where my tags were more to indicate file membership of one or more of three groups. For a more general tag application an easier syntax to use (with bash etc) at the end of filenames would be something like "filename !tag1 !tag2".