Creating a link that updates a user preference

This is great! I’m looking for something remotely similar: How can I create a URL e.g., on a normal page (document) htat is calculated upon page request and contains, e.g., a user’s name?

In my case, I want to provide a link to the edit page of a current user’s profile so they have quick access to adding their personal data.

The link should look something like https://[your xwiki domain/bin/edit/XWiki/[user]?editor=inline&category=profile, and [user] should be replaced by the id of the current user.

I guess $xcontext.getUser() should be invoked here somehow, or maybe $xwiki.getDocument($context.user).getObject('XWiki.XWikiUsers').getProperty('first_name').getValue())?