-
Notifications
You must be signed in to change notification settings - Fork 31
Detailed installation
First check that you have the needed requirements:
- Python >=3.7
- uinput kernel module (more on this here)
For Arch based distros: It's live on AUR
If that's checked you can prepare for the setup:
- Load uinput kernel module:
modprobe uinput
(on Manjaro should be loaded by default afaik)
Download the driver
- with git use
git clone https://github.com/JSubelj/g910-gkey-macro-support.git
or - download & unzip
wget https://github.com/JSubelj/g910-gkey-macro-support/archive/refs/heads/master.zip; unzip master.zip
Open the directory: cd g910-gkey-macro-support
or cd g910-gkey-macro-support-master
if you have downloaded the zip.
To run the installer you need to make it executable chmod +x installer.sh
and then execute it ./installer.sh
. You can do this with in one line chmod +x installer.sh; ./installer.sh
-
Install the package
pip install g910-gkeys
-
Setup uinput to be loaded in kernel:
wget https://raw.githubusercontent.com/JSubelj/g910-gkey-macro-support/master/etc/uinput-g910-gkeys.conf; sudo mv uinput-g910-gkeys.conf /etc/modules-load.d/uinput-g910-gkeys.conf
-
Setup udev for user permission on uinput and usb:
wget https://raw.githubusercontent.com/JSubelj/g910-gkey-macro-support/master/etc/60-g910-gkeys.rules; sudo mv 60-g910-gkeys.rules /etc/udev/rules.d/60-g910-gkeys.rules
-
Setup service:
wget https://raw.githubusercontent.com/JSubelj/g910-gkey-macro-support/master/etc/g910-gkeys.service; sudo mv g910-gkeys.service /usr/lib/systemd/user/g910-gkeys.service
-
Reload udev & service daemon:
sudo systemctl restart udev; systemctl --user daemon-reload
-
Download sample config:
mkdir -p "$HOME"/.config/g910-gkeys; wget https://raw.githubusercontent.com/JSubelj/g910-gkey-macro-support/master/etc/config.json; mv config.json "$HOME"/.config/g910-gkeys/config.json
-
Enable and start service
systemctl --user enable --now g910-gkeys.service
- Build and install the package with setuptools:
pip install -e ./
- Verify a successful build and install by running
g910-gkeys -v
You should see something like this:
g910-gkeys 0.4.0 by Jan Šubelj
- Install the driver as a system service:
cp ./etc/g910-gkeys.service "$HOME"/.config/systemd/user/g910-gkeys.service; systemctl --user daemon-reload
- To start the driver now and automatically on every boot run
systemctl --user enable --now g910-gkeys
If you just want to start the driver for this session skip the last step and use: systemctl --user start g910-gkeys
. You can also stop the service with systemctl --user stop g910-gkeys
.
These are the plus sides to running the driver with a service manager and I believe there are many more:
- You don't have to worry about the number of instances spawned. There is only one, and you can't by mistake spawn more of them
- Service manager takes care of correctly shutting down the program
- The driver launches as soon as possible (if enabled with
systemctl --user enable g910-gkeys
) - You can diagnose the driver by running
systemctl --user status g910-gkeys
and looking at systemd logs withjournalctl --user -u g910-gkeys
The driver should work now and pressing the G1 key should typeout: This is profile m1
Be sure to enter a text window/field before hitting G1, since the type out use the focus of the cursor.
Now that you installed the driver successfully you can configure your Gkeys mapping as described here: Configuration
If the driver still doesn't work correctly troubleshoot it as described here: Troubleshooting