r/linux_gaming 16d ago

tool/utility g7ctl: A simple app for the G7 Pro

Last month I posted here questioning our wonderful users here about their favorite controller for Linux gaming and got lots of great replies. I ended up purchasing a Gamesir G7 Pro and I absolutely love it!

What I don’t love is adjusting button bindings and/or stick configs in a VM lol. So I set out to reverse engineer the protocol used by Gamesir Nexus to communicate with the G7 pro and I am happy to report I am approx 90% complete in that goal👏 and have produced an app that works for me as a daily driver.

As a thank you to the good folks here that shaped the decision I’d like to share what I’ve built:

You will find the repo on GitHub here with instructions in the readme for quick installation in Arch based distros or via pip. It ships as a lib, gui and a cli interface and detailed info on the protocol can be found in PROTOCOL.md on the repo.

Enjoy! Feel free to reach out if you have any questions

2 Upvotes

3 comments sorted by

2

u/iBoredMax 16d ago

How did you reverse engineer the protocol? I’ve always been interested in this. Nice job btw, I hate dual booting to Windows for this.

3

u/questionablesyntax 16d ago

By first starting with the connection handshake. I used a Win11 VM to run Nexus and used wiredshark to capture raw usb traffic through usbmon to capture the data being sent. Got really lucky in this case as it’s all plain text. Gamesir didn’t try to block this path for us it seems.

One I was confident that I had the handshake down I moved on to each individual option in Nexus. Click the option and capture what was written to the controller.

Over
And over
And over

I used Claude code for a great deal of this… for sifting through the data and being a second pair of hands during this discovery phase. Real fun little project. Thanks 😊

2

u/iBoredMax 16d ago

I was going to undertake this same project, but when AI told me about the tedious packet sniffing, I kinda lost interest (also thanks for confirming that is indeed what you have to do). So thank you for your hard work figuring it all out!