If you want to use part of the users login name in a field in text, mtext or block attribute, you can use the following diesel expression
$(getvar,"loginname")
The expression below gets the first and last letters of the loginname and capitalises them, which is useful if the login name uses the first name and the first initial of the last name.
$(upper,$(substr,$(getvar,"loginname"),1,1)$(substr,$(getvar,"loginname"),$(strlen,$(getvar,"loginname")),1))