Does not work on ubuntu
nemanjan00 opened this issue · comments
Example output on ubuntu:
root pts/1 2018-05-29 13:52 (57.136.143.112)
- IP changed
So who | grep tty1
returns nothing
Are you using lxdm?
I am having a similar problem and the thing was, that lxdm does not update the /var/log/utmp, which is used for who
.
Yeah, I think it was lxdm (not 100% sure, I discovered that on friends laptop)
Hello @nemanjan00,
Thanks for your feedback.
Like you, others are experimenting the same issue with lxdm.
I will take a look closer as soon as I can.
Quick and dirty patch to get it to work with archlinux and lxdm.
First thing was to get the user by
xuser="$(loginctl list-sessions | sed '2!d' | sed "s/^[ \t]*//" | cut -d' '
-f3)"`
on line 69.
Second on my system the virtual terminal number has a leading 0, so i changed line 74 to
vterm="vt0$(printf '%s' "${xtty}" | sed -e 's/tty//g')"