View Single Post
Old 01-10-2023, 02:44 PM   #868
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,902
Karma: 169810634
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by redrob View Post
Will anyone offer direction to simply expand the number of menu items for at least a novice user as well as how to insert them?
Edit: Out of curiosity, why did you also post your message in the calibre => Recipes => Recipes - Re-usable code ?

If you look at the file named doc that was installed with NickelMenu, it has sample actions and instructions though with the usual issue that since the author wrote the instructions, they tend to make assumptions about what the end user knows.

I've attached a sample of my NM configuration file to this message and included it and the doc file in a zip file attached to this message. One item to remember is that these files are plain text.

Basically, any line that starts with a # is a comment. Menu_item is the start of a menu item, the main/library/reader/whatever is what location this menu item will be available from with the rest of the line being what the menu item does. Some of the menu items will take more than one action hence the chain_ items. As mentioned, the doc file includes the needed information.

Good luck!

Quote:
Code:
#
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #
menu_item : main    : Dump Syslog        : cmd_spawn      : logread > /mnt/onboard/.adds/syslog.log
menu_item : main    : Free Memory        : cmd_output     : 500  : free -m
menu_item : main    : Kernel Version     : cmd_output     : 500  : uname -a
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    : Dark Mode          : nickel_setting : toggle : dark_mode
menu_item :main     : Invert & Reboot    : nickel_setting :toggle: invert
    chain_success      : power           : reboot
#
menu_item : main    : Screenshots        : nickel_setting : toggle : screenshots
menu_item : main    : Import books       : nickel_misc    : rescan_books_full
menu_item : main    : USB Connect        : nickel_misc    : force_usb_connection
menu_item : main    : Toggle Autoconnect : nickel_setting : toggle : auto_usb_gadget
menu_item : main    : Screensaver Status : cmd_output     : 500: quiet : test -e /mnt/onboard/.kobo/screensaver_old
      chain_success    : dbg_toast       : Screensaver is off
      chain_failure    : dbg_toast       : Screensaver is on
#
menu_item : main : Toggle screensaver    : cmd_output     : 500: quiet: test -e /mnt/onboard/.kobo/screensaver_old
      chain_failure    : skip : 3
        chain_success  : cmd_spawn : quiet: mv /mnt/onboard/.kobo/screensaver_old /mnt/onboard/.kobo/screensaver
        chain_success  : dbg_toast : Screensaver on
        chain_always   : skip : -1
      chain_failure    : cmd_spawn : quiet: mv /mnt/onboard/.kobo/screensaver /mnt/onboard/.kobo/screensaver_old
      chain_success    : dbg_toast : Screensaver off
menu_item : main    : Reboot             : power          : reboot
menu_item : main    : Shutdown           : power          : shutdown
#
menu_item : main    : Force WiFi on      : nickel_setting  : toggle: force_wifi
     chain_success  : nickel_wifi        : autoconnect
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #

menu_item : reader  : Dark Mode          : nickel_setting : toggle : dark_mode
menu_item : reader  : Invert & Reboot    : nickel_setting : toggle : invert
    chain_success   : power              : reboot
#
menu_item : reader  : Screenshots        : nickel_setting : toggle : screenshots
menu_item : reader  : Free Memory        : cmd_output     : 500: free -m
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #

menu_item : browser : Invert & Reboot    : nickel_setting : toggle: invert
    chain_success   : power              : reboot
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #

menu_item : library : Dark Mode          : nickel_setting : toggle : dark_mode
menu_item : library : Free Memory        : cmd_output     : 500: free -m
menu_item : library  : Invert & Reboot   : nickel_setting : toggle: invert
    chain_success   : power              : reboot
#
menu_item : library : Screenshots        : nickel_setting : toggle : screenshots
menu_item : library : Import books       : nickel_misc    : rescan_books_full
menu_item : library : USB Connect        : nickel_misc    : force_usb_connection
menu_item : library : Reboot             : power          : reboot
menu_item : library : Shutdown           : power          : shutdown
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #
#
Attached Files
File Type: zip nm_menu_doc.zip (6.8 KB, 207 views)

Last edited by DNSB; 01-10-2023 at 04:38 PM.
DNSB is offline   Reply With Quote