Hello all, I'm interested in creating a patch for gdm to implement the following behaviour: only when there are no logged in users into a machine (that gdm knows about...) should the menu options for halting, rebooting and putting to sleep a machine be available. Would this be interesting for gdm upstream? Anyway, looking through (a little part) of the code I couldn't find a way to know how many users does the gdm daemon think that are logged in. We could hack this parsing the system's utmp file but that doesn't seem a clean option. So, is there currently a way of knowing how many users are logged in? We also should keep in mind what kind of users are we talking about. We can distinguish between at least 3 kinds: 1. users that logged in such a way that gdm wasn't involved (this would require reading utmp I guess) 2. users that logged using gdm but remotely. 3. users that logged using gdm locally. Dealing with just cases 2 and 3 would be OK. Any pointers into relevant parts of the code would be highly apreciated since gdm seems to be quite a beast and I don't have the time currently to get very intimate with it. Thanks, Rui
Attachment:
pgprQYgksZaO0.pgp
Description: PGP signature