用 Solaar 在 NixOS 上設定羅技 Master 3S 拇指滾輪

NixOS 上用 Solaar 設定羅技 Master 3S 拇指滾輪來切換前後分頁。

NixOS 上安裝 Solaar

安裝 solaar 並加上 udev rule 讓非 root 也能使用 (ref)

configuration.nix

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
environment.systemPackages = with pkgs; [
solaar
];

services.udev.extraRules = ''
# Allows non-root users to have raw access to Logitech devices.
# Allowing users to write to the device is potentially dangerous
# because they could perform firmware updates.
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"

ACTION == "remove", GOTO="solaar_end"
SUBSYSTEM != "hidraw", GOTO="solaar_end"

# USB-connected Logitech receivers and devices
ATTRS{idVendor}=="046d", GOTO="solaar_apply"

# Lenovo nano receiver
ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="6042", GOTO="solaar_apply"

# Bluetooth-connected Logitech devices
KERNELS == "0005:046D:*", GOTO="solaar_apply"

GOTO="solaar_end"

LABEL="solaar_apply"

# Allow any seated user to access the receiver.
# uaccess: modern ACL-enabled udev
TAG+="uaccess"

# Grant members of the "plugdev" group access to receiver (useful for SSH users)
#MODE="0660", GROUP="plugdev"

LABEL="solaar_end"
# vim: ft=udevrules
'';

之後 rebuild

Solaar 設定 MX Master 3S 拇指滾輪

MX Master 3S 設定打開 Thumb Wheel DirectionThumb Wheel Diversion

config

設定 User-defined rules 做換頁:

rule

在 KDE 設定啟動時執行 Solaar

到 KDE 的 System Settings => Autostart 加入 application Solaar,編輯 properties 到 Application tab 在 Arguments 加上 --window=hide 讓 Solaar 啟動的時候不會把視窗也打開 (ref)。