I use Debian 8 which runs Gnome 3.14.1.
I want to setup an autologin, but the name of the user to autolog is not fixed so I want to use a script to set it. According to GDM documentation (at https://help.gnome.org/admin/gdm/3.14/configuration.html.en#daemonsection), it is possible to use a "pipe" (|) at the end of the AutomaticLogin property of the /etc/gdm3/daemon.conf file to indicate that a script must be used to get the name of the user:
This is the user that should be logged in immediately if AutomaticLoginEnable is true. If the value ends with a vertical bar | (the pipe symbol), then GDM will execute the program specified and use whatever value is returned on standard out from the program as the user. The program is run with the DISPLAY environment variable set so that it is possible to specify the user in a per-display fashion. For example if the value is "/usr/bin/getloginuser|", then the program "/usr/bin/getloginuser" will be run to get the user value.
However, on my computer, gdm tries to log the user "/usr/bin/getloginuser|" instead of the result of the script. Does anyone know how to make it work?