diff --git a/.gitignore b/.gitignore index 1f46a0e..8d35cb3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -build/ -GPATH -GRTAGS -GTAGS +__pycache__ +*.pyc diff --git a/g13gui/LICENSE.txt b/LICENSE.txt similarity index 100% rename from g13gui/LICENSE.txt rename to LICENSE.txt diff --git a/g13gui/MANIFEST.in b/MANIFEST.in similarity index 100% rename from g13gui/MANIFEST.in rename to MANIFEST.in diff --git a/README.md b/README.md index d29c6c7..0e7bea9 100644 --- a/README.md +++ b/README.md @@ -1,216 +1,20 @@ -# Userspace driver for the G13 +The G13 Configurator +==================== -This is a fork of the original public domain driver written by ecraven, with MIT -contributions by James Fowler, and reorganization and cleanups by June -Tate-Gans in prep for more functionality both from a GUI and from the daemon -itself. +## What is this? -## Installation +This is the companion application for configuring a Logitech G13 using the G13 +user space driver originally written by ecraven, and available at +https://github.com/jtgans/g13. -Make sure you have boost and libusb-1.0 installed. +This tool allows you to: -### For Ubuntu (15.10) + - Graphically plan out a keymapping + - Save multiple profiles + - Use the LCD with pluggable dbus-based applications + - Switch profiles using the LCD -* ***sudo apt-get install libusb-1.0-0-dev*** -* ***sudo apt-get install libboost-all-dev*** +All wrapped up in a glorious Gtk 3.0 + libappindicator interface. -### Build - -Compile by running - - make - -If you want to run the daemon as user, put the file 91-g13.rules into -/etc/udev/rules.d/ (or whatever directory your distribution uses). - -## Running - - -Connect your device, then run ./g13d, it should automatically find your device. - -If you see output like - - Known keys on G13: - BD DOWN G1 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G2 G20 G21 G22 G3 G4 G5 G6 G7 - G8 G9 L1 L2 L3 L4 LEFT LIGHT LIGHT2 LIGHT_STATE M1 M2 M3 MISC_TOGGLE MR TOP UND - EF1 UNDEF3 - Known keys to map to: - 0 1 2 3 4 5 6 7 8 9 A APOSTROPHE B BACKSLASH BACKSPACE C CAPSLOCK COMMA D DELETE - DOT DOWN E END ENTER EQUAL ESC F F1 F10 F11 F12 F2 F3 F4 F5 F6 F7 F8 F9 G GRAVE - H HOME I INSERT J K KP0 KP1 KP2 KP3 KP4 KP5 KP6 KP7 KP8 KP9 KPASTERISK KPDOT K - PMINUS KPPLUS L LEFT LEFTALT LEFTBRACE LEFTCTRL LEFTSHIFT M MINUS N NUMLOCK O - P PAGEDOWN PAGEUP Q R RIGHT RIGHTALT RIGHTBRACE RIGHTCTRL RIGHTSHIFT S SCROLLL - OCK SEMICOLON SLASH SPACE T TAB U UP V W X Y Z - Found 1 G13s - - Active Stick zones - STICK_UP { 0 x 0.1 / 1 x 0.3 } SEND KEYS: UP - STICK_DOWN { 0 x 0.7 / 1 x 0.9 } SEND KEYS: DOWN - STICK_LEFT { 0 x 0 / 0.2 x 1 } SEND KEYS: LEFT - STICK_RIGHT { 0.8 x 0 / 1 x 1 } SEND KEYS: RIGHT - STICK_PAGEUP { 0 x 0 / 1 x 0.1 } SEND KEYS: PAGEUP - STICK_PAGEDOWN { 0 x 0.9 / 1 x 1 } SEND KEYS: PAGEDOWN - - - -that is good. This also shows you which name the keys on the G13 have, and what -keys you can bind them to. - -### Command line options - -The following options can be used when starting g13d - -Option | Description ---------------------|------------------------------------------------- - --help | show help - --logo *arg* | set logo from file - --config *arg* | load config commands from file - --pipe_in *arg* | specify name for input pipe - --pipe_out *arg* | specify name for output pipe - -## Configuring / Remote Control - -Configuration is accomplished using the commands described in the [Commands] section. - -Commands can be loaded from a file specified by the --config option on the -command line. - -Commands can be also be sent to the command input pipe, which is at -***/tmp/g13-0*** by default. Example: - - echo rgb 0 255 0 > /tmp/g13-0 - -### Actions - -Various parts of configuring the G13 depend on assigning actions to occur based -on something happening to the G13. - -* key, possible values shown upon startup (e.g. ***KEY_LEFTSHIFT***). -* multiple keys, like ***KEY_LEFTSHIFT+KEY_F1*** -* pipe output, by using ">" followed by text, as in ***>Hello*** - causing - **Hello** (plus newline) to be written to the output pipe ( **/tmp/g13-0_out** - by default ) -* command, by using "!" followed by text, as in ***!stick_mode KEYS*** - -## Commands - -### rgb *r* *g* *b* - -Sets the backlight color - -### mod *n* - -Sets the background light of the mod-keys. *n* is the sum of 1 (M1), 2 (M2), 4 -(M3) and 8 (MR) (i.e. 13 would set M1, M3 and MR, and unset M2). - -### bind *keyname* *action* - -This binds a key or a stick zone. -* The possible values of *keyname* for keys are shown upon startup (e.g. G1). -* The possible values of *action* are described in [Actions]. - -### stickmode *mode* - -The stick can be used as an absolute input device or can send key events. You -can change modes to one of the following: - -Mode | Description ------------|--------------------------- -KEYS | translates stick movements into key / action bindings -ABSOLUTE | stick becomes mouse with absolute positioning -RELATIVE | not quite working yet... -CALCENTER | calibrate stick center position -CALBOUNDS | calibrate stick boundaries -CALNORTH | calibrate stick north - -### stickzone *operation* *zonename* *args* - -defines zones to be used when the stick is in KEYS mode - -Where *operation* can be - -operation | what it does -----------|---------------- -add | add a new zone named *zonename* -del | remove zone named *zonename* -action | set action for zone, see [Actions] -bounds | set boundaries for zone, *args* are X1, Y1, X2, Y2, where X1/Y1 are top - | left corner, X2/Y2 are bottom right corner - -Default created zones are LEFT, RIGHT, UP and DOWN. - -Zone boundary coordinates are based on a floating point value from 0.0 -(top/left) to 1.0 (bottom/right). When the stick enters the boundary area, the -zone's action ***down*** activity will be fired. On exiting the boundary, the -action ***up*** activity will be fired. - -Example: - - stickzone add TheBottomLeft - stickzone bounds TheBottomLeft 0.0 0.9 0.1 1.0 - stickzone action KEY_END - -### pos *row* *col* - -Sets the current text position to *row* *col*. -* *row* is specified in characters (0-4), as all fonts are 8 pixels high and - rows start on pixel row 0, 8, 16, 24, or 32 -* *col* is specified in pixels (0-159) - -### out *text* - -Writes *text* to the LCD at the current text position, and advances the current -position based on the font size - -### clear - -Clears the LCD - -### textmode *mode* - -Sets the text mode to *mode*, current options are 0 (normal) or 1 (inverted) - -### refresh - -Resends the LCD buffer - -### profile *profile_name* - -Selects *profile_name* to be the current profile, it if it doesn't exist -creating it as a copy of the current profile. - -All key binding changes (from the bind command) are made on the current profile. - -### font *font_name* - -Switch font, current options are ***8x8*** and ***5x8*** - -### dump *all|current|summary* - -Dumps G13 configuration info to g13d console - -### log_level *trace|debug|info|warning|error|fatal* - -Changes the level of detail written to the g13d console - -### LCD display - -Use pbm2lpbm to convert a pbm image to the correct format, then just cat that -into the pipe (cat starcraft2.lpbm > /tmp/g13-0). The pbm file must be 160x43 -pixels. - -## License - -The original license was listed as below: - -``` -All files without a copyright notice are placed in the public domain. Do with it -whatever you want. - -Some source code files include MIT style license - see files for specifics. -``` - -For contributions sake, all code in this fork is placed under the MIT license -explicitly, according to the LICENSE file at the root of the source tree. This -is equivalent to the public domain license ecraven originally placed the source -under, with the exception of the indemnity and as-is clauses. +Please note: this is an early version of the application and as such it is still +in heavy development. diff --git a/g13gui/.gitignore b/g13gui/.gitignore deleted file mode 100644 index 8d35cb3..0000000 --- a/g13gui/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -__pycache__ -*.pyc diff --git a/g13gui/README.md b/g13gui/README.md deleted file mode 100644 index 0e7bea9..0000000 --- a/g13gui/README.md +++ /dev/null @@ -1,20 +0,0 @@ -The G13 Configurator -==================== - -## What is this? - -This is the companion application for configuring a Logitech G13 using the G13 -user space driver originally written by ecraven, and available at -https://github.com/jtgans/g13. - -This tool allows you to: - - - Graphically plan out a keymapping - - Save multiple profiles - - Use the LCD with pluggable dbus-based applications - - Switch profiles using the LCD - -All wrapped up in a glorious Gtk 3.0 + libappindicator interface. - -Please note: this is an early version of the application and as such it is still -in heavy development. diff --git a/g13gui/g13gui/__init__.py b/g13gui/__init__.py similarity index 100% rename from g13gui/g13gui/__init__.py rename to g13gui/__init__.py diff --git a/g13gui/g13gui/app.py b/g13gui/app.py similarity index 100% rename from g13gui/g13gui/app.py rename to g13gui/app.py diff --git a/g13gui/g13gui/applet/__init__.py b/g13gui/applet/__init__.py similarity index 100% rename from g13gui/g13gui/applet/__init__.py rename to g13gui/applet/__init__.py diff --git a/g13gui/g13gui/applet/applet.py b/g13gui/applet/applet.py similarity index 100% rename from g13gui/g13gui/applet/applet.py rename to g13gui/applet/applet.py diff --git a/g13gui/g13gui/applet/loopbackdisplaydevice.py b/g13gui/applet/loopbackdisplaydevice.py similarity index 100% rename from g13gui/g13gui/applet/loopbackdisplaydevice.py rename to g13gui/applet/loopbackdisplaydevice.py diff --git a/g13gui/g13gui/applet/manager.py b/g13gui/applet/manager.py similarity index 100% rename from g13gui/g13gui/applet/manager.py rename to g13gui/applet/manager.py diff --git a/g13gui/g13gui/applet/switcher.py b/g13gui/applet/switcher.py similarity index 100% rename from g13gui/g13gui/applet/switcher.py rename to g13gui/applet/switcher.py diff --git a/g13gui/g13gui/applets/__init__.py b/g13gui/applets/__init__.py similarity index 100% rename from g13gui/g13gui/applets/__init__.py rename to g13gui/applets/__init__.py diff --git a/g13gui/g13gui/applets/clock.py b/g13gui/applets/clock.py similarity index 100% rename from g13gui/g13gui/applets/clock.py rename to g13gui/applets/clock.py diff --git a/g13gui/g13gui/bitwidgets/__init__.py b/g13gui/bitwidgets/__init__.py similarity index 100% rename from g13gui/g13gui/bitwidgets/__init__.py rename to g13gui/bitwidgets/__init__.py diff --git a/g13gui/g13gui/bitwidgets/button.py b/g13gui/bitwidgets/button.py similarity index 100% rename from g13gui/g13gui/bitwidgets/button.py rename to g13gui/bitwidgets/button.py diff --git a/g13gui/g13gui/bitwidgets/button_tests.py b/g13gui/bitwidgets/button_tests.py similarity index 100% rename from g13gui/g13gui/bitwidgets/button_tests.py rename to g13gui/bitwidgets/button_tests.py diff --git a/g13gui/g13gui/bitwidgets/display.py b/g13gui/bitwidgets/display.py similarity index 100% rename from g13gui/g13gui/bitwidgets/display.py rename to g13gui/bitwidgets/display.py diff --git a/g13gui/g13gui/bitwidgets/display_tests.py b/g13gui/bitwidgets/display_tests.py similarity index 100% rename from g13gui/g13gui/bitwidgets/display_tests.py rename to g13gui/bitwidgets/display_tests.py diff --git a/g13gui/g13gui/bitwidgets/displaydevice.py b/g13gui/bitwidgets/displaydevice.py similarity index 100% rename from g13gui/g13gui/bitwidgets/displaydevice.py rename to g13gui/bitwidgets/displaydevice.py diff --git a/g13gui/g13gui/bitwidgets/fonts.py b/g13gui/bitwidgets/fonts.py similarity index 100% rename from g13gui/g13gui/bitwidgets/fonts.py rename to g13gui/bitwidgets/fonts.py diff --git a/g13gui/g13gui/bitwidgets/fonts_tests.py b/g13gui/bitwidgets/fonts_tests.py similarity index 100% rename from g13gui/g13gui/bitwidgets/fonts_tests.py rename to g13gui/bitwidgets/fonts_tests.py diff --git a/g13gui/g13gui/bitwidgets/label.py b/g13gui/bitwidgets/label.py similarity index 100% rename from g13gui/g13gui/bitwidgets/label.py rename to g13gui/bitwidgets/label.py diff --git a/g13gui/g13gui/bitwidgets/label_tests.py b/g13gui/bitwidgets/label_tests.py similarity index 100% rename from g13gui/g13gui/bitwidgets/label_tests.py rename to g13gui/bitwidgets/label_tests.py diff --git a/g13gui/g13gui/bitwidgets/listview.py b/g13gui/bitwidgets/listview.py similarity index 100% rename from g13gui/g13gui/bitwidgets/listview.py rename to g13gui/bitwidgets/listview.py diff --git a/g13gui/g13gui/bitwidgets/listview_tests.py b/g13gui/bitwidgets/listview_tests.py similarity index 100% rename from g13gui/g13gui/bitwidgets/listview_tests.py rename to g13gui/bitwidgets/listview_tests.py diff --git a/g13gui/g13gui/bitwidgets/rectangle.py b/g13gui/bitwidgets/rectangle.py similarity index 100% rename from g13gui/g13gui/bitwidgets/rectangle.py rename to g13gui/bitwidgets/rectangle.py diff --git a/g13gui/g13gui/bitwidgets/rectangle_tests.py b/g13gui/bitwidgets/rectangle_tests.py similarity index 100% rename from g13gui/g13gui/bitwidgets/rectangle_tests.py rename to g13gui/bitwidgets/rectangle_tests.py diff --git a/g13gui/g13gui/bitwidgets/screen.py b/g13gui/bitwidgets/screen.py similarity index 100% rename from g13gui/g13gui/bitwidgets/screen.py rename to g13gui/bitwidgets/screen.py diff --git a/g13gui/g13gui/bitwidgets/screen_tests.py b/g13gui/bitwidgets/screen_tests.py similarity index 100% rename from g13gui/g13gui/bitwidgets/screen_tests.py rename to g13gui/bitwidgets/screen_tests.py diff --git a/g13gui/g13gui/bitwidgets/widget.py b/g13gui/bitwidgets/widget.py similarity index 100% rename from g13gui/g13gui/bitwidgets/widget.py rename to g13gui/bitwidgets/widget.py diff --git a/g13gui/g13gui/bitwidgets/x11displaydevice.py b/g13gui/bitwidgets/x11displaydevice.py similarity index 100% rename from g13gui/g13gui/bitwidgets/x11displaydevice.py rename to g13gui/bitwidgets/x11displaydevice.py diff --git a/g13gui/g13gui/common.py b/g13gui/common.py similarity index 100% rename from g13gui/g13gui/common.py rename to g13gui/common.py diff --git a/g13gui/g13gui/g13/__init__.py b/g13gui/g13/__init__.py similarity index 100% rename from g13gui/g13gui/g13/__init__.py rename to g13gui/g13/__init__.py diff --git a/g13gui/g13gui/g13/common.py b/g13gui/g13/common.py similarity index 100% rename from g13gui/g13gui/g13/common.py rename to g13gui/g13/common.py diff --git a/g13gui/g13gui/g13/displaydevice.py b/g13gui/g13/displaydevice.py similarity index 100% rename from g13gui/g13gui/g13/displaydevice.py rename to g13gui/g13/displaydevice.py diff --git a/g13gui/g13gui/g13/displaydevice_tests.py b/g13gui/g13/displaydevice_tests.py similarity index 100% rename from g13gui/g13gui/g13/displaydevice_tests.py rename to g13gui/g13/displaydevice_tests.py diff --git a/g13gui/g13gui/g13/manager.py b/g13gui/g13/manager.py similarity index 100% rename from g13gui/g13gui/g13/manager.py rename to g13gui/g13/manager.py diff --git a/g13gui/g13gui/g13/manager_mapping_test.py b/g13gui/g13/manager_mapping_test.py similarity index 100% rename from g13gui/g13gui/g13/manager_mapping_test.py rename to g13gui/g13/manager_mapping_test.py diff --git a/g13gui/g13gui/g13/manager_tests.py b/g13gui/g13/manager_tests.py similarity index 100% rename from g13gui/g13gui/g13/manager_tests.py rename to g13gui/g13/manager_tests.py diff --git a/g13gui/g13gui/g13/stick.py b/g13gui/g13/stick.py similarity index 100% rename from g13gui/g13gui/g13/stick.py rename to g13gui/g13/stick.py diff --git a/g13gui/g13gui/input.py b/g13gui/input.py similarity index 100% rename from g13gui/g13gui/input.py rename to g13gui/input.py diff --git a/g13gui/g13gui/main.py b/g13gui/main.py similarity index 100% rename from g13gui/g13gui/main.py rename to g13gui/main.py diff --git a/g13gui/g13gui/model/__init__.py b/g13gui/model/__init__.py similarity index 100% rename from g13gui/g13gui/model/__init__.py rename to g13gui/model/__init__.py diff --git a/g13gui/g13gui/model/bindingprofile.py b/g13gui/model/bindingprofile.py similarity index 100% rename from g13gui/g13gui/model/bindingprofile.py rename to g13gui/model/bindingprofile.py diff --git a/g13gui/g13gui/model/bindingprofile_tests.py b/g13gui/model/bindingprofile_tests.py similarity index 100% rename from g13gui/g13gui/model/bindingprofile_tests.py rename to g13gui/model/bindingprofile_tests.py diff --git a/g13gui/g13gui/model/bindings.py b/g13gui/model/bindings.py similarity index 100% rename from g13gui/g13gui/model/bindings.py rename to g13gui/model/bindings.py diff --git a/g13gui/g13gui/model/prefs.py b/g13gui/model/prefs.py similarity index 100% rename from g13gui/g13gui/model/prefs.py rename to g13gui/model/prefs.py diff --git a/g13gui/g13gui/model/prefs_tests.py b/g13gui/model/prefs_tests.py similarity index 100% rename from g13gui/g13gui/model/prefs_tests.py rename to g13gui/model/prefs_tests.py diff --git a/g13gui/g13gui/model/prefsstore.py b/g13gui/model/prefsstore.py similarity index 100% rename from g13gui/g13gui/model/prefsstore.py rename to g13gui/model/prefsstore.py diff --git a/g13gui/g13gui/observer/__init__.py b/g13gui/observer/__init__.py similarity index 100% rename from g13gui/g13gui/observer/__init__.py rename to g13gui/observer/__init__.py diff --git a/g13gui/g13gui/observer/gtkobserver.py b/g13gui/observer/gtkobserver.py similarity index 100% rename from g13gui/g13gui/observer/gtkobserver.py rename to g13gui/observer/gtkobserver.py diff --git a/g13gui/g13gui/observer/observer.py b/g13gui/observer/observer.py similarity index 100% rename from g13gui/g13gui/observer/observer.py rename to g13gui/observer/observer.py diff --git a/g13gui/g13gui/observer/observer_tests.py b/g13gui/observer/observer_tests.py similarity index 100% rename from g13gui/g13gui/observer/observer_tests.py rename to g13gui/observer/observer_tests.py diff --git a/g13gui/g13gui/observer/subject.py b/g13gui/observer/subject.py similarity index 100% rename from g13gui/g13gui/observer/subject.py rename to g13gui/observer/subject.py diff --git a/g13gui/g13gui/tests.py b/g13gui/tests.py similarity index 100% rename from g13gui/g13gui/tests.py rename to g13gui/tests.py diff --git a/g13gui/g13gui/ui/__init__.py b/g13gui/ui/__init__.py similarity index 100% rename from g13gui/g13gui/ui/__init__.py rename to g13gui/ui/__init__.py diff --git a/g13gui/g13gui/ui/appindicator.py b/g13gui/ui/appindicator.py similarity index 100% rename from g13gui/g13gui/ui/appindicator.py rename to g13gui/ui/appindicator.py diff --git a/g13gui/g13gui/ui/g13button.py b/g13gui/ui/g13button.py similarity index 100% rename from g13gui/g13gui/ui/g13button.py rename to g13gui/ui/g13button.py diff --git a/g13gui/g13gui/ui/g13buttonpopover.py b/g13gui/ui/g13buttonpopover.py similarity index 100% rename from g13gui/g13gui/ui/g13buttonpopover.py rename to g13gui/ui/g13buttonpopover.py diff --git a/g13gui/g13gui/ui/mainwindow.py b/g13gui/ui/mainwindow.py similarity index 100% rename from g13gui/g13gui/ui/mainwindow.py rename to g13gui/ui/mainwindow.py diff --git a/g13gui/g13gui/ui/profilecombobox.py b/g13gui/ui/profilecombobox.py similarity index 100% rename from g13gui/g13gui/ui/profilecombobox.py rename to g13gui/ui/profilecombobox.py diff --git a/g13gui/g13gui/ui/profilepopover.py b/g13gui/ui/profilepopover.py similarity index 100% rename from g13gui/g13gui/ui/profilepopover.py rename to g13gui/ui/profilepopover.py diff --git a/g13gui/setup.py b/setup.py similarity index 100% rename from g13gui/setup.py rename to setup.py