View Single Post
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:	776
Size:	78.2 KB
ID:	149750   Click image for larger version

Name:	screen_002.png
Views:	712
Size:	198.9 KB
ID:	149751  
Attached Files
File Type: zip KoboRoot-html2bash.zip (2.9 KB, 295 views)
pipcat is offline   Reply With Quote