Implemented kfmon action
Supports launching a kfmon action by its ID or filename. Requires a kfmon version greater than, but not including, v1.3.3. Also includes a hidden POC for getting a complete item list for use later after generators are implemented by @geek1011. Squashed from niluje/kfmon-list-poc, which succeeds niluje/kfmon and niluje/kfmon-v1. commit e6c227b0812f7a8c774de3c48c5121545b6ff39a Author: Patrick Gaskin <patrick@pgaskin.net> Date: Fri May 1 14:52:45 2020 -0400 Cleanup commit f79326d5730da43eaff87572c8c76615b1c61153 Author: Patrick Gaskin <patrick@pgaskin.net> Date: Fri May 1 14:38:08 2020 -0400 Improved kfmon error message commit 8ece03ee867642862a3ed2f948c583125d60d346 Author: NiLuJe <ninuje@gmail.com> Date: Fri May 1 20:14:02 2020 +0200 Eh, we can have our cake, and eat it, too ;). commit e8b25888faaaab891c1129a28ca65959ffe903df Author: NiLuJe <ninuje@gmail.com> Date: Fri May 1 20:09:04 2020 +0200 Drop the "index" mention on INVALID_ID We can use it both with start (id) and trigger (file) on our end. The reply from KFMon is always INVALID_ID, because ultimately a filename lookup points to an index, but internal log messages will make the distinction properly. TL;DR: Keep it vague here, when in doubt, check KFMon's log. commit 351b3d6f3fd906c6a8e848386658408ea8963a79 Author: Patrick Gaskin <patrick@pgaskin.net> Date: Fri May 1 14:00:56 2020 -0400 Added kfmon example to docs commit 3e60e67189fc6068f260ec0afadf9e7f25ae8fa0 Author: NiLuJe <ninuje@gmail.com> Date: Thu Apr 30 22:25:31 2020 +0200 Slightly less unwieldy with a control structure for the list Double pointers get hidden away by a pointer chain via a struct, and it makes helper functions to handle list upkeep easier and clearer. commit 3f21b3050417a076f28218bdaa63a8da8901383a Author: NiLuJe <ninuje@gmail.com> Date: Thu Apr 30 19:01:41 2020 +0200 Minor comment tweaks commit 57d2f58ae49f66c0e99f294e4d8267984ca41d83 Author: NiLuJe <ninuje@gmail.com> Date: Thu Apr 30 18:50:34 2020 +0200 Fix tail pointer updating. This should *actually* do the right thing, and make multi-reads actually behave. Now I just need to trigger one of those to double-check... commit 3b44397fadf7457d6a7a0480939f78bae88f9472 Author: NiLuJe <ninuje@gmail.com> Date: Thu Apr 30 18:35:07 2020 +0200 Investigate multi-reads shenanigans... commit 6dcdd737b19e090979461abe830805cc3e11b5a6 Author: NiLuJe <ninuje@gmail.com> Date: Thu Apr 30 18:29:25 2020 +0200 Simplify list teardown commit a87e8de4c4ea22100ecde8179e8b18d5b0d53a2b Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 19:54:55 2020 +0200 Slightly better comments commit 259087c9f1d303dfd3c9b7ec13eed954c44d10a1 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 19:40:35 2020 +0200 More accurate comment commit c803b1c521408d6d57be1b81cbc79c9bb90febc0 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 19:36:34 2020 +0200 Only allocate as much items as needed (i.e., alloc before storage, not after). That only leaves head to detect properly, because we have to allocate it outside, we can't lose track of it. commit 3e2815bb7a60631767f5c7090cc4d70e4680e3fa Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 19:19:12 2020 +0200 That works much better when I update the right pointer, and not a local copy. commit f85c4c815ea422282187085d4ca08d6b5c0b84f5 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 19:13:14 2020 +0200 Double pointer shenanigans, take one. commit c9932ea79b47d7197f4e48fbc7e4984567859a13 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 03:19:56 2020 +0200 Nnyeah, I'll take this stupid check over risking hitting a NUL put there by strsep when it replaces delimiter bytes... commit 5e41e9e09e37943ee013669f0bbc5c72644a4af1 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 03:04:36 2020 +0200 Botched a newline in the rebase commit ff0c57d805dd2b309f96889458696a0827fb093f Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 02:44:59 2020 +0200 Forgot to handle the final line ^^. It's a 1 byte string made of a single NUL right behind a LF. commit 7c1b62ce1a3eb364d1ff736867d63e068bbf5c9c Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 02:41:20 2020 +0200 sigh commit 9e6d0a18cc79a96720fa3abb78c6b3be3a173902 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 02:21:22 2020 +0200 Duh. That works much better if I don't request pointer-sized reads, but the actual buffer size in bytes, instead. Forgot that when switching to the heap... commit a0e97a19d4a6315583349d03846cec65fc4b86c6 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 02:14:24 2020 +0200 Plug in the unused arg to appease GCC commit 504ca9487fd2f122bad43bd0e2193adc61ee9952 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 02:11:38 2020 +0200 Plug that in a debug action commit d9bbdbaea5f9de3f5fd260efd319053913f5e649 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 02:06:52 2020 +0200 Handle argless IPC commands commit 24021d3f8fb3d77fabd7b595ee4dd945b64f7311 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 02:04:03 2020 +0200 There, DRYer As a bonus, we now handle the extremely unlikely case of a short read on !list commands commit 919467288b4dcbd4564e5da6e8ef6fcd9c7cc132 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 01:57:02 2020 +0200 Simplify, and prepare merging the polling loops commit fa140483c455a286555f7e8afa7f49b6fd8ab801 Author: NiLuJe <ninuje@gmail.com> Date: Wed Apr 29 01:49:57 2020 +0200 Start working on list handling WIP commit, before some refactoring commit 77ecb487fab1301e7dad4a50b4c4a383bfe6a5f9 Author: NiLuJe <ninuje@gmail.com> Date: Tue Apr 28 23:31:55 2020 +0200 Revert "Spike the environment when spawning a command" This reverts commit ea7c617cb8c89fb00b0cb7b95af162038ecb3def. Doesn't actually work (at least w/ startDetached). Not going through /bin/sh -c reparents to init, which is only marginally better, as far as PPID goes. TL;DR: For now, do nothing. commit cec0d58dbe0d2d3e494e085376fc2856e7dfb7b0 Author: NiLuJe <ninuje@gmail.com> Date: Tue Apr 28 22:54:55 2020 +0200 Spike the environment when spawning a command My usual approach is to check $PPID, but /bin/sh -c prevents that here... This is necessary for KOReader, in order to properly handle the 7 billion different ways it can be launched... commit 634f54dbddc0407338c8cacad386a09bc8296c25 Author: NiLuJe <ninuje@gmail.com> Date: Tue Apr 28 22:26:09 2020 +0200 Made connect() EINTR-proof POSIX is fun. commit 0f8fd2dafe2619cc74864240c4a30a2d5dbf89d9 Author: Patrick Gaskin <patrick@pgaskin.net> Date: Tue Apr 28 16:19:15 2020 -0400 Made kfmon headers more consistent with the rest commit 3a997ce6f4299a465eee1299a58e581304cb9a07 Author: NiLuJe <ninuje@gmail.com> Date: Tue Apr 28 00:00:42 2020 +0200 Minor comment tweaks commit 9dccee1f2dc994ecc71dd9f40708437998f600f4 Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 22:59:33 2020 +0200 Resync minor cosmetic tweaks w/ KFMon commit aa0c05b2c38e0061ad3ce1bfbe8ca9c59988413e Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 20:38:27 2020 +0200 Make it build again commit b2f276461fca11a37967bc710526ce065856603c Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 20:31:49 2020 +0200 Resync socket I/O helpers with KFMon Switch to send w/ MSG_NOSIGNAL to handle EPIPE sanely. commit 2270673556a321559a475d7e492c3ea876c4deaf Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 02:45:55 2020 +0200 Forgot to make this static commit 1353558d153129201543713ab72a7e4d4bbf815f Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 02:40:49 2020 +0200 Reword the kfmon section a bit commit 13acd58691bca0d0319674f25f06eb9c365a4ac2 Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 02:30:41 2020 +0200 Double-check that there's someone on the other end of the socket before writing to it. Nickel getting a SIGPIPE would be... not good. :D. commit f3ebf81ca22b587bedab81fb77ea905b25a119c6 Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 02:14:22 2020 +0200 Resync helpers w/ KFMon commit f1222e99eff7765f52aa9fb4be851622cedde008 Author: NiLuJe <ninuje@gmail.com> Date: Mon Apr 27 01:29:39 2020 +0200 Tighter scope commit 0efa76d9c77f7b44a6da53a276b3e21316c0a49c Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 22:22:11 2020 +0200 Stupid bug is stupid... Actually timeout for real, instead of resetting the retry counter like an idiot. commit fb52fa9b7d92a6a85a1134b4ae56cfca7f7448f0 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 17:47:51 2020 +0200 Use restricted pointers We know there aren't any aliasing issues commit 9df1eabe79636e0b2d0f922adb86569ddfda3810 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 06:14:17 2020 +0200 Better variable name, bis. commit 40f0b3e32f8fa14e99aa7415cb682c505106115a Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 06:12:53 2020 +0200 Better variable name commit e5ae5ee8568b3a8b345bc3ab2a9a2261bd49ca83 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 06:09:29 2020 +0200 Expand on that comment Nothing will horribly blow up, KFMon already truncates on its end if need be. commit 50e774676ef788ee6338620890d6d66dff47d221 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 06:08:39 2020 +0200 Tighter scope, smaller buffer KFMon's own config buffer for the *full* path is only 128 bytes. commit 9409b2c49ae7acdb9f329e662438c88ce5e69fce Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 04:43:20 2020 +0200 Comment typo commit 0a8d16eafd83593c223bd668f48b3a9f52f2b937 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 04:42:03 2020 +0200 Detail a bit more why we poll for a reply Spoiler: Because networking is networking, even over a local socket ;p. commit 139195dee1f5e7760ab7a82f7d8bf8750971a746 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 04:38:29 2020 +0200 Fix a sign-compare warning commit 8ded488840c11c83a696e0f6711e5e82e6ab1959 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 04:37:45 2020 +0200 Moved the polling in its own chunk, too. commit e8264e2cebcb26b1b57c3bd4a027b043c808d2ab Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 04:27:04 2020 +0200 Start breaking down nm_kfmon_simple_request in small reusable pieces commit 592fb6997aa48c579460de9ee66e99039f09db1f Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 04:16:34 2020 +0200 Minor simplification commit 00f52c9a5c3f8945230a187d10e3dc42bc1079b3 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 04:13:08 2020 +0200 Minor refactor of error handling in kfmon actions Should allow to break it down in smaller pieces to ease list handling later... commit e2af99fa6d62a485d5568d7faf9e5a627b6ed484 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 02:43:12 2020 +0200 Gah. commit 0302989693be02af737ef32921fbb4b45127fe40 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 02:42:33 2020 +0200 Update comments commit 4b4628b3bbab2edfe9ed80ef15aeffa67beba713 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 02:39:20 2020 +0200 Switch the kfmon action to filename lookups, as they're stable ID lookups are still available via a kfmon_id action, which is left undocument to avoid confusion. commit 464b376ffb53d20291ffefbb93a90cbeaa94420d Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 00:46:11 2020 +0200 With a decent optimization level while we're there ;). commit 1e55f6ea737bd491025ae9239787d7fd8211da9d Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 00:38:23 2020 +0200 It's actually for ppoll(), which I don't use. Still, we're on Linux, _GNU_SOURCE makes sense, I may be relying on GNUisms because I usually always have _GNU_SOURCE set. commit c3b1f491b5dc3d6b7854b160ab7de3f24cc03bc1 Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 00:35:51 2020 +0200 Really make -Werror happy commit 12b0d17c20d30948cc5c0a58e1671db96de63f7c Author: NiLuJe <ninuje@gmail.com> Date: Sun Apr 26 00:07:13 2020 +0200 Make -Werror happy ;). commit 03f86d0b802c1409291490a51b981620eba45f87 Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 23:53:18 2020 +0200 Some more refactoring commit 3b63b054f41dce0b8f43b596b6fc2885434065bb Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 22:50:37 2020 +0200 Make KFMon-specific stuff private (i.e., static) commit e189d84815de6adc1f60e654cf873c9328ea2380 Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 22:39:34 2020 +0200 Make gitignore tweaks survive a regen c.f., https://stackoverflow.com/questions/5873025 commit 6a01d0e920cbc15c7bab7dc0ddae3a6d19b26acd Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 20:35:57 2020 +0200 Refresh gitignore commit 3858b0ab846a4bd6415096c962a36bd226d708f9 Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 20:34:54 2020 +0200 We don't use that commit e8711d785ea1f442184cfcca976bc8a1ac0a8eb9 Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 20:28:04 2020 +0200 Parse KFMon's reply for nicer feedback on failures commit a2dd5994646a2ce8e36203cabe28ae6c8c665056 Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 20:00:48 2020 +0200 Initial implementation of the KFMon IPC start command Based on kfmon-ipc, hopefully haven't mangled anything too much. (Untested) commit 2e99cbe00c20d160e71e05a7c1d9c8c66b554235 Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 18:02:27 2020 +0200 Switch to GNU syntax for macros without duplication of side-effects. c.f., https://gcc.gnu.org/onlinedocs/cpp/Duplication-of-Side-Effects.html#Duplication-of-Side-Effects (Same code is generated, but at least this way Clang no longers flood my IDE with red squiggly lines across eveyr other line ;p). commit 87b9d6dc95b0539ff5942d0414d26ff7a69e61af Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 18:01:45 2020 +0200 Add KDevelop project files to gitignore commit 456073e46216427f9fbd68a9ab0fc676e0febf76 Author: NiLuJe <ninuje@gmail.com> Date: Sat Apr 25 18:01:07 2020 +0200 Update doc for first iteration of kfmon integration (Still TODO ;p).
This commit is contained in:
9
res/doc
9
res/doc
@@ -23,7 +23,7 @@
|
||||
# dbg_error - always returns an error (for testing)
|
||||
# dbg_msg - shows a message (for testing)
|
||||
# dbg_toast - shows a toast (for testing)
|
||||
# kfmon - triggers a kfmon action (TODO)
|
||||
# kfmon - triggers a kfmon action
|
||||
# nickel_setting - toggles a boolean setting
|
||||
# nickel_extras - opens one of the beta features
|
||||
# nickel_misc - other stuff which isn't significant enough for its own category
|
||||
@@ -34,7 +34,9 @@
|
||||
# dbg_error - the error message
|
||||
# dbg_msg - the message
|
||||
# dbg_toast - the message
|
||||
# kfmon - TODO
|
||||
# kfmon - the filename of the KFMon watched item to launch.
|
||||
# This is actually the basename of the watch's filename as specified in its KFMon config.
|
||||
# You can also check the output of the 'list' command via the kfmon-ipc tool.
|
||||
# nickel_setting - one of:
|
||||
# invert - toggles FeatureSettings.InvertScreen (all versions)
|
||||
# lockscreen - toggles PowerSettings.UnlockEnabled (4.12.12111+)
|
||||
@@ -66,6 +68,7 @@
|
||||
# menu_item :main :Do Nothing :cmd_spawn :sleep 60
|
||||
# menu_item :main :Kernel Version :cmd_output :500:uname -a
|
||||
# menu_item :main :Sketch Pad :nickel_extras :Sketch Pad
|
||||
# menu_item :main :Plato :kfmon :plato.png
|
||||
# menu_item :reader :Invert Screen :nickel_setting :invert
|
||||
#
|
||||
# You will need to reboot to see any changes.
|
||||
@@ -78,4 +81,4 @@
|
||||
# To uninstall NickelMenu, create a file named KOBOeReader/.adds/nm/uninstall,
|
||||
# or manually uninstall it by deleting libnm.so. You can also uninstall it by
|
||||
# triggering the failsafe mechanism by turning your Kobo off within 20 seconds
|
||||
# of turning it on.
|
||||
# of turning it on.
|
||||
|
||||
Reference in New Issue
Block a user