forked from Whonix/kloak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new devices attached after kloak starts (adapted from v…
- Loading branch information
1 parent
7f9bc1b
commit 0d91a09
Showing
3 changed files
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ kloak usr/sbin/ | |
|
||
etc/* | ||
usr/* | ||
lib/* |
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,23 @@ | ||
SUBSYSTEM!="input", GOTO="end" | ||
|
||
|
||
# do not run kloak on devices created by kloak | ||
KERNEL=="event*", ATTRS{name}=="kloak*", GOTO="end" | ||
|
||
# new keyboard or mouse attached, start kloak@event[0-9].service | ||
KERNEL=="event*", ACTION=="add", ENV{ID_INPUT_KEYBOARD}=="1", RUN+="/usr/bin/systemctl restart kloak.service" | ||
KERNEL=="event*", ACTION=="add", ENV{ID_INPUT_KEYBOARD}=="1", GOTO="end" | ||
|
||
KERNEL=="event*", ACTION=="add", ENV{ID_INPUT_MOUSE}=="1", RUN+="/usr/bin/systemctl restart kloak.service" | ||
KERNEL=="event*", ACTION=="add", ENV{ID_INPUT_MOUSE}=="1", GOTO="end" | ||
|
||
|
||
# keyboard or mouse removed, stop the service | ||
KERNEL=="event*", ACTION=="remove", ENV{ID_INPUT_KEYBOARD}=="1", RUN+="/usr/bin/systemctl restart kloak.service" | ||
KERNEL=="event*", ACTION=="remove", ENV{ID_INPUT_KEYBOARD}=="1", GOTO="end" | ||
|
||
KERNEL=="event*", ACTION=="remove", ENV{ID_INPUT_MOUSE}=="1", RUN+="/usr/bin/systemctl restart kloak.service" | ||
KERNEL=="event*", ACTION=="remove", ENV{ID_INPUT_MOUSE}=="1", GOTO="end" | ||
|
||
|
||
LABEL="end" |
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