Skip to content

Commit a185da3

Browse files
committed
change approach to handle multi-user setups
1 parent 825bbe1 commit a185da3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

resources-linux/postinst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ get_installing_user() {
1818
fi
1919

2020
# Method 2: Check loginctl for latest session
21-
username=$(loginctl list-users --no-legend | awk '$1 >= 1000 {print $2; exit}')
21+
SESSION_ID=$(loginctl show-seat seat0 -p ActiveSession --value)
22+
username=$(loginctl show-session "$SESSION_ID" -p Name --value)
2223
if [ -n "$username" ]; then
2324
echo "$username"
2425
return 0

0 commit comments

Comments
 (0)