I have a script which distinguishes if it is sourced from within a login shell or not. But it happens not to do its job as the login was done through display manager sddm.
#!/bin/bash # /etc/bash.bashrc # ... shopt -q login_shell && echo "I am a login shell!" >~/login.log # ...
Logging in as user via
su -l $USER works by the way.