Skip to content

Commit 44e3dcf

Browse files
committed
prevent screen from blanking
v1.1 of codam-web-greeter will implement custom screensavers to prevent user interaction with the greeter while the display is turned off
1 parent b46e0d7 commit 44e3dcf

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

files/etc/lightdm/web-greeter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ branding:
2626
greeter:
2727
debug_mode: False
2828
detect_theme_errors: True
29-
screensaver_timeout: 300
29+
screensaver_timeout: -1
3030
secure_mode: True
3131
theme: codam
3232
icon_theme:

tasks/setup.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@
6666
- 'greeter-hide-users=true'
6767
- 'greeter-show-manual-login=true'
6868

69+
- name: Copy display-setup hook script
70+
tags: [codam.webgreeter, codam.webgreeter.setup]
71+
become: true
72+
template:
73+
src: usr/share/42/scripts/hook-display-setup.sh.j2
74+
dest: /usr/share/42/scripts/hook-display-setup.sh
75+
owner: root
76+
group: root
77+
mode: '0500'
78+
79+
- name: Enable display-setup hook in lightdm
80+
tags: [codam.webgreeter, codam.webgreeter.setup]
81+
become: true
82+
lineinfile:
83+
path: /etc/lightdm/lightdm.conf
84+
line: display-setup-script=/usr/share/42/scripts/hook-display-setup.sh
85+
insertbefore: 'session-setup-script='
86+
state: present
87+
regexp: '^#?display-setup-script='
88+
6989
- name: Copy greeter-setup hook script
7090
tags: [codam.webgreeter, codam.webgreeter.setup]
7191
become: true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Prevent screen from blanking, codam-web-greeter has a built-in screensaver.
4+
# Warning: also applies to user sessions.
5+
/usr/bin/xset s off
6+
/usr/bin/xset -dpms
7+
/usr/bin/xset s noblank

templates/usr/share/42/scripts/hook-greeter-setup.sh.j2

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
{% if ansible_system_vendor == 'Apple Inc.' %}
44
# Set brightness on Apple hardware
55
# Check if the brightness-default.sh script exists in the same directory (provided by 42).
6+
# For some reason 42 runs this script for the greeter-setup, not display-setup hook in lightdm.
67
# Could implement the same behavior, but if it changes in 42.common we'd need to change it here as well.
78
# Better to just source it if it exists.
89
if [ -f "$(dirname $0)/brightness-default.sh" ]; then
910
source "$(dirname $0)/brightness-default.sh"
1011
fi
1112
{% endif %}
1213

13-
# Prevent the screen from going to sleep
14-
/usr/bin/xset s off
15-
1614
# Turn on Num Lock on the keyboard
1715
/usr/bin/numlockx on
1816

0 commit comments

Comments
 (0)