Re: per user agents/login items
Re: per user agents/login items
- Subject: Re: per user agents/login items
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 11 Oct 2006 00:33:13 +0200
On mardi, octobre 10, 2006, at 11:02 PM, Philip Lukidis wrote:
Hello. I have a daemon which provides access to a certain device.
However, the device needs to have text displayed on its LCD which fits
the current locale. Unfortunately, I don't know of a way to query the
current user's locale in a daemon (assuming there is a current user),
as it runs under the root user. Any solution must work in 10.3 and
10.4...
Therefore, is there a way to:
a) Let the daemon be notified of user logon, and query the locale of
that user?
b) Split user dependent functionality out of the daemon and run it as
a per user item. However, the daemon would need to communicate with
this item and get the locale, and I don't know how to create a per
user startupitem.
c) Could the daemon be notified of user login, and spawn a helper app
in that user session which would return the locale?
1. When no user is logged in, you can probably assume that the system
language is OK, you can find this information in the
/var/log/CDIS.custom file.
2. You can be informed of user login/logout via the SystemConfiguration
Framework. Just take in count that Fast User Switching can pretend
there is a user logged in while it's only the login window being
displayed.
3. You can spawn a helper app and communicate with your daemon using
Message Ports, sockets, pipe, etc... I'm a big fan of CFMessagePort but
YMMV.
4. If you use a helper app, you should probablynot look for the locale
but use the CoreFoundation API to access localized strings.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden