Skip to content

Commit 1115b8d

Browse files
committed
init
0 parents  commit 1115b8d

File tree

3 files changed

+1151
-0
lines changed

3 files changed

+1151
-0
lines changed

49-pulsar-mouse.rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ATTRS{idVendor}=="3554", ATTRS{idProduct}=="f508", MODE="0664", GROUP="input"

README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# python-pulsar-mouse-tool
2+
A tool to view/edit the on-device settings of a Pulsar mouse.
3+
An alternative to the Windows-only Pulsar Fusion software.
4+
5+
Supported mice:
6+
- Pulsar X2 v2 Mini
7+
8+
Features:
9+
- view and modify settings stored on the mouse hardware
10+
- view battery information
11+
12+
## History
13+
The protocol was reverse engineered using Wireshark to inspect USB packets
14+
when the mouse was passed-through to a Windows virtual machine running
15+
the official Pulsar Fusion software.
16+
17+
It was mainly created for me to view the battery charge percentage and will
18+
likely not see expanded support for other Pulsar mice. It also does not implement
19+
all the features that Pulsar Fusion allows for configuration of (eg. button remapping, macros).
20+
21+
This repository serves mainly as a documentation of my reverse-engineering efforts and
22+
could serve as a reference for implmenting in a more accesible, widely-used piece of software
23+
(eg. [libratbag](https://github.com/libratbag/libratbag)).
24+
25+
26+
## Setup
27+
Requires Python 3.7+ and [pyusb](https://github.com/pyusb/pyusb).
28+
29+
Simply clone this repository and run `python3 pulsar.py`.
30+
31+
**Note:** You'll likely need to either run with `sudo` or add a [udev rule](49-pulsar-mouse.rules).
32+
33+
## Usage
34+
```
35+
$ ./pulsar.py --help
36+
usage: pulsar.py [-h] [--dpi DPI] [--dpi-mode DPI_MODE] [--led-brightness LED_BRIGHTNESS] [--led-color LED_COLOR]
37+
[--led-effect {off,steady,breathe}] [--polling-rate {1000,500,250,125}] [--restore]
38+
39+
options:
40+
-h, --help show this help message and exit
41+
--dpi DPI
42+
--dpi-mode DPI_MODE
43+
--led-brightness LED_BRIGHTNESS
44+
--led-color LED_COLOR
45+
--led-effect {off,steady,breathe}
46+
--polling-rate {1000,500,250,125}
47+
--restore restore factory-default settings
48+
```
49+
50+
51+
## Examples
52+
### Retreive Current Settings and Battery Status
53+
```
54+
$ ./pulsar.py
55+
{
56+
"active_dpi_mode": 0,
57+
"active_profile": 0,
58+
"angle_snapping_enabled": false,
59+
"autosleep_seconds": 60,
60+
"debounce_milliseconds": 3,
61+
"dpi_modes": [
62+
{
63+
"dpi": 400,
64+
"dpi_mode": 0,
65+
"led_color": "#2c2d2e"
66+
},
67+
{
68+
"dpi": 800,
69+
"dpi_mode": 1,
70+
"led_color": "#303132"
71+
},
72+
{
73+
"dpi": 1600,
74+
"dpi_mode": 2,
75+
"led_color": "#343536"
76+
},
77+
{
78+
"dpi": 3200,
79+
"dpi_mode": 3,
80+
"led_color": "#38393a"
81+
}
82+
],
83+
"led": {
84+
"effect": null,
85+
"enabled": false
86+
},
87+
"lod": {
88+
"mm": 1,
89+
"ripple_enabled": false
90+
},
91+
"motion_sync_enabled": true,
92+
"polling_rate_hz": 1000,
93+
"power": {
94+
"battery_millivolts": 3871,
95+
"battery_percent": 50,
96+
"connected": false
97+
}
98+
}
99+
```
100+
101+
### Set the active DPI mode's DPI
102+
```
103+
$ ./pulsar.py --dpi 400
104+
```

0 commit comments

Comments
 (0)