Commit Graph

308 Commits

Author SHA1 Message Date
June Tate-Gans
3685a73622 setup: Clean up dependencies 2021-05-23 12:18:47 -05:00
June Tate-Gans
a62a8f3a38 pipenv: Setup for pipenv development
This makes handling our dependencies a bit easier.
2021-05-23 12:07:51 -05:00
June Tate-Gans
9958ea234d pipenv: Pre-migration to pipenv things
- Use an alternative xdg module that provides functions to generate XDG-paths.
  - Fix startup routines for the main configurator.
2021-05-23 12:04:43 -05:00
June Tate-Gans
5481bbff22 setup: Clean up the classifiers, requirements, and data files
We have a bunch more info that is nearly correct, though I haven't validated
this yet. Currently exploring using pipenv instead, since that helps manage
these more effectively.
2021-05-23 11:32:25 -05:00
June Tate-Gans
802b342a1c clock: Display CPU percentage correctly
psutil.cpu_percent() actually delivers a percentage from 0 to 100. We need to
normalize that value to 0..1 to display properly.
2021-05-23 11:31:12 -05:00
June Tate-Gans
9fb8dbab4d switcher: Remove switcher from the list of applets
There's really no point to switching to the switcher when the BD key always
brings it up. It was also causing problems since we introduced switching back to
the previous applet by pressing BD while the switcher is up.
2021-05-23 11:30:18 -05:00
June Tate-Gans
c336d9c4cf applet: Rework how manager pings work
This swaps to notifying the applet internally when registration is lost after a
ping fails.
2021-05-23 11:29:14 -05:00
June Tate-Gans
298cefe9c2 applets: Rework how keys are delivered
This makes us use strings instead of numbers. This allows us to export more of
the G13's key matrix to applets, so we can include things like MR, BD, and the
rest of the keyboard matrix.

Most of this work is done in prep for the real-time macro recording
functionality that I'm attempting to hack in.
2021-05-23 11:27:20 -05:00
June Tate-Gans
f485f2cbf0 etc: Add a bunch of desktop files and an icon 2021-05-23 11:22:47 -05:00
June Tate-Gans
e1b7befb82 bitwidgets: Add a "Dialog" box to the toolkit
This allows for simple messages to be displayed on top of the screen.
2021-05-09 23:12:55 -05:00
June Tate-Gans
9d7d4fafa2 ui: Make MainWindow actually save prefs to disk on change 2021-05-09 23:12:28 -05:00
June Tate-Gans
c924aba55c bitwidgets: Make rectangles actually have variable width outlines 2021-05-09 23:11:38 -05:00
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