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
nixos/libinput: change mouse device defaults #110350
Conversation
CC @lheckemann @worldofpeace (if you're feeling better). |
Tested in my notebook:
|
Since I learned a lot while looking for the issues in this module, I added myself as maintainer. But since those more core modules doesn't seem to have maintainers, if someone is against it I can remove. |
@@ -85,7 +91,7 @@ let cfg = config.services.xserver.libinput; | |||
|
|||
middleEmulation = mkOption { | |||
type = types.bool; | |||
default = true; | |||
default = mkDefaultForDevice deviceType { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option makes sense if your mouse have only two buttons (I think this is the case even for some recent mouses, like Logitech MX Master series, where the scroll doesn't click). But setting the default to false since most mouses have three buttons (generally the scroll is the middle button).
default = "twofinger"; | ||
type = types.nullOr (types.enum [ "twofinger" "edge" "button" "none" ]); | ||
default = mkDefaultForDevice deviceType { mouse = null; touchpad = "twofinger"; }; | ||
visible = mkDefaultForDevice deviceType { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiding this since this settings seems only to make sense for touchpads
. Allowing null
values so it doesn't show in mouse configuration.
default = true; | ||
type = types.nullOr types.bool; | ||
default = mkDefaultForDevice deviceType { mouse = null; touchpad = true; }; | ||
visible = mkDefaultForDevice deviceType { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiding this since this settings seems only to make sense for touchpads
. Allowing null
values so it doesn't show in mouse configuration.
default = true; | ||
type = types.nullOr types.bool; | ||
default = mkDefaultForDevice deviceType { mouse = null; touchpad = true; }; | ||
visible = mkDefaultForDevice deviceType { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiding this since this settings seems only to make sense for touchpads
. Allowing null
values so it doesn't show in mouse configuration.
@GrahamcOfBorg test libinput |
/marvin opt-in |
Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here. |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR Note: This feature is currently broken. The bot will not actually change the status. If you see this message multiple times, please request a status change manually. |
1 similar comment
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR Note: This feature is currently broken. The bot will not actually change the status. If you see this message multiple times, please request a status change manually. |
Would splitting this PR in smaller parts make it easier to review? The most important part (the changes to libinput module) can be only one separate PR for example, while the other changes (the refactoring in synaptics, tests) can be another PRs. WDYT @lheckemann ? |
Hey, I'm not sure if this could be the source of the problem or not but I've been having issues with my Logitech G602 for the past few weeks on unstable. I just remembered I saw the red text telling me Now, the touchpad is still fine but the mouse does this weird thing where after a few seconds of inactivity, upon moving it it seems to be totally disabled for ~2s before finally waking up and functioning again. I also reinstalled nixos from scratch about a week ago, and since then for some reason, now it does that AND the extra side buttons (everything besides left/right/middle,scroll/back/forward) doesn't work. xev reports nothing from those buttons and also nothing during that 2s disabled period prior to waking up. Output of my
|
Looks like USB power saving. Do you use powertop, TLP or something like this? They have USB power savings enabled at a pretty aggressive mode.
This may be related to PR #108909. But like the PR said, you need to configure your mouse separately. If you want exactly same behavior between mouse and touchpad, you can have something like this in your config: let
libinputConfig = {
naturalScrolling = true;
...
};
in {
xserver.libinput.touchpad = libinputConfig // { accelProfile = "adaptative"; };
xserver.libinput.mouse = libinputConfig // { accelProfile = "flat"; };
} If this doesn't work them it is probably not #108909, maybe some other PR for libinput or something else. P.S.: this PR can't be at fault since it is not merged. |
I find the
|
I did it like this because accordingly to libinput documentation it hint that those options can also make sense in some exotic peripherals (maybe a mouse with a touch surface like a Apple Magic Mouse, for example). So I decided to hide them instead of removing them, so if the user has some of those exotic devices they can still use those options if needed. I can remove the |
Did the change and rebased. WDYT @lheckemann? |
Lol my bad, you're absolutely right I didn't even notice. Think I just searched the issues and clicked the first thing with libinput in the title, "that has to be it"... haha thank you anyway. That was helpful, powertop was indeed the culprit with the sleeping thing; still investigating the buttons but I'm still a newb to nix the language and coincidentally always wondered how to merge options like that. |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR Note: This feature is currently broken. The bot will not actually change the status. If you see this message multiple times, please request a status change manually. |
Sorry for taking so long. An unrelated change seems to have sneaked in to d726fc9717e406fdd361aeda25972265631cfc91. I don't have the energy to review the main content currently, sorry. |
This commit changes some mouse device defaults that doesn't make sense (generally) for a mouse, like tapping/tappingDragLock or middleEmulation (it works in mouses, but unless you have a mouse with only 3 buttons it doesn't make much sense to have it enabled). They're now set to false or null depending of the case. Since those options can still be useful in some exotic cases, instead of disabling those options in mouse, I set them with `visible = false;`. This way, they don't show in manual, but in the case the user needs it can still be set.
@lheckemann Removed, thanks.
Ok, no problem. |
@worldofpeace If you're feeling better can you review this PR? |
You're in luck, I'm active again (supposedly) |
I marked this as stale due to inactivity. → More info |
Closing some old PRs of mine. |
Motivation for this change
This commit changes some mouse device defaults that doesn't make sense (generally) for a mouse, like
tapping
/tappingDragLock
ormiddleEmulation
(it works in mouses, but unless you have a mouse withonly 3 buttons it doesn't make much sense to have it enabled). They're now set to false or null depending of the case.
Since those options can still be useful in some exotic cases, instead of disabling those options in mouse, I set them with
visible = false;
. This way, they don't show in manual, but in the case the user needs it can still be set.Also, I moved
services.xserver.synaptics
config fromservices.xserver.config
toservices.xserver.inputClassSections
. The reason is the same as stated here: https://github.com/NixOS/nixpkgs/pull/108909/files#r555458053.Added some tests for
services.xserver.libinput
module to make sure it will keep working as it should.Continuation of PR #108909.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)