GNOME: Difference between revisions

Klinger (talk | contribs)
m link to category instead of redirect page
Line 263: Line 263:
$ mv /path/to/image.jpg ~/.face
$ mv /path/to/image.jpg ~/.face
</syntaxHighlight>
</syntaxHighlight>
==== Change Profile Photo for Login and Lockscreen - Declarative ====
This is admittedly a hack way of doing it, however does work.
Considerations:
* image must be a PNG
* permissions matter
* this is absolutely a workaround
* assumes you are already using a .face file
* you will need to update the paths and username as applicable to your system (CAPITALIZED in the code)
* you cannot change the photo using Gnome Control Center
You can place this in your configuration.nix:<syntaxhighlight lang="nix">
system.activationScripts.script.text = ''
    mkdir -p /var/lib/AccountsService/{icons,users}
    cp /home/YOUR-USER-NAME/PATH-TO/.face /var/lib/AccountsService/icons/YOUR-USER-NAME
    echo -e "[User]\nIcon=/var/lib/AccountsService/icons/YOUR-USER-NAME\n" > /var/lib/AccountsService/users/YOUR-USER-NAME
    chown root:root /var/lib/AccountsService/users/YOUR-USER-NAME
    chmod 0600 /var/lib/AccountsService/users/YOUR-USER-NAME
    chown root:root /var/lib/AccountsService/icons/YOUR-USER-NAME
    chmod 0444 /var/lib/AccountsService/icons/YOUR-USER-NAME
'';
</syntaxhighlight>


=== Automatic login ===
=== Automatic login ===