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.

# /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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.