[amiwm] MVP for initial battery stuff

Totally not ready for prod, but at least I'm making progress
figuring out how to add extra bits to this thing.

* add a second widget to the menu bar, next to the title bar
* add a new module command to update the battery information
* add a freebsd specific Battery module, not linked into the
  build right now.
* amiwm will print out whenever we get battery information from the
  module.

Right now I'm trying to figure out how to get some kind of periodic
background event into the module main loop.  Launcher does it
using cx_broker(), but I dunno if I can adapt that pattern here.
This commit is contained in:
Adrian Chadd
2022-04-25 21:28:49 -07:00
parent e42512c034
commit 18e858ae80
8 changed files with 235 additions and 6 deletions

View File

@@ -16,6 +16,7 @@
#define MCMD_MANAGEMENU 18
#define MCMD_ROTATE_WINDOW_RAISE 19
#define MCMD_ROTATE_WINDOW_LOWER 20
#define MCMD_UPDATE_BATTERY 21
struct mcmd_header {
XID id;
@@ -42,6 +43,14 @@ struct NewAppIcon {
char name[1];
};
struct mcmd_update_battery {
int battery_time;
int battery_pct;
int battery_cap;
int battery_ac;
int battery_charging;
};
extern struct module {
struct module *next;
int in_fd, out_fd;