* tss, a tool to manage files with filename tags
@ 2023-07-28 20:12 Johan Grande
2023-07-29 12:57 ` Thomas Lauer
0 siblings, 1 reply; 5+ messages in thread
From: Johan Grande @ 2023-07-28 20:12 UTC (permalink / raw)
To: zsh
Hi all. I thought I should present what I've been working on for the
past weeks.
This is my first time developing anything half-serious in zsh. I'd love
some thoughts on it or even a code review if anybody feels like it.
I took this project as an exercise and aimed to write as clean and
robust code as I could, offer decent completion (though I admit I only
understand the most simple features of the system), and have automated
testing for the core features.
The code: https://github.com/nahoj/tss
git clone https://github.com/nahoj/tss.git
## What it does
tss is a tool to tag and find files with tags à la TagSpaces (a
graphical tool), i.e., tags in file names such as "IMG-2653[vacation
alps].jpg".
As you can guess, one can perfectly manage such files without any
specialized tool, which was part of the appeal of this tagging system to
me. But after a couple of years of tagging my files half in TagSpaces,
half by hand, I thought a dedicated CLI tool would be handy after all.
$ ls
IMG-2653.jpg
$ tss add 'vacation alps' IMG-2653.jpg
$ tss files -t 'alps' *
IMG-2653[vacation alps].jpg
$ cp "IMG-2653[vacation alps].jpg" "IMG-2653_copy[vacation alps copy].jpg"
$ tss files -t 'alps' -T 'copy' * # or --tags 'alps' --not-tags 'copy'
IMG-2653[vacation alps].jpg
### Glob patterns
$ tss remove 'v* a*' "IMG-2653_copy[vacation alps copy].jpg"
$ find | tss filter -t '(alps|pyrenees)'
./IMG-2653[vacation alps].jpg
### Completion
$ tss query -t tag1 <tab> # Files with tag1
$ tss query -t tag1 path/ -t <tab> # Tags found on files that have tag1
in path/
$ tss add tag1 <tab> # Files that don't have tag1
Best,
--
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: tss, a tool to manage files with filename tags
2023-07-28 20:12 tss, a tool to manage files with filename tags Johan Grande
@ 2023-07-29 12:57 ` Thomas Lauer
2023-07-29 13:51 ` Johan Grande
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Lauer @ 2023-07-29 12:57 UTC (permalink / raw)
To: Johan Grande; +Cc: zsh
----original message----
From: Johan Grande <nahoj@crans.org>
> ## What it does
>
> tss is a tool to tag and find files with tags à la TagSpaces (a
> graphical tool), i.e., tags in file names such as "IMG-2653[vacation
> alps].jpg".
I am also a great friend of having consistent and "easily findable"
files, esp for my music and the photos/videos of my travels etc so this
looks interesting.
So far, I'm using a superb replacement for the find command, called fd:
https://github.com/sharkdp/fd
This is a pretty well-thought out tool IMO and it's fast. (Another very
fast search tool that's become indispensable is ugrep:
https://github.com/Genivia/ugrep
but that's a different kettle of fish.)
fd, with a number of aliases and zsh functions I've defined, does a very
good job of locating (my variety of) tagged files; it'll be interesting
to compare this with your approach.
THX for sharing.
--
T
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: tss, a tool to manage files with filename tags
2023-07-29 12:57 ` Thomas Lauer
@ 2023-07-29 13:51 ` Johan Grande
2023-07-30 17:34 ` Thomas Lauer
0 siblings, 1 reply; 5+ messages in thread
From: Johan Grande @ 2023-07-29 13:51 UTC (permalink / raw)
To: zsh-users
Thank you for your reply.
Le 29/07/2023 à 14:57, Thomas Lauer a écrit :
> I am also a great friend of having consistent and "easily findable"
> files, esp for my music and the photos/videos of my travels etc so this
> looks interesting.
>
> So far, I'm using a superb replacement for the find command, called fd:
> https://github.com/sharkdp/fd
I didn't know fd, it looks nice, I might give it a try.
> fd, with a number of aliases and zsh functions I've defined, does a very
> good job of locating (my variety of) tagged files; it'll be interesting
> to compare this with your approach.
Are you also talking about tags in file names or audio/video/exif tags,
or something else?
--
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: tss, a tool to manage files with filename tags
2023-07-29 13:51 ` Johan Grande
@ 2023-07-30 17:34 ` Thomas Lauer
2023-07-30 18:12 ` Johan Grande
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Lauer @ 2023-07-30 17:34 UTC (permalink / raw)
To: Johan Grande; +Cc: zsh-users
----original message----
From: Johan Grande <nahoj@crans.org>
> > fd, with a number of aliases and zsh functions I've defined, does a very
> > good job of locating (my variety of) tagged files; it'll be interesting
> > to compare this with your approach.
>
> Are you also talking about tags in file names or audio/video/exif tags,
> or something else?
Yeah, "tagged" filenames. I can find all pics done at a (or between)
certain dates/times, rough location, type (panorama, portrait...) etc.
--
T
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: tss, a tool to manage files with filename tags
2023-07-30 17:34 ` Thomas Lauer
@ 2023-07-30 18:12 ` Johan Grande
0 siblings, 0 replies; 5+ messages in thread
From: Johan Grande @ 2023-07-30 18:12 UTC (permalink / raw)
To: zsh-users, thomas.lauer
Le 30/07/2023 à 19:34, Thomas Lauer a écrit :
> ----original message----
> From: Johan Grande <nahoj@crans.org>
>
>>> fd, with a number of aliases and zsh functions I've defined, does a very
>>> good job of locating (my variety of) tagged files; it'll be interesting
>>> to compare this with your approach.
>>
>> Are you also talking about tags in file names or audio/video/exif tags,
>> or something else?
>
> Yeah, "tagged" filenames. I can find all pics done at a (or between)
> certain dates/times, rough location, type (panorama, portrait...) etc.
OK, cool. I've been tagging files with dates myself. TagSpaces has a
feature named smart tags to do this but I thought it would be overkill
to add as a specific feature to tss; using queries such as `tss files -t
'2012-07*'` or '<2012-2016>*' and sometimes $(date ...) does the job.
Well, if you find some use for tss now or in the future, feel free to
drop me a mail, I'd love to hear.
--
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-30 18:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28 20:12 tss, a tool to manage files with filename tags Johan Grande
2023-07-29 12:57 ` Thomas Lauer
2023-07-29 13:51 ` Johan Grande
2023-07-30 17:34 ` Thomas Lauer
2023-07-30 18:12 ` Johan Grande
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).