Add non-kobopatch configs and a readme for bin/

master
Jay Logan 2020-08-25 22:14:34 -05:00
parent c6c6771aea
commit e3af654499
13 changed files with 308 additions and 1 deletions

5
bin/readme.txt 100644
View File

@ -0,0 +1,5 @@
This is where kobopatch.sh looks for the kobopatch binary and the patcher itself looks for the firmware zip. merge-kfmon.sh also looks for KFmon.tgz (the KoboRoot.tgz for Kute File Monitor, renamed). Download links for these are below.
Kobopatch: https://github.com/pgaskin/kobopatch/releases
Kobo firmware: https://pgaskin.net/KoboStuff/kobofirmware.html
KFMon: https://www.mobileread.com/forums/showthread.php?t=274231

View File

@ -1,4 +1,4 @@
# taken from NiLuJe's autopatch.sh: http://trac.ak-team.com/trac/browser/niluje/Configs/trunk/Kindle/Kobo_Hacks/Patches/autopatch.sh # modified from NiLuJe's autopatch.sh: http://trac.ak-team.com/trac/browser/niluje/Configs/trunk/Kindle/Kobo_Hacks/Patches/autopatch.sh
echo "Uncompressing tarballs" echo "Uncompressing tarballs"
gunzip -c bin/KFmon.tgz > KFMon.tar gunzip -c bin/KFmon.tgz > KFMon.tar

View File

@ -0,0 +1,16 @@
; KFMon Log
[watch]
; Those next two keys are MANDATORY
filename = /mnt/onboard/kfmon.png ; Absolute path of the icon to watch for
action = /mnt/onboard/.adds/kfmon/bin/kfmon-printlog.sh ; Absolute path of the command to launch when the icon is opened
; The following keys are NOT mandatory
label = Show KFMon log ; Label available for use by a GUI frontend
hidden = 1 ; Whether to hide this entry from a GUI frontend
block_spawns = 0 ; Prevents *any* script from being launched via KFMon while the command launched by this watch is still running.
; This is useful for document readers, because they could otherwise trigger unwanted
; behavior through their file manager, metadata reader, or thumbnailer.
do_db_update = 0 ; Do we want to update Nickel's DB for this icon? (Potentially unsafe, disabled by default)
; If you enabled do_db_update, the next three keys NEED to be set
db_title = KFMon Log ; Title to use for the icon's Library entry if do_db_update = 1
db_author = NiLuJe ; Author to use for the icon's Library entry if do_db_update = 1
db_comment = Print the last few lines of KFMon's log ; Comment to use for the icon's Library entry if do_db_update = 1

View File

@ -0,0 +1,9 @@
; This is KFMon's main config.
; It holds basic information concerning the behavior of the daemon itself.
[daemon]
db_timeout = 500 ; Maximum amount of time to wait (in ms) before deeming that the Nickel DB is really busy.
; Amount is automatically doubled on CLOSE events.
; Increase this value if your Nickel DB is large, and you trip too many "busy" false-positives on OPEN.
; Good news: you shouldn't have to worry too much about this on FW >= 4.6 ;).
use_syslog = 0 ; Log to syslog instead of a file? Might be useful to save a few flash writes...
with_notifications = 1 ; Show on screen notifications for informational messages (i.e., successful startup of an action)

View File

@ -0,0 +1,25 @@
; This is a working example of a full config file to setup a new watch.
; You can only define a *single* watch per ini file, and the section name *needs* to be "watch".
[watch]
; Those next two keys are MANDATORY
filename = /mnt/onboard/koreader.png ; Absolute path of the icon to watch for
action = /mnt/onboard/.adds/koreader/koreader.sh ; Absolute path of the command to launch when the icon is opened
; The following keys are NOT mandatory
label = KOReader ; Label available for use by a GUI frontend
hidden = 0 ; Whether to hide this entry from a GUI frontend
block_spawns = 1 ; Prevents *any* script from being launched via KFMon while the command launched by this watch is still running.
; This is useful for document readers, because they could otherwise trigger unwanted
; behavior through their file manager, metadata reader, or thumbnailer.
do_db_update = 0 ; Do we want to update Nickel's DB for this icon? (Potentially unsafe, disabled by default)
; If you enabled do_db_update, the next three keys NEED to be set
db_title = KOReader ; Title to use for the icon's Library entry if do_db_update = 1
db_author = KOReader Devs ; Author to use for the icon's Library entry if do_db_update = 1
db_comment = An eBook reader application ; Comment to use for the icon's Library entry if do_db_update = 1
; This is not part of the actual KFMon config, it's just a sentinel value used by the KOReader startup script.
; If you encounter weird Nickel behavior after exiting KOReader, set this to true
; On some HW/FW combos, this may translate into wonky power management.
; For instance, and somewhat more severely, on my H2O, the IR grid touchscreen will often never wakeup after a suspend.
; I've also seen broken USBMS behavior on some newer FW versions, so, that's fun, too...
;reboot_on_exit=false

