fix: gabi_check was parsing the UID column instead of the USER column
loginctl list-users columns are 'UID USER LINGER STATE' — taking the first field compared 'gabi' against UIDs, so the check always returned False. Match the second field (the username) instead.
This commit is contained in:
@ -91,7 +91,8 @@ def gabi_check() -> bool:
|
|||||||
result = _run(["loginctl", "list-users"])
|
result = _run(["loginctl", "list-users"])
|
||||||
if result is None:
|
if result is None:
|
||||||
return False
|
return False
|
||||||
users = {line.split()[0] for line in result.stdout.splitlines() if line.split()}
|
# columns: UID USER LINGER STATE — username is the second field
|
||||||
|
users = {line.split()[1] for line in result.stdout.splitlines() if len(line.split()) > 1}
|
||||||
return "gabi" in users
|
return "gabi" in users
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user