mirror of
https://github.com/nicoverbruggen/kobo-config.git
synced 2026-03-21 23:30:10 +01:00
Various updates
- Add Legibility Status - Updated Legibility Toggle - Added copy_mac.sh setup script - Updated README
This commit is contained in:
@@ -17,20 +17,17 @@ experimental :menu_main_15505_icon :/mnt/onboard/.adds/nm/.cog.png
|
||||
menu_item :main :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_success : dbg_toast : Screensaver is now 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
|
||||
chain_success : dbg_toast : Screensaver is now OFF.
|
||||
|
||||
menu_item :main :Screenshots :nickel_setting :toggle :screenshots
|
||||
menu_item :main :Auto USB :nickel_setting :toggle :auto_usb_gadget
|
||||
|
||||
# With the notebook feature disabled, this toggle is no longer required
|
||||
# menu_item :main :Hide Notebook :cmd_output :500 :/mnt/onboard/.adds/scripts/disable_notebook.sh
|
||||
chain_success :power :reboot
|
||||
menu_item :main :Legibility Status :cmd_output :500 :/mnt/onboard/.adds/scripts/legibility_status.sh
|
||||
|
||||
menu_item :main :Toggle Legibility :cmd_output :500 :/mnt/onboard/.adds/scripts/toggle_wk_rendering.sh
|
||||
chain_success :power :reboot
|
||||
menu_item :main :Legibility Toggle :cmd_output :5000 :/mnt/onboard/.adds/scripts/toggle_wk_rendering.sh
|
||||
|
||||
menu_item :main :IP Address :cmd_output :500:/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}'
|
||||
|
||||
|
||||
25
.adds/scripts/legibility_status.sh
Executable file
25
.adds/scripts/legibility_status.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONFIG_FILE="/mnt/onboard/.kobo/Kobo/Kobo eReader.conf"
|
||||
|
||||
if grep -q "^webkitTextRendering=optimizeLegibility" "$CONFIG_FILE"; then
|
||||
echo "Optimized legibility is ON."
|
||||
echo ""
|
||||
echo "- Ligatures will be displayed."
|
||||
echo "- GPOS kerning works correctly."
|
||||
echo "- Justified text may have some wrapping issues."
|
||||
echo ""
|
||||
echo "It's highly recommended to enable left-aligned"
|
||||
echo "text to avoid wrapping issues in some books."
|
||||
echo ""
|
||||
echo "This mode renders text more correctly."
|
||||
echo "Use 'Legibility Toggle' to turn this OFF."
|
||||
else
|
||||
echo "Optimized legibility is OFF."
|
||||
echo ""
|
||||
echo "- Ligatures will NOT be displayed."
|
||||
echo "- Only old-style kerning works correctly."
|
||||
echo ""
|
||||
echo "This is the most compatible mode, and Kobo's default."
|
||||
echo "Use 'Legibility Toggle' to switch to turn this ON."
|
||||
fi
|
||||
@@ -9,13 +9,17 @@ CONFIG_FILE="/mnt/onboard/.kobo/Kobo/Kobo eReader.conf"
|
||||
if grep -q "^webkitTextRendering=optimizeLegibility" "$CONFIG_FILE"; then
|
||||
# Remove the line
|
||||
sed -i '/^webkitTextRendering=optimizeLegibility/d' "$CONFIG_FILE"
|
||||
echo "WebKit text rendering disabled."
|
||||
echo "Now turned OFF. Your Kobo will now reboot."
|
||||
echo "(No need to press the OK button...)"
|
||||
sleep 3 && reboot &
|
||||
else
|
||||
# Add the line below [Reading] section
|
||||
if grep -q "^\[Reading\]" "$CONFIG_FILE"; then
|
||||
sed -i '/^\[Reading\]/a webkitTextRendering=optimizeLegibility' "$CONFIG_FILE"
|
||||
echo "WebKit text rendering enabled."
|
||||
echo "Now turned ON. Your Kobo will now reboot."
|
||||
echo "(No need to press the OK button...)"
|
||||
sleep 3 && reboot &
|
||||
else
|
||||
echo "Could not find [Reading] section. Skipped."
|
||||
echo "Oops. Could not find [Reading] section!"
|
||||
fi
|
||||
fi
|
||||
|
||||
116
README.md
116
README.md
@@ -2,46 +2,80 @@
|
||||
|
||||
## What is this?
|
||||
|
||||
This repository helps you set up your Kobo just like I set up mine. Take a look!
|
||||
This repository helps you set up your Kobo just like I set up mine, which includes **some power user features**, and also some useful features. For example, support for **screensavers** and an **easy dark mode toggle** for when you're reading. Take a look!
|
||||
|
||||
<kbd><img src="./screenshot.png" width="500px"></kbd>
|
||||
|
||||
## What are the tweaks?
|
||||
### Tweaked tabs
|
||||
|
||||
- Tweaked **tab layout**!
|
||||
- My Books and My Notebooks are now "Books" and "Notes".
|
||||
- The Activity tab is now also visible as "Stats".
|
||||
- (Notes and Discover tabs are hidden by default, but can be re-enabled.)
|
||||
- Note: This is only available with the latest version of NickelMenu, which I included in the repository.
|
||||
> Less store, more of your books and stuff.
|
||||
|
||||
- My Books and My Notebooks are now **Books** and **Notes**.
|
||||
- The Activity tab is now also visible as **Stats**.
|
||||
- Notes and Discover tabs are **hidden** by default, but can be re-enabled.
|
||||
|
||||
### Custom menu items
|
||||
|
||||
> Power user stuff for typography lovers.
|
||||
|
||||
- **Screensaver**: Toggles the screensaver by moving the `.kobo/screensaver` folder. The repository comes with a nice moon screensaver, but you can add your own.
|
||||
- **Screenshots**: Toggles taking screenshots with the power button. After taking screenshots, take care to remember to turn this back off...
|
||||
- **Auto USB**: Toggles automatic USB connection. Helpful if you connect to your computer frequently, and don't want to keep approving the connection.
|
||||
- **Legibility Status**: Shows the current status of the legibility toggle.
|
||||
- **Legibility Toggle**: Toggles the experimental WebKit rendering feature, which enables rendering of ligatures. Since this causes issues w/ justified text rendering in `kepubs` this is a toggle. This will also briefly reboot your device!
|
||||
- **IP Address**: If connected to WiFi, displays your IP address.
|
||||
- **Invert & Reboot**: Inverts the colors of the entire display and reboots the device.
|
||||
- **Sleep**: Does the same as pressing the power button.
|
||||
- **Reboot**: Does the same as pressing the power button for a few seconds.
|
||||
|
||||
### Reader & menu
|
||||
|
||||
- In the reader menu, a **Dark Mode** toggle has also been added. You can press the ... (ellipsis menu) to see this option when reading. (You no longer need to dig into settings to toggle this!)
|
||||
- Added **customized fonts**.
|
||||
- Tweak tab with various options:
|
||||
- **Screensaver**: Toggles the screensaver by moving the `.kobo/screensaver` folder. The repository comes with a nice moon screensaver, but you can add your own.
|
||||
- **Screenshots**: Toggles taking screenshots with the power button. Take care to disable this timely or you may encounter issues w/ waking up the device.
|
||||
- **Auto USB**: Toggles automatic USB connection. Helpful if you connect to your computer frequently, and don't want to keep approving the connection.
|
||||
- **Toggle Legibility**: Toggles the experimental WebKit rendering feature, which enables rendering of ligatures. Since this causes issues w/ justified text rendering in `kepubs` this is a toggle. This will also briefly reboot your device!
|
||||
- **IP Address**: If connected to WiFi, displays your IP address.
|
||||
- **Invert & Reboot**: Inverts the colors of the entire display and reboots the device.
|
||||
- **Sleep**: Does the same as pressing the power button.
|
||||
- **Reboot**: Does the same as pressing the power button for a few seconds.
|
||||
- In the reader menu, a **Dark Mode** toggle has also been added. You can press the ... (ellipsis menu) to see this option when reading. You no longer need to dig into settings to toggle this!
|
||||
|
||||
## Installation Guide
|
||||
## Installing NickelMenu
|
||||
|
||||
### NickelMenu
|
||||
**NickelMenu must be installed for all of these changes to work correctly.**
|
||||
|
||||
First, install the latest version of [NickelMenu](https://pgaskin.net/NickelMenu/).
|
||||
First, install the latest version of [NickelMenu](https://pgaskin.net/NickelMenu/). Keep in mind that you will need at least version 0.6 of NickelMenu installed in order to have customized menu items.
|
||||
|
||||
You will need at least version 0.6 of NickelMenu installed in order to have customized menu items.
|
||||
To install NickelMenu, copy `.kobo/KoboRoot.tgz` to the `.kobo` folder on your Kobo, and let your e-reader reboot. (It should tell you that it's installing an update and reboot.)
|
||||
|
||||
To install NickelMenu, copy `.kobo/KoboRoot.tgz` to your device in the same folder and let your device reboot.
|
||||
## Quick Setup (Mac)
|
||||
|
||||
Once NickelMenu is installed, you can use the script I've added to the repository. Connect your Kobo to your Mac via USB, then run:
|
||||
|
||||
```sh
|
||||
./copy_mac.sh
|
||||
```
|
||||
|
||||
This will copy over `.adds`, `.kobo`, and `fonts` (if the fonts folder on the device is empty), clean up macOS resource fork files, optionally set `ExcludeSyncFolders` (for KOReader/Calibre users), and eject the device.
|
||||
|
||||
## Manual Setup
|
||||
|
||||
Before you begin, make sure to show hidden files and folders in your file manager, because the `.adds` and `.kobo` folders are hidden by default.
|
||||
|
||||
### Installing menu items
|
||||
|
||||
Copy the `.adds` directory to the root of your `KOBOeReader` volume. This is the configuration for NickelMenu.
|
||||
|
||||
### Fonts
|
||||
|
||||
Copy the `fonts` directory and any extra fonts you like over.
|
||||
|
||||
If you like what you're seeing, you can find [more fonts](https://github.com/nicoverbruggen/ebook-fonts/releases) in my other repository.
|
||||
|
||||
(I recommend getting the Kobo Core fonts, since this repository only includes a Kobo-optimized version of Readerly.)
|
||||
|
||||
### Screensaver
|
||||
|
||||
You can copy the screensaver from `.kobo/screensaver` into the same folder on your Kobo device. You can toggle this feature via the **Tweak** tab (the custom NickelMenu tab at the bottom of the home screen).
|
||||
|
||||
## Additional tweaks
|
||||
|
||||
### Separating Kobo and KOReader libraries
|
||||
|
||||
#### Ensuring this works
|
||||
|
||||
Ensure your Kobo doesn't scan certain directories! Important if you want to use KOReader.
|
||||
You tend to have the best experience if your Kobo doesn't scan certain directories! Important if you want to use KOReader or store other files that you don't want to appear in your library as "books".
|
||||
|
||||
To do this, add the following block to the `.kobo/Kobo/Kobo eReader.conf` file:
|
||||
|
||||
@@ -56,20 +90,38 @@ ExcludeSyncFolders=(calibre|\\.(?!kobo|adobe|calibre).+|([^.][^/]*/)+\\..+)
|
||||
|
||||
### KOReader
|
||||
|
||||
If you want an alternative reading experience, this is the way to go, and a great combinatio with Calibre.
|
||||
If you want an alternative reading experience, this is the way to go, and a great combination with Calibre.
|
||||
|
||||
Install the latest release of `KOReader`. You can [download it here](https://github.com/koreader/koreader/releases).
|
||||
|
||||
Follow the instructions carefully. **You will also need to add a new item to `.adds/nm/items` to launch KOReader via the Tweak menu!**
|
||||
|
||||
### Fonts
|
||||
### Custom patches
|
||||
|
||||
Copy the `fonts` directory and any extra fonts you like over.
|
||||
In my screenshot above, I've disabled the 3rd row on the homescreen. This is accomplished via a custom patch to the system software.
|
||||
|
||||
If you like what you're seeing, you can find [more fonts](https://github.com/nicoverbruggen/ebook-fonts/releases) in my other repository.
|
||||
You can usually find a `zip` with [patches on the MobileRead forums](https://www.mobileread.com/forums/forumdisplay.php?f=247). You can search for "Patches for Firmware" and then the version number of your firmware. (At the time of writing this, for example, [this](https://www.mobileread.com/forums/showthread.php?t=372436) is the latest thread for the Libra Color, Clara BW and Clara Color, but you **should always use patches for your Kobo's version number**.)
|
||||
|
||||
(I recommend getting the Kobo Core fonts, since this repository only includes a Kobo-optimized version of Readerly.)
|
||||
A few important notes:
|
||||
|
||||
### Screensaver
|
||||
- Unlike the other tweaks, I recommend double checking everything here. Keep reading why.
|
||||
- You must first note what operating system version you are using.
|
||||
- You can then download a copy of the software via [the `kobofirmware` page kindly set up by Patrick Gaskin](https://pgaskin.net/KoboStuff/kobofirmware.html).
|
||||
- **Make sure to download the correct version for your device, or you risk bricking your device!**
|
||||
- You can then apply patches via the patcher. For up-to-date instructions, use the `readme.txt` from the `zip` you got from MobileRead.
|
||||
- If you upgrade your system software (which may happen automatically) you will need to fetch the updated patches `zip` from MobileRead, and re-apply those patches again.
|
||||
|
||||
You can copy the screensaver from `.kobo/screensaver` into the same folder on your Kobo device. You can toggle this feature via the Tweak menu.
|
||||
If you're curious about what tweak I use... For example, the `kobopatch.yaml` config file can look like this:
|
||||
|
||||
```yaml
|
||||
overrides:
|
||||
src/nickel.yaml:
|
||||
Remove footer (row3) and increase cover size on new home screen: no
|
||||
Remove footer (row3) on new home screen: yes # <--- I changed this!
|
||||
```
|
||||
|
||||
To get the result in the screenshot above -- the removed third row, all it takes is modifying that single line and applying the patches.
|
||||
|
||||
After adjusting the overrides, you can copy the firmware file to `src` and run the script.
|
||||
|
||||
Again, please follow the up-to-date instructions in `readme.txt`. Once `KoboRoot.tgz` has been successfully generated, you can copy it to the `.kobo` folder on your device and those patches will be applied.
|
||||
77
copy_mac.sh
Executable file
77
copy_mac.sh
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script copies over all the files if you have a mounted Kobo connected to your Mac.
|
||||
#
|
||||
|
||||
DEST="/Volumes/KOBOeReader"
|
||||
|
||||
if [ ! -d "$DEST" ]; then
|
||||
echo "Error: $DEST is not mounted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rsync -av --exclude='.git' --exclude='.DS_Store' --exclude='._*' .adds/ "$DEST/.adds/"
|
||||
rsync -av --exclude='.git' --exclude='.DS_Store' --exclude='._*' .kobo/ "$DEST/.kobo/"
|
||||
if [ -d "$DEST/fonts" ] && [ -z "$(ls -A "$DEST/fonts")" ]; then
|
||||
rsync -av --exclude='.git' --exclude='.DS_Store' --exclude='._*' fonts/ "$DEST/fonts/"
|
||||
elif [ ! -d "$DEST/fonts" ]; then
|
||||
rsync -av --exclude='.git' --exclude='.DS_Store' --exclude='._*' fonts/ "$DEST/fonts/"
|
||||
else
|
||||
echo "Skipping fonts (folder is not empty)."
|
||||
fi
|
||||
|
||||
CONF="$DEST/.kobo/Kobo/Kobo eReader.conf"
|
||||
|
||||
# ExcludeSyncFolders controls which folders Kobo's library ignores.
|
||||
# Without it, books in the `calibre` folder will also show up in
|
||||
# your Kobo library. If you only read via Kobo's built-in reader,
|
||||
# that's fine. But if you use KOReader to read Calibre books, you
|
||||
# probably want to hide the `calibre` folder so you don't see
|
||||
# duplicate entries in Kobo's library.
|
||||
|
||||
EXCLUDE_WITH_CALIBRE='(calibre|\\.(?!kobo|adobe|calibre).+|([^.][^/]*/)+\\..+)'
|
||||
EXCLUDE_WITHOUT_CALIBRE='(\\.(?!kobo|adobe|calibre).+|([^.][^/]*/)+\\..+)'
|
||||
|
||||
if grep -q "^ExcludeSyncFolders=" "$CONF"; then
|
||||
echo "ExcludeSyncFolders is already set."
|
||||
else
|
||||
printf "Do you use KOReader or Calibre? Set ExcludeSyncFolders? [y/N] "
|
||||
read -r REPLY
|
||||
if [ "$REPLY" = "y" ] || [ "$REPLY" = "Y" ]; then
|
||||
echo ""
|
||||
echo "If you hide the calibre folder, books in it won't appear in"
|
||||
echo "Kobo's library. This is useful if you read them via KOReader."
|
||||
echo "If you prefer all books to show up in Kobo's library, say no."
|
||||
printf "Hide the calibre folder from Kobo's library? [y/N] "
|
||||
read -r REPLY2
|
||||
if [ "$REPLY2" = "y" ] || [ "$REPLY2" = "Y" ]; then
|
||||
EXCLUDE_VALUE="$EXCLUDE_WITH_CALIBRE"
|
||||
else
|
||||
EXCLUDE_VALUE="$EXCLUDE_WITHOUT_CALIBRE"
|
||||
fi
|
||||
if grep -q "^\[FeatureSettings\]" "$CONF"; then
|
||||
sed -i '' "/^\[FeatureSettings\]/a\\
|
||||
ExcludeSyncFolders=$EXCLUDE_VALUE
|
||||
" "$CONF"
|
||||
else
|
||||
printf '\n[FeatureSettings]\nExcludeSyncFolders=%s\n' "$EXCLUDE_VALUE" >> "$CONF"
|
||||
fi
|
||||
echo "ExcludeSyncFolders has been added."
|
||||
NEEDS_REBOOT=1
|
||||
else
|
||||
echo "Skipping ExcludeSyncFolders."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Removing resource fork files..."
|
||||
dot_clean "$DEST"
|
||||
|
||||
echo "Ejecting Kobo..."
|
||||
diskutil eject "$DEST"
|
||||
|
||||
echo ""
|
||||
echo "Done. Kobo has been ejected."
|
||||
if [ "$NEEDS_REBOOT" = "1" ]; then
|
||||
echo ""
|
||||
echo "IMPORTANT: ExcludeSyncFolders was added. Reboot your Kobo to apply this setting!"
|
||||
fi
|
||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 1006 KiB After Width: | Height: | Size: 735 KiB |
Reference in New Issue
Block a user