The value of imports.ui.main.sessionMode.currentMode (ubuntu) is not the login name, but the name of the ubuntu session.
I'm sorry to say it but the gjs guide is wrong in assuming that's always the case as further sessions can be added. However, you can definitely check whether the used session is an user one by just ensuring: imports.ui.main.sessionMode.currentMode === 'user' || imports.ui.main.sessionMode.parentMode === 'user' As any custom session that is still an user session will have the parentMode set. ** Changed in: gjs (Ubuntu) Status: New => Won't Fix -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gjs in Ubuntu. https://bugs.launchpad.net/bugs/1975402 Title: GJS returns wrong session mode To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gjs/+bug/1975402/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs