Commit Graph

346 Commits

Author SHA1 Message Date
June Tate-Gans
b2cc80e404 bitwidgets: Make ListView resilient to empty models 2021-05-09 23:11:15 -05:00
June Tate-Gans
fa7a84ca3f bitwidgets: Make rectangle render unfilled outlines
Something I've wanted for a while has been the ability to draw a rectangle
anywhere on the screen without it being filled in. Hopefully this does the
trick.
2021-05-09 14:57:41 -05:00
June Tate-Gans
e51c7ca0fc
Merge pull request #22 from jtgans/clock-enhancements
clock: Add 24-hour toggle, load, ram graphs
2021-05-09 12:10:11 -07:00
June Tate-Gans
1212ce91de clock: Add 24-hour toggle, load, ram graphs
This adds a ton of new functionality to the clock widget, and exercises the
bitwidgets widgets a bit more. This adds a new button widget, called a
LabelWidget. These are pretty unsurprising -- they're just a label inside of a
button slot in the buttonbar. They do give us the ability to toggle and add
"more" glyphs in the button for more flexibility in the buttonbar.

  - Make Clock toggle between 12 and 24 hour clock modes.
  - Add CPU load and RAM load histograms.
  - Create a new button type, LabelButton.
  - Create a new widget, the Graph, which shows a histogram of values over
    time.
  - Make Button not assign values by way of accessors in the constructor.
  - Make Label actually dynamically change its bounds based upon properties.
2021-05-09 14:05:18 -05:00
June Tate-Gans
d8fa49c1ed
Merge pull request #21 from jtgans/dbus-fixes
applet: Make the AppletManager more resilient in the face of errors
2021-05-09 10:33:11 -07:00
June Tate-Gans
c934abb28b applet: Make the AppletManager more resilient in the face of errors
This wraps most of the proxy calls with some exception handling code which
removes an applet from the list of applets. This is kinda remedial, but should
make developing applets a bit smoother, as we end up restarting them
periodically. IOW, this prevents the configurator from completely crashing out.

  - Give switcher the ability to handle applet removals
  - Wrap most proxy methods in try...except blocks
  - Add a removeActiveApplet method to kill off the currently stuck applet in
    the face of an error.
2021-05-09 12:26:51 -05:00
June Tate-Gans
9bb98176c5
Merge pull request #19 from jtgans/profile-switcher
applet: Add a profile switching applet
2021-05-09 09:57:17 -07:00
June Tate-Gans
4ca08c5f05 applet: Add a profile switching applet
This exposes the profile list, currently selected profile, and the ability to
set the selected profile via the AppletManager's D-Bus interface. This isn't
really the ideal place for it, but Gtk Actions aren't really suited for this,
either. Additionally, it creates the profile switcher applet as an external
applet to better exercise the Applet interface.

  - Manager passes in the preferences object to the AppletManager, so that these
    variables can be exposed over D-Bus.
  - Exposed the list of profiles, get/set of active profile via D-Bus.
  - Created the Profiles applet.
  - Exposed a onRegistered / onUnregistered hook for Applets to make use of.
  - Removed the onUpdateScreen hook from KeyPressed/KeyReleased, since the
    onKeyPressed/onKeyReleased hooks handle this nicely already.
  - Fixed the AppletManager's method authorization checks.
2021-05-09 11:50:09 -05:00
June Tate-Gans
4eb039bc27 glyphs: Add box and filled box
We can use these in buttons as a fast indicator if a particular setting is
enabled/disabled.
2021-05-09 10:30:12 -05:00
June Tate-Gans
bfdf8e1190 docs: Add some information about the applet model 2021-05-09 09:02:31 -05:00
June Tate-Gans
60cfef5e79 project: Add in a DOAP file so we can be semantic 2021-05-09 08:27:59 -05:00
June Tate-Gans
bdde3dd52a applet: Reorganize methods a bit 2021-05-09 08:25:32 -05:00
June Tate-Gans
82a6094b0a bitwidgets: Add two more glyphs 2021-05-09 08:25:32 -05:00
June Tate-Gans
73649c7244 bitwidgets: Fix X11DisplayDevice dimensions to match LCD 2021-05-09 08:25:32 -05:00
June Tate-Gans
11c85149c4
docs: Add in our toplevel documentation 2021-05-09 08:20:44 -05:00
June Tate-Gans
a17e4799be Set theme jekyll-theme-hacker 2021-05-09 08:19:20 -05:00
June Tate-Gans
faf052b015 bitwidgets: Split classes out of button
There's a bunch of unrelated stuff in button, like Glyphs and ButtonBar, which
should be in their own modules.
2021-05-08 23:01:37 -05:00
June Tate-Gans
96f9fa122d applet: Fix a minor style issue 2021-05-08 23:00:34 -05:00
June Tate-Gans
9c0a27e724 Remove the old LICENSE file. 2021-05-08 22:58:52 -05:00
June Tate-Gans
8eb613dad2 Remove a ton of unused stuff
Since the migration to the G13 Configurator for everything, most of these files
have literally no use anymore. We can safely remove them from the project at
this point.
2021-05-08 19:49:27 -05:00
June Tate-Gans
ff25e01694 Migrate g13gui out of the g13gui subdir
The whole project at this point is entirely python, with no g13d present
anywhere, so let's clean up the tree somewhat and make it flatter.
2021-05-08 19:47:35 -05:00
June Tate-Gans
6380b02b32 ui: Make ProfileCombobox use changeTriggers 2021-05-08 19:28:34 -05:00
June Tate-Gans
c98bc506e2 g13: Change Manager's name to DeviceManager 2021-05-08 19:28:07 -05:00
June Tate-Gans
8390c065fe displaydevice: Ensure we start the DBus loop for DeviceManager 2021-05-08 19:27:46 -05:00
June Tate-Gans
83f124bc9c displaydevice: Split update from _pushFrame
This allows loopbackdisplaydevice to function.
2021-05-08 19:27:26 -05:00
June Tate-Gans
18e536d7f7 applets: Add in the framework for Applets!
This allows us to have separate applications from the G13 Configurator render to
the G13's display, just like the way Logitech's design worked. It even includes
an applet switcher, and an example clock applet.

There's quite a few deficiencies in this model, not the least of which is the
fact that we're using dbus-python as the main communications channel. Things
that are broken include:

  - We can't tell when an applet dies except when we fail a call.
  - Applets have to be running at the same time G13 Configurator is to handle
    the initial register call.

We can likely deal with these somehow using DBus signals.
2021-05-08 19:25:05 -05:00
June Tate-Gans
81be3f2cf9 main: Migrate to the Application model
We weren't registering with dbus or the session manager before, so migrating to
Application as our base really really helps with duplicate launches.
2021-05-08 19:23:14 -05:00
June Tate-Gans
841ad65b89 observer: Subject incorrectly notified based on variable names 2021-05-08 19:22:08 -05:00
June Tate-Gans
7945f9d246 g13: Applet buttons aren't "special" keys 2021-05-08 19:20:17 -05:00
June Tate-Gans
519945edbf bitwidgets: Changed the DISPLAY_HEIGHT to the correct value
This took some experimentation to verify it was actually correct.
2021-05-08 19:19:48 -05:00
June Tate-Gans
60d58e8392 bitwidgets: New widgets!
This adds a whole new ListView widget (and associated ListItem widget) so that
we can handle selecting items from a list. Additionally, it brings in rectangle
tests, and sadly removes the nice rounded rectangle from its design.

  - The button module gained a Glyph widget, and Buttons are now composites
    containing both a Rectangle and a Glyph.
  - ButtonBar has been fixed to match the above Button change, which produces a
    much more correct layout of glyphs and their drawing inside of each
    ButtonBar slot.
  - Added a Button test for Glyphs.
  - Made X11DisplayDevice update its output window name when it's assigned to,
    making it possible for each test to indicate which test it belongs to.
  - Created ListView and ListItem.
  - Made Widget not use its accessors for its constructor, which would create a
    ton of erronous observer events down the chain.
  - Made some of Widget's setters ValueErrors more specific.
2021-05-08 19:15:15 -05:00
June Tate-Gans
5cc4e81dd5 saving: Re-add preferences saving to disk
At this point, functionality is nearly the same as what we had before I started
the migration away from g13d. We can now save prefs to disk! The next trick is
to make sure that the backlighting works, and I think we can call that the next
version, and maybe tag it for a alpha release.
2021-05-04 02:20:34 -05:00
June Tate-Gans
83483aa7a3 appindicator: Make the appindicator the root of the app
This reorganizes the ownership of the main window under the control of the
appindicator. It also adds some additional flags in prefs to allow for disabling
the opening of the main window on startup, and removes a bunch of cruft from
main.
2021-05-04 02:06:19 -05:00
June Tate-Gans
69151a450b manager: Setup as an observer
It would make sense that when the profile changes that the manager should
automatically reconfigure for the new profile. This changes the Manager into an
Observer and registers for profile and LCD color changes.
2021-05-04 01:43:32 -05:00
June Tate-Gans
f5e881f0fa bindingprofile: lcdColor is a property, fix it 2021-05-04 01:43:00 -05:00
June Tate-Gans
17350fa524 bindingprofile: Remove a bunch of (now) worthless methods
We no longer need to serialize to g13d command strings.
2021-05-04 01:42:38 -05:00
June Tate-Gans
ccca4b5016 ui: Add changeTriggers to complete the migration to them 2021-05-04 01:41:56 -05:00
June Tate-Gans
aecf1d0644 popover: Fix a bunch of things to be accessors now. 2021-05-04 01:41:14 -05:00
June Tate-Gans
a28a90f37b mainwindow: Fix the names of the analog stick buttons 2021-05-03 18:16:34 -05:00
June Tate-Gans
244368ede3 g13buttonpopover: Read from evdev to capture keys
Since GDK/GTK filter events through Xorg, libinput, and everything else in
between, we can't use their keypress detection code to actually figure out what
the linux key codes are, instead we read directly from all keyboard-like evdev
devices on the system.

This is less than ideal, but directly due to Linux/Xorg/libinput/XKB/GDK/GTK/GNOME's
completely batshit insane input model. On Wayland it gets better, but not by
much since most compositors still use XKB and libinput.

*sigh*
2021-05-03 18:14:32 -05:00
June Tate-Gans
240be20b63 g13button: Swap out the old notification mechanism for triggers
This is a bit cleaner, overall, but also this makes key binding in the UI
actually work again.
2021-05-03 18:12:51 -05:00
June Tate-Gans
003ab3b526 observer: Coerce scalar values in keys to sets
Unfortunately, strings are iterable in python, so without this a call with a
single string, or a construct of "('foo')" would result in creating keys for
each letter of the string 'foo'. "('foo',)" works, because , creates the tuple,
not the parens...
2021-05-03 18:11:28 -05:00
June Tate-Gans
4d11270a7c main: Since we use lots of crazy threads, ensure GDK is ready 2021-05-03 18:10:56 -05:00
June Tate-Gans
ce8a106ea3 input: Restructure to use GObject and io_watches
This isn't ideal, since opening all of the devices in /dev/input is slow, and
this runs on the UI thread, but it works for now. Ultimately, InputReader should
probably be restructured as a threading.Thread and use GLib.idle_add to send the
signals out.
2021-05-03 18:09:08 -05:00
June Tate-Gans
65c2580e45 manager: Use the key name, rather than its number
This allows us to be a bit more flexible in the way we define bindings. We still
have to use the scancodes for the actual bindings (since we're outputting to
uinput), but this should be a little easier to digest.

...also it fixed a bug... =op
2021-05-03 18:08:11 -05:00
June Tate-Gans
6ddee4ae88 g13gui: Actually finish the migration
Add an evdev listener for input so we can use linux "keysyms" for keyboard
events, since uinput uses it.
2021-05-02 23:48:52 -05:00
June Tate-Gans
0a0ecfc9bc observer: Finish migrating Subject 2021-05-02 23:48:20 -05:00
June Tate-Gans
9a9f504995 g13gui: bindings: Setup preliminaries for keycode decoding 2021-05-02 23:47:54 -05:00
June Tate-Gans
8a6fc4b0f0 g13gui: manager: Ensure both the header and buffer are bytes 2021-05-02 23:47:25 -05:00
June Tate-Gans
054d31033f g13gui: Rework the observer model
Subject was large enough to be in its own file.
2021-05-02 23:46:55 -05:00