This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Tagging from the command line?

Tags: nepomuk, scripting, shell nepomuk, scripting, shell nepomuk, scripting, shell
(comma "," separated)
f1r3br4nd
Registered Member
Posts
16
Karma
0

Tagging from the command line?

Thu Dec 02, 2010 11:43 pm
I'm excited about the tagging feature, but I'm not a fan of mice or GUI file browsers. Does anybody know of a command-line tool for adding and querying the tags associated with a file? I thought sopranocmd was supposed to be a command-line semantic desktop tool, but I see no mention of tags in the pages of help text it spits out when I run it.

I can't believe that I can't even think of a query that returns anything relevant. Am I completely misunderstanding what sopranocmd does?

Thanks.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Tagging from the command line?

Fri Dec 03, 2010 11:21 pm
I am not aware of any utility which provides this functionality at this time. If you can script, you may wish to check the various bindings which are available from kdebindings though.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
f1r3br4nd
Registered Member
Posts
16
Karma
0

Re: Tagging from the command line?

Sun Dec 05, 2010 11:38 pm
bcooksley wrote:I am not aware of any utility which provides this functionality at this time. If you can script, you may wish to check the various bindings which are available from kdebindings though.


Yes, thank you, that's exactly what I'm looking for. I'm surprised I never heard of this before. Where can I learn more about using kde-bindings with a shell script?

Also, does anybody know if qdbus supports tagging? Because that might be another approach for scripting.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Tagging from the command line?

Mon Dec 06, 2010 2:55 am
qdbus as far as I know doesn't. kdebindings provides bindings of KDE's C++ API in the various languages. I haven't used them before myself however. I suggest consulting the documentation at api.kde.org for more information.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
einar
Administrator
Posts
3402
Karma
7
OS

Re: Tagging from the command line?

Sat Dec 11, 2010 11:24 pm
Creating a script to tag files should be very easy. If you're into Python, this tutorial I wrote should be a good start.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
f1r3br4nd
Registered Member
Posts
16
Karma
0

Re: Tagging from the command line?

Thu Dec 16, 2010 6:44 pm
Yes, thank you, einar! This looks like exactly what I need. I haven't written much in Python before, but this looks like the perfect opportunity to learn.

Two questions:

1. Where can I read the documentation of the Python syntax for the query command? Once I get it figured out I'll be happy to report back so you can include it in your example.

2. Your tutorial mentions that absolute paths should be used. Does this mean that if at some point I hardlink or move my files to a new location the metadata will all be lost? Uh oh.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell