Skip to content

Commit 2c613cd

Browse files
authored
Allow backlight control through codam-web-greeter (#2)
* install acpilight for backlight control * add ddcci-backlight kernel module for backlight control on external monitors
1 parent 35f1929 commit 2c613cd

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

tasks/init.yml

+51-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,59 @@
1313
name: "{{ item }}"
1414
state: present
1515
with_items:
16-
- light-locker
17-
- xprintidle
16+
- light-locker # For locking the screen
17+
- xprintidle # For detecting idle time of a user
18+
- ddcci-dkms # For backlight control on external monitors
1819
# Assume lightdm, nodejs and npm are already installed by 42.app
1920

21+
- name: Enable ddcci-backlight kernel module
22+
tags: [codam.webgreeter, codam.webgreeter.init]
23+
become: true
24+
modprobe:
25+
name: ddcci-backlight
26+
state: present
27+
persistent: present
28+
29+
- name: Check if xbacklight binary exists
30+
tags: [codam.webgreeter, codam.webgreeter.init]
31+
shell:
32+
cmd: "which xbacklight"
33+
register: xbacklight_bin
34+
changed_when: false
35+
failed_when: false
36+
37+
- name: Clone acpilight repository
38+
tags: [codam.webgreeter, codam.webgreeter.init]
39+
git:
40+
repo: https://gitlab.com/wavexx/acpilight.git
41+
dest: /tmp/acpilight
42+
version: v1.2
43+
when: xbacklight_bin.stdout == "" # Only when xbacklight is not already available (acpilight is a replacement and has better support)
44+
45+
- name: Install acpilight
46+
tags: [codam.webgreeter, codam.webgreeter.init]
47+
become: true
48+
make:
49+
target: install
50+
chdir: /tmp/acpilight
51+
when: xbacklight_bin.stdout == ""
52+
53+
- name: Check if video group exists # Only exists if acpilight was installed
54+
tags: [codam.webgreeter, codam.webgreeter.init]
55+
shell:
56+
cmd: "getent group video"
57+
register: video_group
58+
changed_when: false
59+
failed_when: false
60+
61+
- name: Add lightdm user to video group
62+
tags: [codam.webgreeter, codam.webgreeter.init]
63+
user:
64+
name: lightdm
65+
groups: video
66+
append: yes
67+
when: video_group.stdout != ""
68+
2069
- name: Download nody-greeter deb to ansible controller
2170
tags: [codam.webgreeter, codam.webgreeter.init]
2271
delegate_to: localhost

0 commit comments

Comments
 (0)