Right now we use tinydm for some UIs, lightdm for others.
tinydm just does an autologin and makes sense in the following situation:
Your device is encrypted with FDE, so you already need to type in a password on boot. This is the most sensible use case for phones.
You want it to automatically login without password (e.g. when you don't store personal data on the device and just want to use it to launch something like kodi to watch movies, or open a browser and display some data on a monitor)
A full DM like lightdm (or phog or ...) makes sense if:
you don't use FDE and want to type in a password on boot
you want to be able to switch between multiple UIs
you want to be able to switch between multiple users
Let's come up with a consistent story here. How about:
we use tinydm by default everywhere
but provide a sane way to change to a full DM? Like installing one package or running one command that sets everything up. (automatize this)
let's standardize on what the full DM would be?
EDIT: Bart had better idea for defaults, autologin for mobile and no autologin for desktop, see comment below.
This issue is for discussing this further and coming up with something consistent. In the meantime I'll revert the tinydm -> lightdm change we just did for mate and xfce4, because it broke the second use case.
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
I don't want to use tinydm everywhere by default. For me the distinction sits between mobile and non-mobile UI's: mobile UI's show their lockscreen immediately after autologin, thus being somewhat safe. On mobile there is also no need to switch users, a phone is not something you tend to share with other people.
On desktop however the presence of a DM that asks you for your password is assumed, with autologin it wouldn't ask for any password (note that not everybody wants or needs FDE). There the usecase of switching users and even entire DE's is also way more present and useful, thus something that just autologins by default would be wrong.
I'm more in favor of tinydm on every mobile UI, and just use whatever DM that comes with the desktop DE. So GDM on GNOME and SDDM on Plasma Desktop.
This sounds reasonable.
I still think it would be nice if there was an easy way for users to switch between autologin and no-autologin in both cases, e.g. with a script that sets everything up. And from packaging perspective making sure that both use cases are supported for both mobile and desktop. So leaving this issue open.
For devices where a "full" DM is applicable, I could imagine dropping lightdm in favor for sddm, if sddm would work with a screen-keyboard, as sddm supports X11 and Wayland.
From what I read there is support for qtvirtualykeyboard in sddm, however i am not sure if this would also work with onboard.
Ubuntu installs "slick-greeter" on top for a nicer look and Linux Mint people created a graphical configuration tool for it called "lightdm-settings". The "slick-greeter" is also available on Alpine Linux "testing" repository, whereas the graphical configuration tool "lightdm-settings" is not available there yet.
On Alpine Linux there is a "lightdm-mobile-greeter", although to be honest I didn't like it very much when I tested it a while ago. (After installing, edit /etc/lightdm/lightdm.conf and change to greeter-session=lightdm-mobile-greeter).
Well, a possible way to go would be to keep the desktop managers set to autologin by default and offer user-specific configuration by graphical interface to disable autologin. Following screenshots show how this looks in Linux Mint MATE, Ubuntu GNOME and Debian KDE Plasma (click to enlarge).
| | | |
The first picture is "lightdm-settings". Removing the user name disables autologin.
However, for Xfce4 and MATE on LightDM there are some difficulties that might take some time until solved:
It would mean to create a new aport in Alpine for "lightdm-settings", keep it there a while for testing, then move "slick-greeter" and "lightdm-settings" to community, finally add changes to Xfce4 and MATE in postmarketOS (adding those packages, add a glib override file to set the default settings like background and default virtual keyboard settings). If someone would be up to help out with the packages on Alpine, that would be appreciated.
In "slick-greeter", the virtual keyboard size (the "onboard" layout) currently cannot be changed. This option was added just recently to "slick-greeter" and to "lightdm-settings". It will possibly take some time until the next releases of "slick-greeter" and "lightdm-settings" become available.
The statement that Ubuntu installs slick-greeter on top if LightDM was not correct. They used to install unity-greeter. slick-greeter is a fork of unity-greeter by Linux Mint using other indicators.
So what does Ubuntu use nowadays? Ubuntu default with GNOME uses GDM. Xubuntu (Xfce) interestingly installs lightdm-gtk-greeter, which is a rather classic style greeter. What I wasn't aware of: there is also a graphical configuration tool available called "lightdm-gtk-greeter-settings". A good thing I see there is the possibility to enter a command for the virtual keyboard. That way it's quite easy to change layout (size) and theme of the virtual keyboard. The "bad" thing: I don't see an option to enable/disable autologin – which is actually what we are looking for within this issue.
Ubuntu MATE uses arctica-greeter. It is another fork of unity-greeter (and thus simular to slick-greeter), though using Ayatana indicators, as Ubuntu MATE uses these indicators in their panel. As far as I can see, there is no graphical configuration tool installed along with it.
By the way, there is also a lightdm-autologin-greeter. I haven't tried but I guess this could "enable/disable" autologin by installing/uninstalling that package.
So far, however, I still think that slick-greeter combined with graphical configuration tool lightdm-settings would suite the needs best, as the user can enable/disable autologin in the settings window. The packages (once available) should be installed as _pmb_recommends to allow the users to replace the greeter.
I had a try on device samsung-serranove (display resolution 540x960). After installing slick-greeter, sudo vi /etc/lightdm/lightdm.conf -> greeter-session=slick-greeter is needed and also new file sudo vi /usr/share/lightdm/lightdm.conf.d/65-autologin-override.conf -> "[Seat:*] autologin-user= autologin-user-timeout= autologin-session=" on four lines. Additionally, I created a new file sudo vi /usr/share/glib-2.0/schemas/10_slick-greeter_pmos.gschema.override with "[x.dm.slick-greeter] onscreen-keyboard=true" on two lines. For testing lightdm-settings, on Xfce4 I installed py3-setproctitle, py3-psutil (on MATE they seem to be already installed). Then I downloaded packages lightdm-settings and python3-xapp (dependency of lightdm-settings 1.6.1) from Debian to my PC (download links https://packages.debian.org/bookworm/all/lightdm-settings/download and https://packages.debian.org/bookworm/all/python3-xapp/download), unpacked them, put the content to the phone by sftp (put -pR usr .) and copied into the according system folders (sudo cp -RP usr/* /usr/.).
| |
There are some issues, though:
slick-greeter configuration by /usr/share/glib-2.0/schemas/10_slick-greeter_pmos.gschema.override or /etc/lightdm/slick-greeter.conf or gsettings x.dm.slick-greeter works "partially", mostly not, but sometimes yes, somehow unreliable, not sure about that. I haven't seen a pattern yet. Also entering the username in the autologin field had no effect yet, I think this is related. This needs some investigation.
Priviliges to open the "Login Window" settings are not working yet on Xfce4. I opened the window in terminal locally by sudo /usr/bin/lightdm-settings. Actually there is a file /usr/share/polkit-1/actions/org.x.lightdm-settings.policy in Debian lightdm-settings (source https://github.com/linuxmint/lightdm-settings/blob/1.6.1/usr/share/polkit-1/actions/org.x.lightdm-settings.policy). It should take care of the priviliges but it doesn't work yet on pmOS Xfce4. This would need debugging. On MATE, a window shows up asking for the password, I think that's how it's supposed to be.
The mouse pointer is visible on touch screen device. This would apply to other display managers and greeters as well. Once logged in into Xfce4 user session, we start unclutter-xfixes by autostart. To "remove" the mouse pointer from the display manager, unclutter-xfixes would need to be started along with the display manager or when reaching the graphical target. I don't know yet how to do this in a clean way.
Help on investigating issues and, if appropriate, packaging lightdm-settings and python3-xapp (rather named py3-xapp) to Alpine would be welcome.
For the ones who want to investigate/debug/test without transfering packages from Debian for the graphical configuration tool: Just install slick-greeter package from Alpine testing, set greeter-session=slick-greeter in /etc/lightdm/lightdm.conf, disable autologin by new file 65-autologin-override.conf as described above.
Manual configuration of the greeter is done in a new file /etc/lightdm/slick-greeter.conf, the file needs to contain [Greeter] on top (with upper case G), the available options are listed at https://github.com/linuxmint/slick-greeter#readme. Example:
I thought that the background option could also be written with single quotations marks background='/usr/share/wallpapers/postmarketos.jpg' but no: that doesn't seem to work. Double quotations marks don't work either. So don't use quotations marks.
I think draw-user-backgrounds=true works only if the users desktop wallpaper lies directly in folder /usr/share/background or /usr/share/wallpapers (if the wallpaper lies in a subfolder like /usr/share/backgrounds/xfce or somewhere else, the option doesn't work).
An important option would be onscreen-keyboard=true to bring up the virtual keyboard right after boot. If it doesn't work, the virtual keyboard can be called by clicking the accessibility menu at the top bar. Though if the option doesn't work, the keyboard has to be called from accessibility menu after every boot. I somehow managed that it does show up after boot but I cannot reproduce.
Like mentioned in the last comment, the configuration is not working reliably for some reason. Possibly it's only the "onscreen-keyboard" not working reliably whereas for the "background" option I may have been confused by using quotation marks that make it not working. Maybe some dependencies or priviliges are missing. Or maybe it is related to some gsettings/glib/dconf settings conflict. The default values are stored in /usr/share/glib-2.0/schemas/x.dm.slick-greeter.gschema.xml.
State on bugs of lightdm "slick-greeter" + graphical configuration tool "lightdm-settings".
Found a solution:
In configuration tool "lightdm-settings" adding/removing autologin user name had no effect: Removing autologin files in "/usr/share/lightdm/lightdm.conf.d" solves the problem. "lightdm-settings" is handling the autologin user by modifying the file "/etc/lightdm/lightdm.conf". Accordingly, in case of using "lightdm-settings" in postmarketOS, the autologin user would need to written into the file "/etc/lightdm/lightdm.conf" unpon installation.
In Xfce4 the "Login Window" settings didn't open: Installing package "xfce-polkit" solves the problem. Clicking the "Login Window" icon then brings up a password prompt, thereafter the configuration window shows up.
Mouse pointer visible at login display on touch devices: In file "/etc/lightdm/lightdm.conf" uncomment the option "greeter-setup-script" below [Seat:*] and change it to greeter-setup-script=unclutter-xfixes --fork --start-hidden --hide-on-touch. To avoid it being started twice, disable the current implementation of "unclutter-xfixes" (in Xfce4 Settings -> Session and Startup -> Application Autostart; in MATE System -> Preferences -> Personal -> Startup Applications).
Probably upstream bug in slick-greeter:
slick-greeter option "onscreen-keyboard" to show virtual keyboard after boot doesn't work: I couldn't solve this yet. However, I found out that when creating file "/usr/share/glib-2.0/schemas/10_slick-greeter_pmos.gschema.override" with "[x.dm.slick-greeter] onscreen-keyboard=true" (on two lines) before starting slick-greeter for the first time, that way the virtual keyboard shows up after boot. When removing the file, uninstalling and re-installing slick-greeter, the keyboard doesn't show up anymore after boot (and vice versa: adding the file, uninstalling and re-installing slick-greeter makes the virtual keyboard show up again after boot). I couldn't find out where this state gets stored. It might be an upstream bug. It looks to me like the option "onscreen-keyboard" wouldn't be sourced from config file "/etc/lightdm/slick-greeter.conf" [1][2].
disable the currently implemented "unclutter-xfixes" in autostart settings (at Xfce4 that's Settings -> "Session and Startup" -> tab "Application Autostart" -> uncheck "unclutter-xfices"; at MATE it is Preferences -> Personal -> Startup Applications -> uncheck "unclutter-xfixes")
at Xfce4 only: sudo apk add xfce-polkit
sudo rm /usr/share/lightdm/lightdm.conf.d/64-autologin.conf at Xfce4 or 61-autologin.conf at MATE
sudo vi /etc/lightdm/slick-greeter.conf (new file, make sure to use an uppercase G in Greeter)
When arriving at the login screen, the onscreen keyboard can be called in the accessibility icon in the top bar.
In the Settings menu (Xfce4) or System -> Administration (MATE), there is the new entry "Login Window". Clicking it should ask for the admin password. In tab "Users" in the "Automatic login" in field "Username", entering or deleting a username will enable/disable autologin.
In case we would roll this out, we would write the users name into lightdm.conf at installation. The file would need to be modified anyway to set up slick-greeter. Autologin would be the default state, users can disable it in the "Login Window" setting.
There are some minor flaws:
The option "draw-user-backgrounds" doesn't work in MATE. As I found out by now this is an issue within MATE. It doesn't write the users background picture path to /var/lib/AccountsService/users/USERNAME, as other UI's do. That's why slick-greeter can't get the users backgrounds at MATE. At Xfce4 this works, and it works for all folders that are generally accessible (not only /usr/share/backgrounds and /home, as I wrote further up). However, at Xfce4 it's not recommended to enable "draw-user-backgrounds" and having an individual background picture set in /etc/lightdm/slick-greeter.conf at the same time, it may lead to get one picure visible first and than changing to the other one. When using "draw-user-backgrounds", the path for individual background picture should be emptied.
The configuration window cannot be resized vertically. On horizontal monitors with low resolution, the lower part of the window might not be accessible. However, this is not necessary, it's sufficient to conduct the changes and then just close the window.
Now we have to wait. The package "lightdm-settings" needs to rest in the "testing" repository of Alpine Linux for a while before it can go into "community". What's more, the issue in slick-greeter about the "onscreen-keyboard" setting needs to be resolved. Without virtual keyboard directly showing up after boot, it doesn't make much sense to ship this in pmOS. Hopefully this gets solved soon, I'm a bit nervous that this issue could become a showstopper.
I noticed on my MATE installation: When following the steps of the last post, but then enabling autologin, the mouspointer becomes visible for touch devices (unclutter-xfixes doesn't get started). On Xfce4, on the other hand, it works also with autologin enabled. Not sure why there is a difference, actually it shouldn't be different.
Looks like handlings unclutter-xfixes will need some more "fine-tuning".
To make the unclutter-xfixes command independent from autologin enabled/disabled, it needs to go into the line display-setup-script instead of greeter-setup-script.
About MATE not being able to read the "draw-user-backgrounds" due to not writing that information to AccountsService, there is an upstream issue report that's already 7 years old. No solution to be expected soon. Thus, the background for slick-greeter in MATE needs to be set to a static picture path in /etc/lightdm/slick-greeter.conf.
In Alpine Linux I have moved slick-greeter and GUI lightdm-settings from "testing" to "community". For slick-greeter this was a bit of an effort because it had a dependency to a deprecated package gnome-common that it needed to get rid off before.
In upstream slick-greeter and lightdm-settings I have set up pull requests for better configuration of the onscreen keyboard. While I think these changes are pretty obvious, the developers didn't go for it yet. Therefore it's not yet clear if they are going to be accepted or vanish. At least a bit of discussion came up.
Instead the developers prefer to keep the current way of how the onscreen keyboard is handled. This is by the accessibility menu in the top bar of slick-greeter, where the onscreen keyboard can be enabled or disabled by a checkbox. The default can be set by a gschema-override file. In postmarketOS/Alpine however, the users choice saved in gsettings got lost after a reboot. It took me quite a while to find the cause. Finally it turned out that the home directory of user "lightdm" was not set correclty in Alpine. I've set up a merge request to fix this.
Summarizing, the implementation of slick-greeter and GUI lightdm-settings to pmOS Xfce4 and MATE comes closer. I'll wait a bit more where the discussion in upstream slick-greeter about the onscreen keyboard setting is going. And the current python issue #2888 (closed) in onboard keyboard needs to be resolved, as this is also needed for the display manager.