123 lines
7.9 KiB
Plaintext
123 lines
7.9 KiB
Plaintext
# 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. 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 (/mnt/onboard/.adds/nm). 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
|
|
# reader - the overflow menu in the reader
|
|
# <label> the label to show on the menu item (must not contain :)
|
|
# <action> the type of action to run, one of:
|
|
# 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 - 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
|
|
# power - gracefully controls the power state
|
|
# cmd_spawn - starts another process or script in the background
|
|
# cmd_output - runs a command and displays the output
|
|
# <arg> the argument passed to the action:
|
|
# 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 - one of:
|
|
# invert - toggles FeatureSettings.InvertScreen
|
|
# lockscreen - toggles PowerSettings.UnlockEnabled (4.12.12111+)
|
|
# screenshots - toggles FeatureSettings.Screenshots
|
|
# force_wifi - toggles DeveloperSettings.ForceWifiOn (note: the setting doesn't apply until you toggle WiFi)
|
|
# nickel_extras - the mimetype of the plugin, or one of:
|
|
# web_browser
|
|
# unblock_it
|
|
# sketch_pad
|
|
# solitaire
|
|
# sudoku
|
|
# word_scramble
|
|
# nickel_misc - one of:
|
|
# 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+)
|
|
# power - one of:
|
|
# shutdown (4.13.12638+)
|
|
# reboot (4.13.12638+)
|
|
# 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).
|
|
#
|
|
# 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 *every* active KFMon watches
|
|
#
|
|
# For example, you might have a configuration file in KOBOeReader/.adds/nm/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 :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 :Import Books :nickel_misc :rescan_books_full
|
|
#
|
|
# You will need to reboot to see any changes.
|
|
#
|
|
# 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 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.
|