pgaskin / NickelMenu

The easiest way to launch scripts, change settings, and run actions on Kobo e-readers.
https://pgaskin.net/NickelMenu
MIT License
591 stars 32 forks source link

Implement generator updates #55

Closed pgaskin closed 4 years ago

pgaskin commented 4 years ago

closes #54

pgaskin commented 4 years ago

I've tested this (both on boot and as an update) with:

generator:main:_test:2
generator:main:_test:0
generator:main:_test_time
generator:main:_test:1

@NiLuJe, can you test the kfmon part of this?

NiLuJe commented 4 years ago

I only had time for a few quick tests right now, but everything seems to be behaving just right, thanks! :).

Jun 23 11:11:41 nickel: (NickelMenu) inject 1 @ 20 (src/menu.cc:139)
Jun 23 11:11:41 nickel: (NickelMenu) checking for config updates (src/menu.cc:141)
Jun 23 11:11:41 nickel: (NickelMenu) global: scanning for config files (src/init.c:166)
Jun 23 11:11:41 nickel: (NickelMenu) config: skipping /mnt/onboard/.adds/nm/. because it's a special file (src/config.c:45)
Jun 23 11:11:41 nickel: (NickelMenu) config: skipping /mnt/onboard/.adds/nm/.. because it's a special file (src/config.c:45)
Jun 23 11:11:41 nickel: (NickelMenu) global: no changes detected (src/init.c:174)
Jun 23 11:11:41 nickel: (NickelMenu) global: running generators (src/init.c:191)
Jun 23 11:11:41 nickel: (NickelMenu) config: running generators (src/config.c:585)
Jun 23 11:11:41 nickel: (NickelMenu) config: running generator kfmon: (src/config.c:588)
Jun 23 11:11:41 nickel: (NickelMenu) generator: running generator (kfmon) () (1) (0x326c0209) (src/generator.c:14)
Jun 23 11:11:41 nickel: (NickelMenu) Got a 70 bytes reply from KFMon (with an EoT marker) (src/kfmon.c:146)
Jun 23 11:11:41 nickel: (NickelMenu) Parsing reply line: `3:koreader.png:KOReader` (src/kfmon.c:164)
Jun 23 11:11:41 nickel: (NickelMenu) Parsing reply line: `4:plato.png:Plato` (src/kfmon.c:164)
Jun 23 11:11:41 nickel: (NickelMenu) Parsing reply line: `5:usbnet.png:Toggle USBNet` (src/kfmon.c:164)
Jun 23 11:11:41 nickel: (NickelMenu) config: ... 3 items generated, removing previously generated items and replacing with new ones (src/config.c:602)
Jun 23 11:11:41 nickel: (NickelMenu) config: generated items (src/config.c:627)
Jun 23 11:11:41 nickel: (NickelMenu) cfg(NM_CONFIG_TYPE_MENU_ITEM) : 1:KOReader (src/config.c:632)
Jun 23 11:11:41 nickel: (NickelMenu) ...cfg(NM_CONFIG_TYPE_MENU_ITEM) (on_success, on_failure) : 0x326bc939:koreader.png (src/config.c:634)
Jun 23 11:11:41 nickel: (NickelMenu) cfg(NM_CONFIG_TYPE_MENU_ITEM) : 1:Plato (src/config.c:632)
Jun 23 11:11:41 nickel: (NickelMenu) ...cfg(NM_CONFIG_TYPE_MENU_ITEM) (on_success, on_failure) : 0x326bc939:plato.png (src/config.c:634)
Jun 23 11:11:41 nickel: (NickelMenu) cfg(NM_CONFIG_TYPE_MENU_ITEM) : 1:Toggle USBNet (src/config.c:632)
Jun 23 11:11:41 nickel: (NickelMenu) ...cfg(NM_CONFIG_TYPE_MENU_ITEM) (on_success, on_failure) : 0x326bc939:usbnet.png (src/config.c:634)
Jun 23 11:11:41 nickel: (NickelMenu) global: generators updated (src/init.c:193)
Jun 23 11:11:41 nickel: (NickelMenu) global: generators updated, freeing old items and replacing with new ones (src/init.c:196)
Jun 23 11:11:41 nickel: (NickelMenu) done replacing items (src/init.c:210)
Jun 23 11:11:41 nickel: (NickelMenu) updated = 1 (src/menu.cc:143)
Jun 23 11:11:41 nickel: (NickelMenu) checking for existing items added by nm (src/menu.cc:145)
Jun 23 11:11:41 nickel: (NickelMenu) getting insertion point (src/menu.cc:156)
Jun 23 11:11:41 nickel: (NickelMenu) injecting new items (src/menu.cc:166)
Jun 23 11:11:41 nickel: (NickelMenu) adding items 'KOReader'... (src/menu.cc:186)
Jun 23 11:11:41 nickel: (NickelMenu) adding items 'Plato'... (src/menu.cc:186)
Jun 23 11:11:41 nickel: (NickelMenu) adding items 'Toggle USBNet'... (src/menu.cc:186)
Jun 23 11:11:41 nickel: (NickelMenu) adding items 'USB'... (src/menu.cc:186)
Jun 23 11:11:41 nickel: (NickelMenu) adding items 'Force WiFi'... (src/menu.cc:186)
Jun 23 11:11:41 nickel: (NickelMenu) adding items 'WiFi'... (src/menu.cc:186)
Jun 23 11:11:41 nickel: (NickelMenu) adding items 'Reboot'... (src/menu.cc:186)
Jun 23 11:11:51 nickel: (NickelMenu) inject 1 @ 20 (src/menu.cc:139)
Jun 23 11:11:51 nickel: (NickelMenu) checking for config updates (src/menu.cc:141)
Jun 23 11:11:51 nickel: (NickelMenu) global: scanning for config files (src/init.c:166)
Jun 23 11:11:51 nickel: (NickelMenu) config: skipping /mnt/onboard/.adds/nm/. because it's a special file (src/config.c:45)
Jun 23 11:11:51 nickel: (NickelMenu) config: skipping /mnt/onboard/.adds/nm/.. because it's a special file (src/config.c:45)
Jun 23 11:11:51 nickel: (NickelMenu) global: no changes detected (src/init.c:174)
Jun 23 11:11:51 nickel: (NickelMenu) global: running generators (src/init.c:191)
Jun 23 11:11:51 nickel: (NickelMenu) config: running generators (src/config.c:585)
Jun 23 11:11:51 nickel: (NickelMenu) config: running generator kfmon: (src/config.c:588)
Jun 23 11:11:51 nickel: (NickelMenu) generator: running generator (kfmon) () (1) (0x326c0209) (src/generator.c:14)
Jun 23 11:11:51 nickel: (NickelMenu) config: ... no new items generated (src/config.c:596)
Jun 23 11:11:51 nickel: (NickelMenu) config: generated items (src/config.c:627)
Jun 23 11:11:51 nickel: (NickelMenu) cfg(NM_CONFIG_TYPE_MENU_ITEM) : 1:KOReader (src/config.c:632)
Jun 23 11:11:51 nickel: (NickelMenu) ...cfg(NM_CONFIG_TYPE_MENU_ITEM) (on_success, on_failure) : 0x326bc939:koreader.png (src/config.c:634)
Jun 23 11:11:51 nickel: (NickelMenu) cfg(NM_CONFIG_TYPE_MENU_ITEM) : 1:Plato (src/config.c:632)
Jun 23 11:11:51 nickel: (NickelMenu) ...cfg(NM_CONFIG_TYPE_MENU_ITEM) (on_success, on_failure) : 0x326bc939:plato.png (src/config.c:634)
Jun 23 11:11:51 nickel: (NickelMenu) cfg(NM_CONFIG_TYPE_MENU_ITEM) : 1:Toggle USBNet (src/config.c:632)
Jun 23 11:11:51 nickel: (NickelMenu) ...cfg(NM_CONFIG_TYPE_MENU_ITEM) (on_success, on_failure) : 0x326bc939:usbnet.png (src/config.c:634)
Jun 23 11:11:51 nickel: (NickelMenu) global: no generators updated (src/init.c:193)
Jun 23 11:11:51 nickel: (NickelMenu) updated = 0 (src/menu.cc:143)
Jun 23 11:11:51 nickel: (NickelMenu) checking for existing items added by nm (src/menu.cc:145)
Jun 23 11:11:55 nickel: (NickelMenu) item 'USB' pressed... (src/menu.cc:192)
Jun 23 11:11:55 nickel: (NickelMenu) action 0x326be22d with argument force_usb_connection :  (src/menu.cc:205)
Jun 23 11:11:55 nickel: (NickelMenu) ...success=1 ; on_success=1 on_failure=1 skip=0 (src/menu.cc:206)
Jun 23 11:11:55 nickel: (NickelMenu) ...result: type=0 msg='(null)', handling... (src/menu.cc:231)
Jun 23 11:11:55 nickel: (NickelMenu) done (src/menu.cc:194)
NiLuJe commented 4 years ago

For people playing with this at home, KFMon currently only reload configs during an USBMS session, FWIW.