View File

@ -0,0 +1,18 @@
; Plato (https://www.mobileread.com/forums/showthread.php?t=292914)
; Relies on upstream's fmon scripts (i.e., plato-launcher-fmon-x.y.z.zip)
; This means you can follow upstream's installation instructions to the letter, and expect things to work just fine ;).
[watch]
; Those next two keys are MANDATORY
filename = /mnt/onboard/icons/plato.png ; Absolute path of the icon to watch for
action = /mnt/onboard/.adds/plato/plato.sh ; Absolute path of the command to launch when the icon is opened
; The following keys are NOT mandatory
label = Plato ; Label available for use by a GUI frontend
hidden = 0 ; Whether to hide this entry from a GUI frontend
block_spawns = 1 ; Prevents *any* script from being launched via KFMon while the command launched by this watch is still running.
; This is useful for document readers, because they could otherwise trigger unwanted
; behavior through their file manager, metadata reader, or thumbnailer.
do_db_update = 0 ; Do we want to update Nickel's DB for this icon? (Potentially unsafe, disabled by default)
; If you enabled do_db_update, the next three keys NEED to be set
db_title = Plato ; Title to use for the icon's Library entry if do_db_update = 1
db_author = Baskerville ; Author to use for the icon's Library entry if do_db_update = 1
db_comment = A document reader ; Comment to use for the icon's Library entry if do_db_update = 1

View File

@ -0,0 +1,9 @@
[watch]
; Those next two keys are MANDATORY
filename = /mnt/onboard/vlasovsoft.png
action = /mnt/onboard/.adds/vlasovsoft/launcher.sh
; The following keys are NOT mandatory
label = Vlasovsoft Suite
block_spawns = 1
do_db_update = 0

View File

@ -0,0 +1,206 @@
# NickelMenu (libnm.so)
#
# This tool injects menu items into Nickel.
#
# It should work on firmware 4.6+, but it has only been tested on 4.20.14622 -
# 4.22.15268. It is perfectly safe to try out on any newer firmware version, as
# it has a lot of error checking, and a failsafe mechanism which automatically
# uninstalls it as a last resort.
#
# Place your configuration files in this folder. They can be named anything, and
# should consist of multiple lines either starting with # for a comment, or in
# one of the the following formats (spaces around fields are ignored):
#
# menu_item:<location>:<label>:<action>:<arg>
# Adds a menu item.
#
# <location> the menu to add the item to, one of:
# main - the menu in the top-left corner of the home screen
# (in firmware 4.23.15505+, this menu was removed, so a new item will be added to the tabs on the bottom-right)
# reader - the overflow menu in the reader
# browser - the menu in the bottom-right of the web browser
# library - the menu in the filter bar for the "My Books" and "My Articles" library views
# <label> the label to show on the menu item (must not contain :)
# <action> the type of action to run, one of:
# cmd_spawn - starts a command in the background
# cmd_output - runs a command, waits for it to exit, and optionally displays the output
# dbg_syslog - writes a message to syslog (for testing)
# 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
# nickel_setting - changes a setting
# nickel_extras - opens one of the beta features
# nickel_browser - opens the browser
# (on firmware 4.23.15505+, you won't be able to exit the browser unless you use the "modal" option or add "menu_item:browser:Quit:nickel_misc:home" to the config)
# nickel_misc - other stuff which isn't significant enough for its own category
# nickel_open - opens a view
# nickel_wifi - controls wifi (note: it doesn't wait for it to connect or disconnect, neither does it check for success)
# nickel_orientation - controls screen orientation
# (devices without an orientation sensor may need to use the kobopatch patch "Allow rotation on all devices" or set [DeveloperSettings] ForceAllowLandscape=true)
# (devices with an orientation sensor don't need to do anything, but can set the config setting to make this work on all views)
# (this will override the rotation icon/popup until it is set to something different or the device is rebooted)
# power - gracefully controls the power state
# skip - skips a number of actions after the current one (mainly useful for more complex conditional chains) (this action will not update the success/failure flag)
# <arg> the argument passed to the action:
# cmd_spawn - the command line to pass to /bin/sh -c (started in /)
# It can be prefixed with "quiet:" to prevent the toast with the process PID from being displayed.
# cmd_output - the timeout in milliseconds (0 < t < 10000), a colon, then the command line to pass to /bin/sh -c (started in /)
# It can be prefixed with "quiet:" to prevent the message box with the output from being displayed (i.e. you'd use this where you'd normally use >/dev/null 2>&1).
# dbg_syslog - the text to write
# dbg_error - the error message
# dbg_msg - the message
# dbg_toast - the message
# 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 (i.e., the png).
# You can also check the output of the 'list' command via the kfmon-ipc tool.
# nickel_setting - <action>:<setting>
# action is one of:
# toggle - toggles between true/false
# enable - sets to true
# disable - sets to false
# setting is one of:
# invert - FeatureSettings.InvertScreen
# lockscreen - PowerSettings.UnlockEnabled (4.12.12111+)
# screenshots - FeatureSettings.Screenshots
# force_wifi - DeveloperSettings.ForceWifiOn (note: the setting doesn't apply until you toggle WiFi)
# auto_usb_gadget - Automatically enable USB mass storage on connection
# nickel_extras - the mimetype of the plugin, or one of:
# unblock_it
# sketch_pad
# solitaire
# sudoku
# word_scramble
# nickel_browser - one of:
# - opens the web browser to the default homepage (note that the line should end with a colon even though the argument is blank)
# <url> - opens the web browser to the specified URL
# <url> <css> - opens the web browser to the specified URL and injects the specified CSS (which can contain spaces and colons) into all pages
# modal - opens the web browser to the default homepage as a pop-up window
# modal:<url> - see above
# modal:<url> <css> - see above
# nickel_misc - one of:
# home - goes to the home screen
# force_usb_connection - forces a usb connection dialog to be shown
# rescan_books - forces nickel to rescan books (4.13.12638+)
# rescan_books_full - forces a full usb connect/disconnect cycle (4.13.12638+)
# nickel_open - one of:
# discover:storefront - Kobo Store
# discover:wishlist - Wishlist
# library:library - My Books (with last tab and filter)
# library:all - Books
# library:authors - Authors
# library:series - Series (4.20.14601+)
# library:shelves - Collections
# library:pocket - Articles
# library:dropbox - Dropbox (4.18.13737+)
# reading_life:reading_life - Activity (with last tab)
# reading_life:stats - Activity
# reading_life:awards - Awards
# reading_life:words - My Words
# store:overdrive - OverDrive (4.10.11655+) (note: if you don't have an active OverDrive account, it will give you a "Network Error")
# store:search - Search
# nickel_wifi - one of:
# autoconnect - attempts to enable and connect to wifi (similar to what happens when you open a link)
# autoconnect_silent - attempts to connect to wifi in the background (does nothing if wifi is disabled, the battery is low, is already connected, or there aren't any known networks in range) (no errors are shown) (similar to what happens when you turn on the Kobo)
# enable - enables WiFi (but doesn't necessarily connect to it)
# disable - disables WiFi
# toggle - toggles WiFi (but doesn't necessarily connect to it)
# nickel_orientation - one of:
# portrait (4.13.12638+)
# landscape (4.13.12638+)
# inverted_portrait (4.13.12638+)
# inverted_landscape (4.13.12638+)
# invert (4.13.12638+) - Toggles between inverted/non-inverted (preserves side) (this will not work if used in a chain with swap)
# swap (4.13.12638+) - Toggles between portrait/landscape (preserves inversion) (this will not work if used in a chain with invert)
# power - one of:
# shutdown (4.13.12638+)
# reboot (4.13.12638+)
# sleep (4.13.12638+)
# skip - the number of actions to skip, or -1 to skip all remaining ones (i.e. end the chain)
#
# chain_success:<action>:<arg>
# chain_failure:<action>:<arg>
# chain_always:<action>:<arg>
# Adds an action to the chain that began with the preceding menu_item.
# Actions are performed in the order they are written.
# Each chain entry MUST follow the menu_item it is attached to. Another
# menu_item marks the start of the next chain.
# By default, each action only executes if the previous one was successful.
# If chain_failure is used, the action is only executed if the last one
# failed. If chain_always is used, the action is executed no matter what.
# Any error message is only displayed if the action is the last one which
# was executed in the chain (not necessarily the last one in the config
# file).
#
# generator:<location>:<generator>
# generator:<location>:<generator>:<arg>
# Generates menu items dynamically during startup.
#
# <location> the menu to add the items to, same as for menu_item.
# <generator> the generator to use to generate the options, one of:
# _test - generates numbered items, for testing only
# kfmon - adds items from kfmon
# <arg> the argument passed to the generator (if needed):
# _test - the number of items to generate (0-10)
# kfmon - one or none of:
# gui - only enumerate non-hidden active KFMon watches (this is the default)
# all - enumerate all active KFMon watches
#
# For example, you might have a configuration file named "mystuff" like:
#
# menu_item :main :Show an Error :dbg_error :This is an error message!
# menu_item :main :Do Nothing :cmd_spawn :sleep 60
# menu_item :main :Dump Syslog :cmd_spawn :logread > /mnt/onboard/.adds/syslog.log
# 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
# generator :main :kfmon
# menu_item :reader :Invert Screen :nickel_setting :toggle :invert
# menu_item :reader :Invert Orientation :nickel_orientation :invert
# menu_item :main :IP Address :cmd_output :500:/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}'
# menu_item :main :Telnet :cmd_spawn :quiet:/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
# chain_success :cmd_spawn :quiet:/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 1023" || true && exec /usr/bin/tcpsvd -E 0.0.0.0 1023 /usr/sbin/telnetd -i -l /bin/login
# chain_success :dbg_toast :Started Telnet server on port 1023.
# menu_item :main :FTP :cmd_spawn :quiet:/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 1021" || true && exec /usr/bin/tcpsvd -E 0.0.0.0 1021 /usr/sbin/ftpd -w -t 30 /mnt/onboard
# chain_success :dbg_toast :Started FTP server for KOBOeReader partition on port 1021.
# menu_item :main :Telnet (toggle) :cmd_output :500:quiet :/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 2023"
# chain_success:skip:5
# chain_failure :cmd_spawn :quiet :/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
# chain_success :cmd_spawn :quiet :exec /usr/bin/tcpsvd -E 0.0.0.0 2023 /usr/sbin/telnetd -i -l /bin/login
# chain_success :dbg_toast :Started Telnet server on port 2023
# chain_failure :dbg_toast :Error starting Telnet server on port 2023
# chain_always:skip:-1
# chain_success :dbg_toast :Stopped Telnet server on port 2023
# menu_item :library :Import books :nickel_misc :rescan_books_full
# menu_item :browser :Invert Screen :nickel_setting :toggle :invert
# menu_item :browser :Open Pop-Up :nickel_browser :modal
#
# If there is an error in the configuration, an item which displays it will be
# added to the main menu. If an internal error occurs, it is written to syslog,
# which can be viewed over telnet or SSH (the username is root) with the command
# logread.
#
# To uninstall NickelMenu, create a file in this directory named "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.
#
# To use NickelMenu to launch other software, you can usually use cmd_spawn with
# the normal launch script. For example, KOReader and Plato will work as-is (or
# with NiLuJe's one-click install packages which include NM). For specific
# instructions, you should see their documentation (most newer software has
# information about NickelMenu). If using cmd_spawn directly doesn't work, you
# can also try using KFMon and the kfmon action/generator.
#
# - NiLuJe's KOReader/Plato packages: https://www.mobileread.com/forums/showthread.php?t=314220
# - KOReader: https://github.com/koreader/koreader/wiki/Installation-on-Kobo-devices
# - Plato: https://github.com/baskerville/plato/blob/master/doc/GUIDE.md
# - Vlasovsoft: https://wiki.vlasovsoft.net/doku.php?id=en:installation
#
# Note: If you are embedding a NickelMenu config in your own mod, please name it
# something unique to avoid overwriting someone's existing configuration. In
# addition, please do not include NickelMenu itself in it unless you are
# planning to update it as new releases are made.
#
# Note: Do not edit this file directly, as it will be overwritten when updating
# NickelMenu.

View File

@ -0,0 +1,3 @@
# Automatically populate NickelMenu with active KFMon watches
generator : main : kfmon

View File

@ -0,0 +1,7 @@
# Launch KOReader via KFMon
# NOTE: .adds/nm/kfmon will generate this automatically
#menu_item : main : KOReader : kfmon : koreader.png
# Launch KOReader directly via NM (>= KOReader 2020.05)
#menu_item : main : KOReader : cmd_spawn : quiet : exec /mnt/onboard/.adds/koreader/koreader.sh

View File

@ -0,0 +1 @@
menu_item : main : Connect USB : nickel_misc : force_usb_connection

View File

@ -0,0 +1,7 @@
# Launch Plato via KFMon
# NOTE: .adds/nm/kfmon will generate this automatically
#menu_item : main : Plato : kfmon : plato.png
# Launch Plato directly via NM
#menu_item : main : Plato : cmd_spawn : quiet : exec /mnt/onboard/.adds/plato/plato.sh

View File

@ -0,0 +1 @@
For version-controlled storage of Kobo config files not relevant to or managed by kobopatch.