For those who don't know, greeter is basically the login screen. In case of Lightdm specifically, there are several versions of it:
- unity-greeter
- kylin-greeter
- lightdm-gtk-greeter
- lightdm-kde-greeter
- lightdm-webkit-greeter
- razorqt-lightdm-greeter
The goal:
I need to know how to obtain the greeter version currently in use. Scripting solutions are most welcome ( preferably python, shell scripts, perl ) but also open to C code. Ideally , the solution would work like so:
$ ./get_greeter
kylin-greeter
Issues and failed approaches:
- Checking process listing doesn't work. I have kylin-greeter in use right now, but
pgrep -f lightdm | xargs -L 1 ps -o args --no-header -p
orpgrep -f kylin | xargs -L 1 ps -o args --no-header -p
return nothing that points to/usr/sbin/kylin-greeter
lsof -p <LIGHTDM_PID>
also provides no insights – no/usr/sbin/kylin-greeter
among the listing.- Parsing
/etc/lightdm/lightdm.conf
is a potential, but not ideal solution, since some flavors of Ubuntu ( such as Kylin ) won't explicitly state greeter session in that file. I would prefer something more reliable. gsettings
doesn't provide a reliable means of determining greeter in use either – presence of schemas forunity-greeter
doesn't mean I am currently using that.- examining paths and methods on
org.freedesktop.DisplayManager
service for system bus provided no insights into what greeter is in use either.
Best Answer
From a couple of quick tests, it seems the only way is to ask LightDM itself:
I started testing with default Ubuntu, then installed
lightdm-gtk-greeter
and the installedkylin-greeter
. In each case, it returned the correct option. For example, after editing/etc/lightdm/lightdm.conf
to addgreeter-session=unity
, the output changed:Note the source of the configuration.