Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guivm: Passthrough the multimedia keys #592

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion modules/desktop/graphics/labwc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,18 @@
</font>
</theme>
<keyboard>
<default />
${lib.optionalString config.ghaf.profiles.debug.enable ''
<keybind key="Print">
<action name="Execute" command="${pkgs.grim}/bin/grim" />
</keybind>
''}
<default />
<keybind key="XF86_MonBrightnessUp">
<action name="Execute" command="${pkgs.brightnessctl}/bin/brightnessctl set +10%" />
</keybind>
<keybind key="XF86_MonBrightnessDown">
<action name="Execute" command="${pkgs.brightnessctl}/bin/brightnessctl set 10%-" />
</keybind>
</keyboard>
<mouse><default /></mouse>
<windowRules>
Expand Down Expand Up @@ -288,5 +294,10 @@ in {
};
wantedBy = ["default.target"];
};

#Allow video group to change brightness
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video $sys$devpath/brightness", RUN+="${pkgs.coreutils}/bin/chmod a+w $sys$devpath/brightness"
'';
};
}
3 changes: 3 additions & 0 deletions modules/hardware/lenovo-x1/definitions/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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 All @@ -48,6 +49,8 @@ in {
services.udev.extraRules = ''
# 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 Down
1 change: 1 addition & 0 deletions targets/lenovo-x1/everything.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,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