├── .drone.yml ├── .github ├── CODEOWNERS └── workflows │ ├── build.yaml │ ├── release.yaml │ └── test.yaml ├── .gitignore ├── .gitmodules ├── LICENSE ├── Makefile ├── README.md ├── res └── doc ├── src ├── action.c ├── action.h ├── action_c.c ├── action_cc.cc ├── config.c ├── config.h ├── generator.c ├── generator.h ├── generator_c.c ├── kfmon.c ├── kfmon.h ├── kfmon_helpers.h ├── nickelmenu.cc ├── nickelmenu.h ├── util.c └── util.h └── test └── syms ├── go.mod ├── go.sum └── main.go /.drone.yml: -------------------------------------------------------------------------------- 1 | kind: pipeline 2 | type: docker 3 | name: NickelMenu 4 | 5 | trigger: 6 | event: [push, pull_request, tag] 7 | 8 | steps: 9 | - name: submodules 10 | image: ghcr.io/pgaskin/nickeltc:1.0 11 | when: 12 | event: [push, pull_request, tag] 13 | command: ["git", "submodule", "update", "--init", "--recursive"] 14 | - name: build 15 | image: ghcr.io/pgaskin/nickeltc:1.0 16 | when: 17 | event: [push, pull_request, tag] 18 | commands: 19 | - make clean 20 | - make all koboroot 21 | - mkdir out && mv KoboRoot.tgz src/libnm.so out/ 22 | depends_on: [submodules] 23 | - name: build-NM_UNINSTALL_CONFIGDIR 24 | image: ghcr.io/pgaskin/nickeltc:1.0 25 | when: 26 | event: [push, pull_request, tag] 27 | commands: 28 | - make clean 29 | - make all koboroot NM_UNINSTALL_CONFIGDIR=1 30 | - mkdir out/with-NM_UNINSTALL_CONFIGDIR && mv KoboRoot.tgz src/libnm.so out/with-NM_UNINSTALL_CONFIGDIR/ 31 | depends_on: [build] 32 | - name: test-syms 33 | image: golang:1.14 34 | when: 35 | event: [push, pull_request, tag] 36 | commands: 37 | - cd test/syms && go build -o ../../test.syms . && cd ../.. 38 | - cd src && ../test.syms && cd .. 39 | - name: upload-build 40 | image: plugins/s3 41 | when: 42 | event: [push] 43 | settings: 44 | endpoint: https://s3.geek1011.net 45 | bucket: nickelmenu 46 | access_key: nickelmenu 47 | secret_key: {from_secret: S3_SECRET_NICKELMENU} 48 | target: artifacts/build/${DRONE_BUILD_NUMBER} 49 | source: out/**/* 50 | strip_prefix: out/ 51 | depends_on: [build, build-NM_UNINSTALL_CONFIGDIR] 52 | - name: upload-tag 53 | image: plugins/s3 54 | when: 55 | event: [tag] 56 | settings: 57 | endpoint: https://s3.geek1011.net 58 | bucket: nickelmenu 59 | access_key: nickelmenu 60 | secret_key: {from_secret: S3_SECRET_NICKELMENU} 61 | target: artifacts/tag/${DRONE_TAG} 62 | source: out/**/* 63 | strip_prefix: out/ 64 | depends_on: [build, build-NM_UNINSTALL_CONFIGDIR] 65 | - name: upload-commit 66 | image: plugins/s3 67 | when: 68 | event: [push] 69 | settings: 70 | endpoint: https://s3.geek1011.net 71 | bucket: nickelmenu 72 | access_key: nickelmenu 73 | secret_key: {from_secret: S3_SECRET_NICKELMENU} 74 | target: artifacts/commit/${DRONE_COMMIT} 75 | source: out/**/* 76 | strip_prefix: out/ 77 | depends_on: [build, build-NM_UNINSTALL_CONFIGDIR] 78 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @pgaskin 2 | src/kfmon* @NiLuJe -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | name: NickelMenu 7 | runs-on: ubuntu-latest 8 | container: ghcr.io/pgaskin/nickeltc:1.0 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v3 12 | with: 13 | submodules: true 14 | - name: Build 15 | run: make all koboroot 16 | - name: Upload 17 | uses: actions/upload-artifact@v4 18 | with: 19 | name: NickelMenu 20 | path: KoboRoot.tgz 21 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: {push: {tags: [v*]}} 3 | 4 | jobs: 5 | build: 6 | name: NickelMenu 7 | runs-on: ubuntu-latest 8 | container: ghcr.io/pgaskin/nickeltc:1.0 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v3 12 | with: 13 | submodules: true 14 | - name: Build 15 | run: make all koboroot 16 | - name: Release 17 | id: release 18 | uses: actions/create-release@latest 19 | env: 20 | GITHUB_TOKEN: ${{secrets.GHTOKEN}} 21 | with: 22 | tag_name: ${{github.ref}} 23 | release_name: NickelMenu ${{github.ref}} 24 | body: '' 25 | draft: true 26 | prerelease: false 27 | - name: Upload 28 | uses: actions/upload-release-asset@v1 29 | env: 30 | GITHUB_TOKEN: ${{secrets.GHTOKEN}} 31 | with: 32 | upload_url: ${{steps.release.outputs.upload_url}} 33 | asset_path: ./KoboRoot.tgz 34 | asset_name: KoboRoot.tgz 35 | asset_content_type: application/gzip 36 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | name: NickelMenu / Symbols 7 | runs-on: ubuntu-latest 8 | container: docker.io/golang:1.14 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v3 12 | with: 13 | submodules: true 14 | - name: Build 15 | run: cd test/syms && go build -o ../../test.syms . 16 | - name: Run 17 | run: cd src && ../test.syms 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # make gitignore 2 | .kdev4/ 3 | *.kdev4 4 | .kateconfig 5 | .vscode/ 6 | .idea/ 7 | .clangd/ 8 | .cache/ 9 | compile_commands.json 10 | /KoboRoot.tgz 11 | /src/libnm.so 12 | /src/action.o 13 | /src/action_c.o 14 | /src/config.o 15 | /src/generator.o 16 | /src/generator_c.o 17 | /src/kfmon.o 18 | /src/util.o 19 | /src/action_cc.o 20 | /src/nickelmenu.o 21 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "NickelHook"] 2 | path = NickelHook 3 | url = https://github.com/pgaskin/NickelHook.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2023 Patrick Gaskin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include NickelHook/NickelHook.mk 2 | 3 | override PKGCONF += Qt5Widgets 4 | override LIBRARY := src/libnm.so 5 | override SOURCES += src/action.c src/action_c.c src/action_cc.cc src/config.c src/generator.c src/generator_c.c src/kfmon.c src/nickelmenu.cc src/util.c 6 | override CFLAGS += -Wall -Wextra -Werror -fvisibility=hidden 7 | override CXXFLAGS += -Wall -Wextra -Werror -Wno-missing-field-initializers -isystemlib -fvisibility=hidden -fvisibility-inlines-hidden 8 | override KOBOROOT += res/doc:$(NM_CONFIG_DIR)/doc 9 | 10 | override SKIPCONFIGURE += strip 11 | strip: 12 | $(STRIP) --strip-unneeded src/libnm.so 13 | .PHONY: strip 14 | 15 | ifeq ($(NM_UNINSTALL_CONFIGDIR),1) 16 | override CPPFLAGS += -DNM_UNINSTALL_CONFIGDIR 17 | endif 18 | 19 | ifeq ($(NM_CONFIG_DIR),) 20 | override NM_CONFIG_DIR := /mnt/onboard/.adds/nm 21 | endif 22 | 23 | ifneq ($(NM_CONFIG_DIR),/mnt/onboard/.adds/nm) 24 | $(info -- Warning: NM_CONFIG_DIR is set to a non-default value; this will cause issues with other mods using it!) 25 | endif 26 | 27 | override CPPFLAGS += -DNM_CONFIG_DIR='"$(NM_CONFIG_DIR)"' -DNM_CONFIG_DIR_DISP='"$(patsubst /mnt/onboard/%,KOBOeReader/%,$(NM_CONFIG_DIR))"' 28 | 29 | include NickelHook/NickelHook.mk 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

