Skip to content

Give new users a BigLinux avatar - #16

Merged
bigbruno merged 1 commit into
mainfrom
dev-bigbruno
Nov 25, 2026
Merged

bigbruno merged 1 commit into
mainfrom
dev-bigbruno

Conversation

@bigbruno

@bigbruno bigbruno commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

sddm-fix in sddm-theme-biglinux assigned these avatars, so systems without SDDM never got one. This package ships the avatars and is in the shared package list of the ISO profiles, so it assigns them now (biglinux/sddm-theme-biglinux#51; release both together).

  • default-avatars gives each new user (UID 1000 or above, except nobody) one of the big* avatars at random, unless AccountsService already holds a picture for it; a ~/.face alone is not seen, since the service cannot read homes. It copies the avatar to /var/lib/AccountsService/icons/<user>, which SDDM reads, and sets it with SetIconFile, which GNOME, KDE and BigDesktop read.
  • A user is new when the previous run did not see it (/var/lib/biglinux-base-icons/users). The install script records the users already there, so existing accounts keep what they have; on an image the installer's account comes later and counts as new.
  • It runs whenever /etc/passwd changes and at boot, before the display manager, for users an installer created offline. Both units are pulled in by drop-ins on paths.target and multi-user.target, and the service is sandboxed (systemd-analyze security: 0.9). After an upgrade they start with the next boot.

Testing

  • With a stub busctl: the first run records the existing user and assigns nothing; a new user gets an avatar; a user created with a picture keeps it; a failed AccountsService call is retried on the next run; a deleted user leaves the list.
  • On a BigLinux VM, with the units running in their sandbox: the install script recorded the existing user, whose picture stayed as it was; useradd started the path unit, which gave the new user an avatar that AccountsService reports as /var/lib/AccountsService/icons/<user>; deleting the user removed it from the list. Test accounts were removed.
  • Not tested: an account created by the installer and picked up by the boot run.

Summary by CodeRabbit

  • New Features
    • Eligible user accounts without an existing profile picture can now receive a randomly selected default avatar. Avatar assignment runs during startup and when account information changes, and can be retried on a later run if it fails.
    • Users who already have a profile picture are left unchanged.

sddm-fix assigned the avatars, so systems without SDDM never got one.
The package that ships them now gives each new user one at random
through AccountsService, unless the account was created with a picture.
It runs whenever /etc/passwd changes and at boot, for users an installer
created offline. The install script records the users already there, so
existing accounts keep what they have.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a script that assigns default avatars to eligible users and tracks processed users. Systemd runs it at startup and after passwd changes. Package install and upgrade hooks also run the script when its state file is absent.

Changes: Default avatar assignment

Layer / File(s) Summary
Avatar assignment and state tracking
biglinux-base-icons/usr/lib/biglinux-base-icons/default-avatars
The script processes users with UID 1000 or higher, except UID 65534. It assigns a random avatar when AccountsService reports no existing picture file, creates the SDDM icon if needed, and saves user state. Failed lookups, assignments, or state writes set a failing exit status.
Systemd execution and activation
biglinux-base-icons/usr/lib/systemd/system/biglinux-default-avatars.service, biglinux-base-icons/usr/lib/systemd/system/biglinux-default-avatars.path, biglinux-base-icons/usr/lib/systemd/system/multi-user.target.d/biglinux-default-avatars.conf, biglinux-base-icons/usr/lib/systemd/system/paths.target.d/biglinux-default-avatars.conf, systemd-exposure.json
The oneshot service runs the script before the display manager when the AccountsService D-Bus service file exists. The path unit activates it when /etc/passwd changes. Target drop-ins request the service and path unit. The service has a 15-second startup timeout and sandboxing restrictions.
Package install and upgrade hooks
pkgbuild/PKGBUILD, pkgbuild/biglinux-base-icons.install
The PKGBUILD references the install script. The install and upgrade hooks run the avatar script when the users state file is absent.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant PasswdPathUnit
  participant AvatarService
  participant DefaultAvatarsScript
  participant AccountsService
  participant StateFile
  PasswdPathUnit->>AvatarService: Activate after /etc/passwd changes
  AvatarService->>DefaultAvatarsScript: Run the script
  DefaultAvatarsScript->>AccountsService: Check and set user icon
  DefaultAvatarsScript->>StateFile: Save processed users
Loading
Merge Risk: Minimal · up to 8148f

This change gives new users a default avatar at boot and after passwd changes. No concrete defect was found. One scenario is untested: an account created by the installer might not get an avatar if it is already recorded as existing. That affects only the default picture, and the owner can confirm it separately.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Give new users a BigLinux avatar" matches the main change. The PR assigns a random BigLinux avatar to new users with UID 1000 or above, through a new default-avatars script, a systemd path …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Give new users a BigLinux avatar" matches the main change. The PR assigns a random BigLinux avatar to new users with UID 1000 or above, through a new default-avatars script, a systemd path and service, and an install hook. The title is short and specific, and it does not use vague terms.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1aa1d0ae-cea8-4712-b9de-d8b3f06a03e7
Commits

Reviewing files that changed from the base of the PR and between 27e489c and 8148f23.

Files selected for processing: 8

  • biglinux-base-icons/usr/lib/biglinux-base-icons/default-avatars
  • biglinux-base-icons/usr/lib/systemd/system/biglinux-default-avatars.path
  • biglinux-base-icons/usr/lib/systemd/system/biglinux-default-avatars.service
  • biglinux-base-icons/usr/lib/systemd/system/multi-user.target.d/biglinux-default-avatars.conf
  • biglinux-base-icons/usr/lib/systemd/system/paths.target.d/biglinux-default-avatars.conf
  • pkgbuild/PKGBUILD
  • pkgbuild/biglinux-base-icons.install
  • systemd-exposure.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@bigbruno
bigbruno merged commit f3a9796 into main Nov 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant