Skip to content

Commit 982c61c

Browse files
committed
add option to disable ddcci-dkms installation
useful for iMacs with T2 chips
1 parent e4a0248 commit 982c61c

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ It is also possible to specify a default user image in case the user's `~/.face`
5252
| `dbus_cache_group_check_enabled`| Whether to check if a user is in a specific ldap group before adding it to the dbus cache. Usually this is not required. | `false` |
5353
| `dbus_cache_group_check_group`| The group to check for. | `student` |
5454
| `login_wallpaper_path` | The path to the login wallpaper to set. | `/usr/share/42/login-screen.jpg` |
55+
| `ddcci_backlight_support` | Whether to enable support for DDC/CI to allow controlling the brightness of external monitors. Should be set to `false` if you're using iMacs with T2 chips or any other *ddcci-dkms* unsupported kernel. | `true` |

defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ dbus_cache_group_check_enabled: false
1717
dbus_cache_group_check_group: "student" # default ou=student,ou=groups,dc=42campus,dc=org
1818

1919
login_wallpaper_path: "/usr/share/42/login-screen.jpg"
20+
21+
# Specify whether or not to add support for ddcci-backlight control on external monitors
22+
# Requires ddcci-dkms to be installed, which is not supported by iMacs with T2 chips
23+
ddcci_backlight_support: true

tasks/init.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,39 @@
1515
with_items:
1616
- light-locker # For locking the screen
1717
- xprintidle # For detecting idle time of a user
18-
- ddcci-dkms # For backlight control on external monitors
1918
# Assume lightdm, nodejs and npm are already installed by 42.app
2019

20+
- name: Install ddcci-dkms # For backlight control on external monitors
21+
tags: [codam.webgreeter, codam.webgreeter.init]
22+
apt:
23+
name: ddcci-dkms
24+
state: present
25+
when: ddcci_backlight_support
26+
2127
- name: Enable ddcci-backlight kernel module
2228
tags: [codam.webgreeter, codam.webgreeter.init]
2329
become: true
2430
modprobe:
2531
name: ddcci-backlight
2632
state: present
2733
persistent: present
34+
when: ddcci_backlight_support
35+
36+
- name: Disable ddcci-backlight kernel module
37+
tags: [codam.webgreeter, codam.webgreeter.init]
38+
become: true
39+
modprobe:
40+
name: ddcci-backlight
41+
state: absent
42+
persistent: absent
43+
when: not ddcci_backlight_support
44+
45+
- name: Remove ddcci-dkms
46+
tags: [codam.webgreeter, codam.webgreeter.init]
47+
apt:
48+
name: ddcci-dkms
49+
state: absent
50+
when: not ddcci_backlight_support
2851

2952
- name: Check if xbacklight binary exists
3053
tags: [codam.webgreeter, codam.webgreeter.init]

0 commit comments

Comments
 (0)