gKeyMapper
GTK4 application (C++) for remapping the G keys G1–G9 of a Logitech G910 to other keys or commands (Linux Mint / Ubuntu).
The current focus is on the GUI only (no actual key capture/command execution yet).
Documentation and source comments are written in English.
Requirements
- Linux Mint / Ubuntu
- g++ (C++17)
- pkg-config
- gettext (for translations,
msgfmt) - GTK 4 development files
Install dependencies
sudo apt update
sudo apt install -y build-essential gettext libgtk-4-dev
Afterwards pkg-config --modversion gtk4 should print a version (e.g. 4.6.x).
Setting up the project
Change to the project directory:
cd /home/trager/Nextcloud/Projekte/C++/gKeyMapper
(Alternatively clone the repository or copy the project folder to your own location.)
Build
make
This produces the gkeymapper binary and the .mo translations under locale/.
Rebuild translations
make translations
Run
Normal:
./gkeymapper
With explicit language files (useful for testing from the build directory):
LANG=de_DE.UTF-8 GKEYMAPPER_LOCALEDIR=$PWD/locale ./gkeymapper
Supported languages: German, English, Spanish, French.
Install (optional)
sudo make install
Installs gkeymapper to /usr/local/bin and the .mo files to
/usr/local/share/locale.
Clean
make clean
Removes the binary and the generated locale/ directory.
Project structure
src/main.cpp # GTK4 GUI
po/ # Translations (pot/po/mo targets)
Makefile # Build via pkg-config + gettext
.vscode/tasks.json # VS Code tasks for make
README.md
Troubleshooting
Package gtk4 was not found
The GTK 4 development files are missing. Install them:
sudo apt install -y libgtk-4-dev
Then verify:
pkg-config --modversion gtk4
pkg-config cannot find .pc files (wrong search path)
In some environments PKG_CONFIG_PATH must be set explicitly. Standard path on
Ubuntu/Mint:
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig
Planned next steps
- Real capture of key presses (evdev/uinput or libinput).
- Execution of commands when a G key is pressed.
- Loading and saving profiles.
- Autostart service / background daemon.