Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-28-2016, 07:05 AM   #1
pipcat
Connoisseur
pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 200153
Join Date: Apr 2016
Device: Kobo Glo Hd
Running bash scripts from Kobo browser

This is a tool to run bash scripts from Kobo browser, without needing to connect to a computer.

Like khd-autopatch, script is trigered when device is connected to a usb-charger.

From Kobo browser we can write our commands to run, or load our custom scripts. With some internal javascript tricks, scripts are saved and we can plug usb-charger to force its run and see results.

See requirements and notes on readme.txt:
Spoiler:
Code:
html2bash
=========

Execute bash scripts from Kobo browser.


INSTALL:
--------

Download provided zip or create a KoboRoot.tgz with:
- /etc/udev/rules.d/99-html2bash.rules
- /usr/local/html2bash/check.sh
- /mnt/onboard/.html2bash/index.html, scripts

- Customize your own scripts editing index.html and scripts folder.
	- You can do that after install, connecting to a computer and going to /mnt/onboard/.html2bash/
	- Copy your own scripts to folder.
	- Edit index.html to modify array BASH_FILES to include your scripts.


USAGE:
------

- Open Kobo browser and go to file:///mnt/onboard/.html2bash/index.html
- Select a script or write your own.
- Press Save file and when download is done, plug Kobo device to usb-charger.
	
- To uninstall:
	- Create an empty html2bash.uninstall in root folder and plug device to usb-charger.


REQUIREMENTS:
-------------

- You need hacks "Allow download all in Browser" and "Allow launching browser without wifi connected".

- You need a usb-charger that doesn't prompt as a computer when plugged. Probably your mobile phone charger is ok.


INFO:
-----

https://github.com/pipcat/kobo/tree/master/html2bash

- Launching html2bash:

Check script is launched when we plug our device to a usb-charger, but not when we plug to a computer.
I tested with a powercube 2A and a Motorola mobile charger .85A, and works nice. But some people reported different benhaviour and when they plug to usb-charger they get prompted as if connected to a computer. In this case, this method is not valid because autopatch will not be trigered, but maybe could be done similar hooking on "usb_host" rather than "usb_plug".


Samples scripts do nothing special, and are just to test, but other things could be done... ;-) For example, a script that sed Kobo eReader.conf to switch true/false on [FeatureSettings] Screenshots option, ...

Note: Only tested on Glo Hd fw 3.19.5761. Should work on other devices/fws but maybe there are differences in browser, i don't know.
Attached Thumbnails
Click image for larger version

Name:	screen_001.png
Views:	770
Size:	78.2 KB
ID:	149750   Click image for larger version

Name:	screen_002.png
Views:	705
Size:	198.9 KB
ID:	149751  
Attached Files
File Type: zip KoboRoot-html2bash.zip (2.9 KB, 294 views)
pipcat is offline   Reply With Quote
Old 06-29-2016, 05:41 AM   #2
pipcat
Connoisseur
pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 200153
Join Date: Apr 2016
Device: Kobo Glo Hd
It's a pity, but Kobo browser is not very much reliable ;-(
Sometimes scripts are downloaded ok and everything goes well, but sometimes there are empty downloads (0 bytes file). Sometimes browser is closed after download, sometimes not. I didn't found the reason...

Sample short scripts are downloaded ok (but not always i though) but it seems with longer scripts there are more failed downloads. For example with this script screenshots-off.sh:
Spoiler:
Code:
#!/bin/sh

# Change Screenshots=true/false in [FeatureSettings] for Kobo eReader.conf

KOBO_CONF="/mnt/onboard/.kobo/Kobo/Kobo eReader.conf"

sed 's/^Screenshots=true$/Screenshots=false/g' <"$KOBO_CONF" >"$KOBO_CONF".tmp && mv "$KOBO_CONF".tmp "$KOBO_CONF"
pipcat is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Glo Running browser without Wifi connection a3nm Kobo Developer's Corner 18 10-21-2015 02:06 PM
silk browser running on kobo vox mr_nobody Kobo Tablets 4 01-06-2012 11:37 PM
The Idiot's Guide to running Igorsk's Python Scripts Nate the great Workshop 9 05-22-2010 12:17 PM
Problem running scripts from ContentLister Fellball iRex 1 03-13-2009 08:16 PM
manga2pdf - Linux bash scripts for the Cybook, Sony Reader and iLiad IceHand PDF 52 03-09-2009 06:36 PM


All times are GMT -4. The time now is 09:31 AM.


MobileRead.com is a privately owned, operated and funded community.