We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 825bbe1 commit a185da3Copy full SHA for a185da3
1 file changed
resources-linux/postinst
@@ -18,7 +18,8 @@ get_installing_user() {
18
fi
19
20
# Method 2: Check loginctl for latest session
21
- username=$(loginctl list-users --no-legend | awk '$1 >= 1000 {print $2; exit}')
+ SESSION_ID=$(loginctl show-seat seat0 -p ActiveSession --value)
22
+ username=$(loginctl show-session "$SESSION_ID" -p Name --value)
23
if [ -n "$username" ]; then
24
echo "$username"
25
return 0
0 commit comments