Skip to content

Commit 08a556e

Browse files
kekrbyWhatAmISupposedToPutHere
authored andcommitted
Make the systemd service bind to the backlight and display devices
This ensures that the service won't be started until both the backlight and display devices are present, and that it will be stopped when one of them disappears
1 parent f6d86c6 commit 08a556e

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

etc/systemd/system/tiny-dfr.service

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[Unit]
22
Description=Tiny Apple silicon touch bar daemon
33
After=systemd-user-sessions.service [email protected] plymouth-quit.service systemd-logind.service
4-
StartLimitIntervalSec=30
5-
StartLimitBurst=2
4+
BindsTo=dev-tiny_dfr_display.device dev-tiny_dfr_backlight.device
65

76
[Service]
87
ExecStart=/usr/bin/tiny-dfr
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
SUBSYSTEM=="input", ATTR{name}=="MacBookPro17,1 Touch Bar", TAG+="systemd", ENV{SYSTEMD_WANTS}="tiny-dfr.service"
22
SUBSYSTEM=="input", ATTR{name}=="Mac14,7 Touch Bar", TAG+="systemd", ENV{SYSTEMD_WANTS}="tiny-dfr.service"
3+
4+
SUBSYSTEM=="drm", KERNEL=="card[0-9]*", DRIVERS=="adp", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/tiny_dfr_display"
5+
6+
SUBSYSTEM=="backlight", KERNEL=="228200000.display-pipe.0", DRIVERS=="panel-summit", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/tiny_dfr_backlight"

0 commit comments

Comments
 (0)