pax_global_header00006660000000000000000000000064131063561110014507gustar00rootroot0000000000000052 comment=22021f3979ae8f18b65384daea67b7601be53b9b lightdm-autologin-greeter-1.0/000077500000000000000000000000001310635611100164315ustar00rootroot00000000000000lightdm-autologin-greeter-1.0/.gitignore000066400000000000000000000022351310635611100204230ustar00rootroot00000000000000# Vim swap files *.swp # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # dotenv .env # virtualenv .venv venv/ ENV/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ lightdm-autologin-greeter-1.0/LICENSE000066400000000000000000000020541310635611100174370ustar00rootroot00000000000000MIT License Copyright (c) 2017 Enrico Zini Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lightdm-autologin-greeter-1.0/README.md000066400000000000000000000043151310635611100177130ustar00rootroot00000000000000# Autologin greeter for lightdm I occasionally need autologin for X. I once wrote [nodm](https://github.com/spanezz/nodm) for it, but I am not developing it anymore. I have instead written a minimal autologin greeter for [lightdm](https://freedesktop.org/wiki/Software/LightDM/) that has the same autologin behaviour as nodm, but being based on lightdm it stays on top of modern display manager requirements. Some instructions for setting a custom greeter in lightdm can be found [here](https://wiki.ubuntu.com/LightDM#Changing_the_Greeter) The difference between lightdm's built-in autologin and this greeter, are the behaviour in case of 0-seconds autologin delay: when lightdm autologs in with no delay, upon logout it will show the login window again. The intent is that if the default user logged out, they probably intend to log in again as a different user. In my case, managing a kiosk-like setup, if the X session quits then the desired behaviour is to just start it again. Lightdm with an autologin timeout of 1 or more seconds would work as I need it, but one sees the login dialog window appear and disappear on screen at each system startup. While it is functional, on a kiosk setup it looks estetically unprofessional to my taste. With this greeter, the X session starts right away, and is restarted if it quits, without any flicker of a login dialog box. If one is not setting up a kiosk-like setup, it's very likely that the default autologin behaviour of lightdm is the way to go, and that this greeter is not needed. ## Installation instructions The installation is very simple. 1. Install PyGObject and LightDM with GObject Introspection bindings These are usually provided by your Linux distribution. For Fedora/CentOS, you need to install `lightdm`, `pygobject3`, and `lightdm-gobject`. ```bash $ sudo yum install lightdm pygobject3 lightdm-gobject ``` For Debian/Ubuntu, you need to install `lightdm`, `python-gobject`, `liblightdm-gobject-1-0`, and `gir1.2-lightdm-1`. ```bash $ sudo apt install lightdm python-gobject liblightdm-gobject-1-0 gir1.2-lightdm-1 ``` 2. Copy the files in `bin/` and `share/` to `/usr` 3. Ensure no other greeter is configured and reboot. You'll now be using the autologin greeter! lightdm-autologin-greeter-1.0/bin/000077500000000000000000000000001310635611100172015ustar00rootroot00000000000000lightdm-autologin-greeter-1.0/bin/lightdm-autologin-greeter000077500000000000000000000021171310635611100242120ustar00rootroot00000000000000#!/usr/bin/python # # Author: Enrico Zini # Based on http://www.mattfischer.com/blog/?p=5 # Lightdm library documentation: # http://people.ubuntu.com/~robert-ancell/lightdm/reference/ from __future__ import print_function from gi.repository import GObject from gi.repository import LightDM import sys greeter = None # Callback for after we send LightDM the password, this method # has to handle a successful login, in which case we start the session # or a failed login, in which case we tell the user def authentication_complete_cb(greeter): if greeter.get_is_authenticated(): if not greeter.start_session_sync(None): print("Failed to start session", file=sys.stderr) else: print("Login failed", file=sys.stderr) if __name__ == '__main__': main_loop = GObject.MainLoop () greeter = LightDM.Greeter() # connect signal handlers to LightDM greeter.connect ("authentication-complete", authentication_complete_cb) # connect to greeter greeter.connect_sync() greeter.authenticate_autologin() main_loop.run () lightdm-autologin-greeter-1.0/share/000077500000000000000000000000001310635611100175335ustar00rootroot00000000000000lightdm-autologin-greeter-1.0/share/lightdm/000077500000000000000000000000001310635611100211635ustar00rootroot00000000000000lightdm-autologin-greeter-1.0/share/lightdm/lightdm.conf.d/000077500000000000000000000000001310635611100237615ustar00rootroot00000000000000lightdm-autologin-greeter-1.0/share/lightdm/lightdm.conf.d/60-lightdm-autologin-greeter.conf000066400000000000000000000001211310635611100321270ustar00rootroot00000000000000[Seat:*] greeter-session=lightdm-autologin-greeter user-session=lightdm-xsession lightdm-autologin-greeter-1.0/share/xgreeters/000077500000000000000000000000001310635611100215435ustar00rootroot00000000000000lightdm-autologin-greeter-1.0/share/xgreeters/lightdm-autologin-greeter.desktop000066400000000000000000000002531310635611100302200ustar00rootroot00000000000000[Desktop Entry] Name=LightDM AutoLogin Greeter Comment=This runs the autologin greeter, it should only be run from LightDM Exec=lightdm-autologin-greeter Type=Application