Category or multi local addressbook support in contacts?

I have 15+ year old vcf file with several hundred contacts spread over about 10 categories. My experiments with mobian bookworm on a pinephone and extensive searching and reading the internet in general and this forum in particular imply that that the phosh contacts app does not support categories but does support multiple addressbooks. But I can’t tell if multiple local addressbooks will work. The UI doesn’t seem to provide for creating or opening them, but I wonder if it can be done via CLI to get started.

I know the current attitude is to “just search on a substring” but all my life I have frequently lost memory of a name that i haven’t thought of for a few months, even for frequent contacts. Sometimes when it pops into my head minutes or hours later, I forget it again in a few minutes. But I recognize it instantly when I see it. So, it is really important to me to be able to scroll through relatively small lists of contacts that have been filtered by category. I am pretty sure that the (linux) Sharp Zaurus from over 20 years ago supported categories.

(I keep coming across old references to syncevolution and librem5-goodies and slightly less old references saying that they have been moved from byzantium, but I haven’t tried to install them and anyway don’t think they would help with this particualr problem.)

So, is there anyway to do what I need on a Librem 5? I don’t want to set up any cloud based addressbooks.

3 Likes

You can try posting about your issue on GNOME Discourse with the #contacts tag:

2 Likes

I don’t have evolution on any of my computers because I can’t stand it. But I do know that it supports multiple local address lists and that address lists support categories, so I don’t think that it is an upstream problem.

I’ll try browsing for topics tagged contacts in the slim chance that CLI manipulation of contact lists is described, but I dread the hounding from Discourse to register an account.

1 Like

In the vCard file, do you know what property specifically is used to hold the “category”?

If CLI is considered an acceptable solution, surely it would be possible to write a quick and dirty script (bash? awk?) that, given a category, would just list the names from cards in that category.

1 Like

Here’s an awk hack for you.

Invoke as:

awk -v TARGET=yourcategory -f cat.awk <yourcontacts.vcf

where cat.awk contains

BEGIN { TARGET=toupper(TARGET); print "TARGET is " TARGET; print "" }
/^BEGIN:/ { fn=""; cat="" }
/^FN:/ { fn=$0; sub("FN:","",fn) }
/^CATEGORIES:/ { cat=toupper($0) }
/^END:/ { if ( index(cat,TARGET) != 0 && fn != "" ) { print fn } }

with the disclaimer that I have no CATEGORIES defined in my vCard file, hence the above has had very limited testing.

1 Like