-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Suspend/Resume Support via Systemd
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=DuMang DK6 Layer Sync (Python Invoke) | ||
|
||
[Service] | ||
Type=Simple | ||
ExecStart=dumang-sync | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
[Unit] | ||
Description=DuMang DK6 Layer Sync | ||
# NOTE: Two systemd services are required since on suspend, libusb does NOT raise a HOTPLUG_EVENT_DEVICE_LEFT | ||
# event. This means the sync script doesn't know the keyboard handles are invalid upon resuming. | ||
# TODO: Is this expected behavior on part of libusb or a bug? | ||
Before=sleep.target | ||
StopWhenUnneeded=yes | ||
|
||
[Service] | ||
Type=Simple | ||
ExecStart=dumang-sync | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=-/bin/systemctl stop dumang-sync-python.service | ||
ExecStop=-/bin/systemctl start dumang-sync-python.service | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
WantedBy=sleep.target |