From 71070b9db5aa2ea24c4fcd7e263d35184d3e4e4a Mon Sep 17 00:00:00 2001 From: Kamil Strzempowicz Date: Wed, 31 Jan 2018 22:20:28 +0100 Subject: [PATCH] updated documentation --- CONTRIBUTORS.md | 5 +++- INSTALL.md | 34 ++++++++++++++--------- README.md | 74 +++++++++++++++++++++++-------------------------- 3 files changed, 59 insertions(+), 54 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 93320bf..c790d98 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# g810-led - CONTRIBUTORS (alpha order) :
+# g810-led - CONTRIBUTORS (alpha order): ## [andreast1990](https://github.com/andreast1990) : * Add Wireshark dump for g910 @@ -25,6 +25,9 @@ ## [jdagerbo](https://github.com/jdagerbo) : * Refactor many of the code (very hard work) +## [konserw](https://github.com/konserw) : +* CMake cupport + ## [Landrovan](https://github.com/Landrovan) : * Improve support of G410 (two times) diff --git a/INSTALL.md b/INSTALL.md index ceb841d..e338941 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,28 +1,28 @@ -# Installation :
+# Installation: -## Build dependencies :
+## Build dependencies: * git * g++ * make -## Dependencies :
+## Dependencies:> * hidapi or libusb -## hidapi vs libusb :
+## hidapi vs libusb: hidapi is a newer implementation but needs more testing.
hidapi is more responsive than libusb (~20ms vs ~150ms).
hidapi seem not work on CentOS, writing on hidraw is not allowed.
hidapi is recommended but if you encounter problem on your system, switch to libusb.
-## Installation by repos :
-ArchLinux (aur) :
+## Installation by repos: +ArchLinux (aur):
`yaourt -S g810-led-git` # with yaourt
`pacaur -S g810-led-git` # with pacaur
-## Installation of dependencies :
-ArchLinux :
+## Installation of dependencies: +ArchLinux:
`sudo pacman -S git gcc make hidapi` # for hidapi
`sudo pacman -S git gcc make libusb` # for libusb
Debian :
@@ -32,26 +32,34 @@ Fedora :
`sudo dnf install git make gcc-c++ hidapi-devel` # for hidapi
`sudo dnf install git make gcc-c++ libusbx-devel` # for libusb
-## Installation :
+## Installation: `git clone https://github.com/MatMoul/g810-led.git`
`cd g810-led`
+### Makefile variant: `make bin` # for hidapi
`make bin LIB=libusb` # for libusb
`sudo make install`
+### CMake variant: +`cmake -E make_directory build +`cmake -E chdir build cmake ..` +`cmake --build build` +TODO: CMake variant for installation -## Installation of the library (For developpers) :
+## Installation of the library (For developpers): `make lib` # for hidapi
`make lib LIB=libusb` # for libusb
`sudo make install-lib` to install the libg810-led library.
`sudo make install-dev` to install the libg810-led library and headers for development.
+TODO: CMake variant for this -## Update :
+## Update: Same as install, but your profile and reboot files are preserved.
-## Uninstall :
+## Uninstall: `sudo make uninstall`
+TODO: CMake variant for this -## Boot profiles :
+## Boot profiles: On boot, the keyboard is set with the udev file /etc/udev/rules.d/g810-led.rules
This file launch the profile stored in /etc/g810-led/profile
To prevent your keyboard to flash 3 time when you reboot, a systemd unit (g810-led-reboot) is available for this.
diff --git a/README.md b/README.md index 494a373..b007142 100644 --- a/README.md +++ b/README.md @@ -20,51 +20,45 @@ Linux led controller for Logitech G213, G410, G610, G810, G910 and GPRO Keyboard * [INSTALL.md](https://github.com/MatMoul/g810-led/blob/master/INSTALL.md) ## Help :
-`g213-led --help`
-`g410-led --help`
-`g610-led --help`
-`g810-led --help`
-`g910-led --help`
-`gpro-led --help`
- -`g810-led --help-keys`
-`g810-led --help-effects`
-`g810-led --help-samples`
+`ledkeyboard --help`
+`ledkeyboard --help-keys`
+`ledkeyboard --help-effects`
+`ledkeyboard --help-samples`
## Samples :
-`g810-led -p /etc/g810/profile # Load a profile`
-`g810-led -k logo ff0000 # Set color of a key`
-`g810-led -a 00ff00 # Set color of all keys`
-`g810-led -g fkeys ff00ff # Set color of a group of keys`
-`g810-led -s color # Set keyboard power on effect`
-`g810-led -fx color keys 00ff00 # Set fixed color effect`
-`g810-led -fx breathing logo 00ff00 0a # Set breathing effect`
-`g810-led -fx cycle all 0a # Set color cycle effect`
-`g810-led -fx hwave keys 0a # Set horizontal wave effect`
-`g810-led -fx vwave keys 0a # Set vertical wave effect`
-`g810-led -fx cwave keys 0a # Set center wave effect`
+`ledkeyboard -p /etc/g810/profile # Load a profile`
+`ledkeyboard -k logo ff0000 # Set color of a key`
+`ledkeyboard -a 00ff00 # Set color of all keys`
+`ledkeyboard -g fkeys ff00ff # Set color of a group of keys`
+`ledkeyboard -s color # Set keyboard power on effect`
+`ledkeyboard -fx color keys 00ff00 # Set fixed color effect`
+`ledkeyboard -fx breathing logo 00ff00 0a # Set breathing effect`
+`ledkeyboard -fx cycle all 0a # Set color cycle effect`
+`ledkeyboard -fx hwave keys 0a # Set horizontal wave effect`
+`ledkeyboard -fx vwave keys 0a # Set vertical wave effect`
+`ledkeyboard -fx cwave keys 0a # Set center wave effect`
## Samples with no commit :
-`g810-led -an 000000 # Set color of all key with no action`
-`g810-led -gn modifiers ff0000 # Set color of a group with no action`
-`g810-led -kn w ff0000 # Set color of a key with no action`
-`g810-led -kn a ff0000 # Set color of a key with no action`
-`g810-led -kn s ff0000 # Set color of a key with no action`
-`g810-led -kn d ff0000 # Set color of a key with no action`
-`g810-led -c # Commit all changes`
+`ledkeyboard -an 000000 # Set color of all key with no action`
+`ledkeyboard -gn modifiers ff0000 # Set color of a group with no action`
+`ledkeyboard -kn w ff0000 # Set color of a key with no action`
+`ledkeyboard -kn a ff0000 # Set color of a key with no action`
+`ledkeyboard -kn s ff0000 # Set color of a key with no action`
+`ledkeyboard -kn d ff0000 # Set color of a key with no action`
+`ledkeyboard -c # Commit all changes`
## Samples for g610 :
-`g610-led -a 60 # Set intensity of all keys`
-`g610-led -k logo ff # Set intensity of a key`
-`g610-led -g fkeys aa # Set intensity of a group of keys`
+`ledkeyboard -a 60 # Set intensity of all keys`
+`ledkeyboard -k logo ff # Set intensity of a key`
+`ledkeyboard -g fkeys aa # Set intensity of a group of keys`
## Samples for g213 :
-`g213-led -a 00ff00 # Set all keys green`
-`g213-led -r 1 ff0000 # Set region 1 red`
+`ledkeyboard -a 00ff00 # Set all keys green`
+`ledkeyboard -r 1 ff0000 # Set region 1 red`
## Samples with pipe (for effects) :
-`g810-led -pp < profilefile # Load a profile`
-`echo -e "k w ff0000\nk a ff0000\nk s ff0000\nk d ff0000\nc" | g810-led -pp # Set multiple keys`
+`ledkeyboard -pp < profilefile # Load a profile`
+`echo -e "k w ff0000\nk a ff0000\nk s ff0000\nk d ff0000\nc" | ledkeyboard -pp # Set multiple keys`
## Testing unsuported keyboards :
Start by retrieve the VendorID and the ProductID of your keyboard with lsusb.
@@ -72,19 +66,19 @@ Start by retrieve the VendorID and the ProductID of your keyboard with lsusb. `Bus 001 Device 001: ID 046d:c331 Logitech, Inc.`
In this sample VendorID is 046d and ProductID is c331. Now test your keyboard with all supported protocol :
-`g810-led -dv 046d -dp c331 -tuk 1 -a 000000`
+`ledkeyboard -dv 046d -dp c331 -tuk 1 -a 000000`
If your keyboard set all key to off you have found the protocol (1), if not continue.
-`g810-led -dv 046d -dp c331 -tuk 2 -a 000000`
+`ledkeyboard -dv 046d -dp c331 -tuk 2 -a 000000`
If your keyboard set all key to off you have found the protocol (2), if not continue.
-`g810-led -dv 046d -dp c331 -tuk 3 -a 000000`
+`ledkeyboard -dv 046d -dp c331 -tuk 3 -a 000000`
If your keyboard set all key to off you have found the protocol (3), if not, need new dump.
## Building and linking against the libg810-led library :
Include in implementing source files.
```cpp -#include +#include "Keyboard.h" ``` -To link, simply provide `-lg810-led` to the build flags.
+To link, simply provide `-llibledkeyboard` to the build flags.
To build the g810-led application as a dynamically-linked variant, run the target:
`make bin-linked`