feat: add udev rule for auto-screenshare

This commit is contained in:
Leon Schwarzäugl 2025-03-22 22:39:28 +01:00
parent 1ae3be96fa
commit a7e7557489
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
4 changed files with 41 additions and 2 deletions

View file

@ -4818,6 +4818,7 @@ Mostly used to install some compilers and lsp's that I want to have available wh
dbus
swaylock-effects
syncthingtray-minimal
wl-mirror
# secure boot
sbctl
@ -4837,6 +4838,8 @@ Mostly used to install some compilers and lsp's that I want to have available wh
# better make for general tasks
just
screenshare
# keyboards
qmk
vial
@ -8373,6 +8376,29 @@ Options that I need specifically at work. There are more options at [[#h:f0b2ea9
};
};
};
udev.extraRules = ''
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
'';
};
systemd.services.swarsel-screenshare = {
enable = true;
description = "Screensharing service upon dongle plugin";
serviceConfig = {
ExecStart = "${pkgs.screenshare}/bin/screenshare";
User = mainUser;
Group = "users";
Environment = [
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/${mainUser}/bin"
"XDG_RUNTIME_DIR=${xdgDir}"
"WAYLAND_DISPLAY=wayland-1"
];
Type = "oneshot";
StandardOutput = "journal";
StandardError = "journal";
};
};
# cgroups v1 is required for centos7 dockers
@ -8798,7 +8824,6 @@ This is just a separate container for derivations defined in [[#h:64a5cc16-6b16-
opacitytoggle
fs-diff
github-notifications
screenshare
hm-specialisation
t2ts
ts2t
@ -10852,6 +10877,12 @@ Currently, I am too lazy to explain every option here, but most of it is very se
class = ".*";
};
}
{
command = "opacity 1";
criteria = {
app_id = "at.yrlf.wl_mirror";
};
}
{
command = "opacity 1";
criteria = {

View file

@ -14,7 +14,6 @@
opacitytoggle
fs-diff
github-notifications
screenshare
hm-specialisation
t2ts
ts2t

View file

@ -190,6 +190,12 @@ in
class = ".*";
};
}
{
command = "opacity 1";
criteria = {
app_id = "at.yrlf.wl_mirror";
};
}
{
command = "opacity 1";
criteria = {

View file

@ -22,6 +22,7 @@
dbus
swaylock-effects
syncthingtray-minimal
wl-mirror
# secure boot
sbctl
@ -41,6 +42,8 @@
# better make for general tasks
just
screenshare
# keyboards
qmk
vial