NickelMenu

2 | 3 | The easiest way to launch custom scripts, change hidden settings, and run actions on Kobo eReaders. 4 | 5 | See the [website](https://pgaskin.net/NickelMenu) and [thread on MobileRead](https://mobileread.com/forums/showthread.php?t=329525) for screenshots and more details. 6 | 7 | ## Installation 8 | You can download pre-built packages of the latest stable release from the [releases](https://github.com/pgaskin/NickelMenu/releases) page, or you can find bleeding-edge builds of each commit from [here](https://github.com/pgaskin/NickelMenu/actions). 9 | 10 | After you download the package, copy `KoboRoot.tgz` into the `.kobo` folder of your eReader, then eject it. 11 | 12 | After it installs, you will find a new menu item named `NickelMenu` with further instructions which you can also read [here](./res/doc). 13 | 14 | To uninstall NickelMenu, just create a new file named `uninstall` in `.adds/nm/`, or trigger the failsafe mechanism by immediately powering off the Kobo after it starts booting. 15 | 16 | Most errors, if any, will be displayed as a menu item in the main menu. If no new menu entries appear here after a reboot, try reinstalling NickelMenu. If that still doesn't work, connect over telnet or SSH and check the output of `logread`. 17 | 18 | ## Compiling 19 | 20 | NickelMenu is designed to be compiled with [NickelTC](https://github.com/pgaskin/NickelTC). To compile it with Docker/Podman, use `docker run --volume="$PWD:$PWD" --user="$(id --user):$(id --group)" --workdir="$PWD" --env=HOME --entrypoint=make --rm -it ghcr.io/pgaskin/nickeltc:1.0 all koboroot`. To compile it on the host, use `make CROSS_COMPILE=/path/to/nickeltc/bin/arm-nickel-linux-gnueabihf-`. 21 | 22 | 23 | -------------------------------------------------------------------------------- /res/doc: -------------------------------------------------------------------------------- 1 | # NickelMenu (libnm.so) 2 | # https://pgaskin.net/NickelMenu 3 | # 4 | # This tool injects menu items into Nickel. 5 | # 6 | # It should work on firmware 4.6+, but it has only been tested on 4.20.14622 - 7 | # 4.31.19086. It is perfectly safe to try out on any newer firmware version, as 8 | # it has a lot of error checking, and a failsafe mechanism which automatically 9 | # uninstalls it as a last resort. 10 | # 11 | # Place your configuration files in this folder. They can be named anything, and 12 | # should consist of multiple lines either starting with # for a comment, or in 13 | # one of the the following formats (spaces around fields are ignored): 14 | # 15 | # menu_item::