mirror of
https://github.com/amiwm/amiwm.git
synced 2026-04-14 11:04:18 +00:00
[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:
9
module.h
9
module.h
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user