{"id":19370314,"url":"https://github.com/codam-coding-college/codam-web-greeter","last_synced_at":"2025-04-23T15:32:15.240Z","repository":{"id":201004270,"uuid":"706277467","full_name":"codam-coding-college/codam-web-greeter","owner":"codam-coding-college","description":"Custom LightDM greeter and lock screen theme for Codam. Requires nody-greeter or web-greeter","archived":false,"fork":false,"pushed_at":"2025-04-16T11:44:22.000Z","size":27340,"stargazers_count":18,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-16T15:42:19.552Z","etag":null,"topics":["42born2code","codam","lightdm-theme","nody-greeter","nody-greeter-theme","web-greeter-theme"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codam-coding-college.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-17T16:21:39.000Z","updated_at":"2025-04-16T11:44:26.000Z","dependencies_parsed_at":"2023-11-21T14:04:24.978Z","dependency_job_id":"461549d7-68a0-45f9-90d3-0395835f5392","html_url":"https://github.com/codam-coding-college/codam-web-greeter","commit_stats":null,"previous_names":["codam-coding-college/codam-web-greeter"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codam-coding-college%2Fcodam-web-greeter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codam-coding-college%2Fcodam-web-greeter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codam-coding-college%2Fcodam-web-greeter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codam-coding-college%2Fcodam-web-greeter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codam-coding-college","download_url":"https://codeload.github.com/codam-coding-college/codam-web-greeter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250460570,"owners_count":21434267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42born2code","codam","lightdm-theme","nody-greeter","nody-greeter-theme","web-greeter-theme"],"created_at":"2024-11-10T08:14:57.638Z","updated_at":"2025-04-23T15:32:15.232Z","avatar_url":"https://github.com/codam-coding-college.png","language":"TypeScript","readme":"# codam-web-greeter\nA greeter theme for [nody-greeter](https://github.com/JezerM/nody-greeter)/web-greeter in LightDM, made specifically for [Codam Coding College](https://codam.nl/en).\n\n---\n\n## Features\n\n- Responsive design\n- Display upcoming events and exams from the Intranet\n- Prevent students from signing in with their regular account during exams\n- Customizable background image and logo\n- Greeter can be used as a lock screen when someone is already logged in (replacement for ft_lock)\n- Automatically log students out after 42 minutes of inactivity, either in-session or on the lock screen\n- Display user's Intra picture on the lock screen\n- Display user's Gnome wallpaper on the lock screen\n- Keybinding to gracefully reboot the computer (\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eDel\u003c/kbd\u003e)\n- Display network status on-screen without having to log in\n- Screen brightness control support\n- Choose between light or dark mode upon installation\n\n\n## Screenshots\n![Login screen](promo/login-screen.png)\n![Lock screen](promo/lock-screen.png)\n\n\n## Installation\n\n\u003e Caution: make sure you know how to restore your system if something goes wrong. This theme is made specifically for Codam and might not always work as intended in other 42 schools, let alone different environments. For 42 schools, it is recommended to install this theme using the [provided Ansible role](https://github.com/codam-coding-college/ansible-codam-web-greeter) on ansiblecluster.\n\n1. Install dependencies:\n```bash\nsudo apt install lightdm light-locker xprintidle\n```\n\n2. Install *nody-greeter* by downloading the deb from the [nody-greeter repository releases page](https://github.com/codam-coding-college/nody-greeter/releases). If you're at a 42 school, it is recommended to add this deb to your Nexus server so you can easily install it using `apt` later. Alternatively, you can install it by compiling from source (don't forget to clone the repository with the `--recursive` flag to include its submodules).\n\n4. Download the latest stable release of the greeter theme from the [releases page](https://github.com/codam-coding-college/codam-web-greeter/releases):\n```bash\nwget https://github.com/codam-coding-college/codam-web-greeter/releases/latest/download/codam-web-greeter.zip\nunzip codam-web-greeter.zip\n```\n\n4. Install the greeter theme:\n```bash\ninstall -dm755 /usr/share/web-greeter/themes/codam\ncp -r codam-web-greeter /usr/share/web-greeter/themes/codam\nbash /usr/share/web-greeter/themes/codam/systemd/install.sh\n```\n\n5. Enable the nody-greeter greeter in LightDM by editing */etc/lightdm/lightdm.conf*:\n```conf\n# Add the following line to the file under [SeatDefaults]:\ngreeter-session=nody-greeter\n```\n\n6. Enable the greeter theme in nody-greeter by editing */etc/lightdm/web-greeter.yml*:\n```yml\n# Replace the theme name with codam-web-greeter:\ngreeter:\n    theme: codam\n```\n\n7. Restart LightDM:\n```bash\nsudo systemctl restart lightdm\n```\n\n\n## Development\n\n### Client\nUse the provided Makefile to build the theme:\n```bash\nmake\n```\n\nYou can optionally build the theme in light mode:\n```bash\nmake CLIENT_THEME=light\n```\n\nOr in light mode with a boxed form to make the login/unlock form more readable:\n```bash\nmake CLIENT_THEME=light CLIENT_THEME_BOXED=boxed\n```\n\n\n#### Debugging the client\nYou can then open the *static/index.html* file in your browser to do some basic editing, but for most things you'll want to install the greeter on your system and run it in debug mode.\n\nAdd the following line to `/usr/share/xsessions/ubuntu.desktop`:\n```conf\nX-LightDM-Allow-Greeter=true\n```\n\nThis will allow you to run the greeter in debug mode while logged in as a regular user by installing the greeter like normally and running the following command:\n```bash\nnody-greeter --d\n```\n\nYou can then open the Developer Tools sidebar from the greeter's menu and view the console output for any warnings and/or errors.\n\nDo not forget to remove the line from `/usr/share/xsessions/ubuntu.desktop` after you're done debugging - it's a security risk to allow the greeter to be run by regular users.\n\n\n### Server\nUse the provided Makefile to build the server or use the docker-compose file in the *server/* directory directly:\n```bash\n# Makefile method\nmake server\n\n# Docker-compose method\ncd server\ndocker compose up\n```\n\n\n## Troubleshooting\n\n### Locking the screen doesn't work at all\nMake sure the LightDM config allows user-switching. Add the following line to */etc/lightdm/lightdm.conf*:\n```conf\n[SeatDefaults]\n...\nallow-guest=false\nallow-user-switching=true\ngreeter-hide-users=true\ngreeter-show-manual-login=true\n```\n\nAlso, make sure you have the `light-locker` package installed on your system.\n\n### Locking the screen shows the login screen\nModify the [LightDM hooks](https://www.freedesktop.org/wiki/Software/LightDM/CommonConfiguration/).\n\n- Add the following lines to the greeter setup hook defined in */etc/lightdm/lightdm.conf*:\n```bash\n# Get a list of all active user sessions on the system with loginctl\nUSER_SESSIONS=$(/usr/bin/loginctl list-sessions --no-legend | /usr/bin/awk '{print $3}')\n\n# Loop over all sessions and cache them with dbus-send\n# This is required for the codam-web-greeter and other lock screens to work properly (fetch the list of users)\nfor USER in $USER_SESSIONS; do\n\t# Cache the user\n\t/usr/bin/dbus-send --system --print-reply --type=method_call --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.CacheUser string:\"$USER\" || true\ndone\n```\n\n- Add the following lines to the logout hook defined in */etc/lightdm/lightdm.conf*:\n```bash\n# Uncache the user\n/usr/bin/dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.UncacheUser string:$USER || true\n```\n\n### LightDM's logout hook is called upon the greeter exiting and starting a user session\nAdd the following lines to the top of the logout hook defined in */etc/lightdm/lightdm.conf*:\n```bash\n# Check if the hook was called from a greeter exiting or a student session exiting\n# Display :0 is used for the first greeter and gets reused for the student session.\n# Display :1 is used for the second login (user switching, in fact the Codam lock screen).\n# We do not allow switching users, so for :1 there is no user session\n# to clean up for. Instead, the hook was called to clean up the greeter.\n# No cleaning needs to be done for the greeter. So, we simply exit.\n# Source: https://www.freedesktop.org/wiki/Software/LightDM/CommonConfiguration/\nif [ \"$DISPLAY\" != \":0\" ]; then\n\techo \"Catched greeter logout event, exiting\"\n\texit 0\nfi\n```\n\n### Users are sometimes randomly logged out after locking their screen once\nAdd the following lines to the top of the logout hook defined in */etc/lightdm/lightdm.conf*:\n```bash\n# Delete any lock_time files in /tmp (used by codam-web-greeter to know when the screen was locked\n# and when to automatically log out the user)\n/usr/bin/rm -f /tmp/codam_web_greeter_lock_timestamp_*\n```\nMake sure to add these lines above the lines added in the previous section (the check for the greeter logout event).\n\n### My custom wallpaper or logo doesn't show up\nMake sure the folders mentioned for branding in */etc/lightdm/web-greeter.yml* exist and contain the correct files.\n```yaml\nbranding:\n    background_images_dir: /usr/share/codam/web-greeter\n    logo_image: /usr/share/codam/web-greeter/logo.png\n    user_image: /usr/share/codam/web-greeter/user.png\n```\nFor 42 schools, link */usr/share/42/login-screen.jpg* to the */usr/share/codam/web-greeter/login-screen.png*. Place your campus's logo in */usr/share/42/logo.png* and a default user icon in */usr/share/42/user.png*. The background initially set for ft_lock is not used.\n\n### The user's profile picture is not displayed on the lock screen\nMake sure you install the systemd services included in the greeter theme. One of these services copies the `~/.face` file to */tmp* for the greeter to use.\n\n### The screen blanks on the login screen\nThis is a known issue with LightDM. To fix it, add the following line to */etc/lightdm/lightdm.conf*:\n```conf\n[SeatDefaults]\n...\ndisplay-setup-script=/usr/bin/xset s off\n```\nAlternatively, `/usr/bin/xset s off` can be added to the greeter setup hook defined in */etc/lightdm/lightdm.conf*.\n\nYou might also have to disable the screensaver in the web-greeter settings in */etc/lightdm/web-greeter.yml*.\n\n### The screen blanks on the lock screen\nBest solution: use `dm-tool switch-to-greeter` instead of `dm-tool lock` to lock the screen.\n\nAlternatively, add the following line to the greeter setup hook defined in */etc/lightdm/lightdm.conf*:\n```bash\n/usr/bin/xset dpms force off\n```\nHowever, this will cause the login screen to blank instead.\n\n### Rebooting doesn't work in the lock screen\nCheck if rebooting from the *lightdm* user is allowed by PolKit. For example, add the following lines to */etc/polkit-1/localauthority/20-org.d/org.freedesktop.login1.pkla*:\n```conf\n[Enable reboot by default for lightdm user]\nIdentity=unix-user:lightdm\nAction=org.freedesktop.login1.reboot;org.freedesktop.login1.reboot-multiple-sessions;org.freedesktop.login1.reboot-ignore-inhibit;\nResultAny=yes\nResultInactive=yes\nResultActive=yes\n```\n\n### The power button powers off the system when the greeter is active\nModify the logind configuration on what to do when the power button is pressed. For example, add the following lines to */etc/systemd/logind.conf*:\n```conf\n[Login]\n...\nHandlePowerKey=ignore\nHandleSuspendKey=ignore\nHandleHibernateKey=ignore\n```\nDon't forget to restart logind after modifying: `sudo systemctl restart systemd-logind`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodam-coding-college%2Fcodam-web-greeter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodam-coding-college%2Fcodam-web-greeter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodam-coding-college%2Fcodam-web-greeter/lists"}