Is there an API for customizing user profile badges / profiles for Gnome 3?

I am trying to programmatically set up a Gnome 3 / GDM 3 user profile / tile / face pattern for a user account in Gnome3 / GDM. This is my first attempt at a simple Linux program, and I am not familiar with the API, and my search has yielded little useful information. It seems that you can write data to a .face file, but this does not seem to affect (or perhaps my file type / specifications are wrong). I found from this forum post that the information is stored in the user directory under / var / lib / AccountsService / users, however I want my program to run with regular user privileges and writing (directly) to this file will require elevated privileges (despite that an unprivileged user can specify an image for his account using the Gnome GUI).

Ideally, I would like to do the same for the KDE / KDM and Gnome 2 versions. Any information would be greatly appreciated. Thanks!

+4
source share
1 answer

OK, here is the part that I can shed light on:

On any Unix OS, you can always return to the update function of the GECOS putpwent field. Traditionally, the "Real Name" is the first part of the GECOS field in the user record, up to the first,. Different systems store various extended information after,, including things like department names, home and office phone numbers, etc.

In Gnome 2, "they" used the ~ / .face symbol as a personal face icon. However, there are all kinds of situations in which one user cannot look into another home folder (including root: things like network file systems, encrypted houses with a closed loop, etc.), therefore at some point ( I believe 3.0) favor / var / lib / AccountsService / icons / $ Location YOURNAMEHERE.

In the spirit of Gnome 3, the new system (the one you most likely want to use) is the DBus service of the Accounts services. You can get the user object through DBus and modify it. The interface is org.freedesktop.Accounts / org.freedesktop.Accounts.User and has methods such as SetRealName and SetIconFile . There are also a bunch of other methods for things like location, language, email, ...

PS : you can also use libaccountsservice to interact with it without calling DBus yourself. EG: void act_user_set_real_name (ActUser *user, const char *real_name) and void act_user_set_icon_file (ActUser *user, const char *icon_file) exported from this library.

However, I do not know if K (or which version of K) can look at this DBus service. So, if you really want to customize K information, I'm afraid I don't know ...

For what it's worth, you can simply let the user configure it with

  gnome-control-center user-accounts 
+1
source

Source: https://habr.com/ru/post/1382179/


All Articles