Skip to content

Commit

Permalink
guivm: Passthrough the multimedia keys
Browse files Browse the repository at this point in the history
Thinkpad multimedia function keys have a different input device.
  • Loading branch information
Nerox9 committed May 3, 2024
1 parent c46113e commit 1b29e1a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/common/hardware/lenovo-x1/definitions/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ in {
in ''
# Laptop keyboard
SUBSYSTEM=="input", ATTRS{name}=="AT Translated Set 2 keyboard", GROUP="kvm"
# Laptop keyboard multimedia buttons
SUBSYSTEM=="input", ATTRS{name}=="ThinkPad Extra Buttons", GROUP="kvm"
# Laptop TrackPoint
SUBSYSTEM=="input", ATTRS{name}=="TPPS/2 Elan TrackPoint", GROUP="kvm"
# Lenovo X1 integrated webcam
Expand All @@ -44,6 +46,7 @@ in {
virtioInputHostEvdevs = [
# Lenovo X1 touchpad and keyboard
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
"/dev/input/by-path/platform-thinkpad_acpi-event"
"/dev/mouse"
"/dev/touchpad"
# Lenovo X1 trackpoint (red button/joystick)
Expand Down
1 change: 1 addition & 0 deletions targets/lenovo-x1/everything.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"iommu=pt"
# Prevent i915 module from being accidentally used by host
"module_blacklist=i915"
"acpi_backlight=vendor"

"vfio-pci.ids=${builtins.concatStringsSep "," vfioPciIds}"
];
Expand Down
18 changes: 18 additions & 0 deletions targets/lenovo-x1/guivmExtraModules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,24 @@
};
};

# Keyboard multimedia key bindings
programs.light.enable = true;
services.actkbd = {
enable = true;
bindings = [
{
keys = [224];
events = ["key"];
command = "/run/current-system/sw/bin/light -U 10";
}
{
keys = [225];
events = ["key"];
command = "/run/current-system/sw/bin/light -A 10";
}
];
};

# Open TCP port for the PDF XDG socket
networking.firewall.allowedTCPPorts = [xdgPdfPort];
# Early KMS needed for GNOME to work inside GuiVM
Expand Down

0 comments on commit 1b29e1a

Please sign in to comment.