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 02-05-2022, 02:50 AM   #211
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Quote:
Originally Posted by poczynek View Post
I have factory reset my Forma and i just cannot uninstall Autoshelf Beta. I have also put the dot folder in the main directory of Kobo but it still comes up when i am plugged into a computer. How can i permanently uninstall?
Code:
To uninstall, set uninstall=1 in the config file, then run AutoShelf one more time.
Semwize is offline   Reply With Quote
Old 02-05-2022, 02:52 AM   #212
poczynek
Zealot
poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.poczynek is not intimidated by interfenestral monkeys.
 
Posts: 114
Karma: 26552
Join Date: Jan 2017
Device: Kobo Forma
Quote:
Originally Posted by Semwize View Post
Code:
To uninstall, set uninstall=1 in the config file, then run AutoShelf one more time.
Yes but i have no config file or anything even suggesting AutoShelf is even on my kobo.
poczynek is offline   Reply With Quote
Old 02-05-2022, 03:06 AM   #213
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Quote:
Originally Posted by poczynek View Post
Yes but i have no config file or anything even suggesting AutoShelf is even on my kobo.
Try to create it: create .addons\autoshelf folders and put the autoshelf.cfg file with this content in it.
Semwize is offline   Reply With Quote
Old 04-19-2022, 02:37 AM   #214
YYHHYYHH
Junior Member
YYHHYYHH began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2018
Device: KA1
Quote:
Originally Posted by vdanjean View Post
Hi,
fbink from https://www.mobileread.com/forums/sh...d.php?t=299110 is not recent enough for Kobo Sage. But recompiling it from github sources works ;-) You can see my messages at the end of the just cited thread.

I've been hit by another problem with AutoShelf. To detect user action, it monitors /dev/input/event1. But, on Kobo Sage, this is not (always?) the good file.
I wrote a patch to detect the good eventX file based on /proc/bus/input/devices.
To be fully correct, we must know the name of the touch screen. I put the one I know in the script (ie for Kobo Sage and Kobo Forma).
If nothing is found, it failback to /dev/input/event1 as before but also generate a file in /mnt/onboard/AutoShelf-bugreport.txt (with the contents of /proc/bus/input/devices) so that my patch can be improved.

I put my patch below, feel free to use it as you want.

I can also give you the full updated KoboRoot.tgz if you wish to quickly update the package.

Regards,

Code:
diff --git a/usr/local/AutoShelf/autoshelf.sh b/usr/local/AutoShelf/autoshelf.sh
index 8f09d7a..7a433a6 100755
--- a/usr/local/AutoShelf/autoshelf.sh
+++ b/usr/local/AutoShelf/autoshelf.sh
@@ -15,6 +15,77 @@ config() {
     [ "$value" != "" ] && echo "$value" || echo "$2"
 }
 
+#
+# touchscreen input file
+#
+TS_GUESS=
+ts_input() {
+    local l
+    local FOUND=
+    local CANDIDATE=/dev/input/event1
+    local EVENT
+    local tempdir="$(mktemp -d)"
+    mkfifo "$tempdir/fifo"
+    cat /proc/bus/input/devices > "$tempdir/fifo" &
+    while read l; do
+	case "$l" in
+        'N: Name="cyttsp5_mt"') FOUND=1;;
+	'N: Name="Elan Touchscreen"') FOUND=1;;
+	'N: Name='*[Tt]ouch[Ss]creen*) FOUND=2;;
+        'H: Handlers='*) EVENT="$(echo "$l" | sed -e 's/.*\(event[0-9]\+\).*/\1/')" ;;
+	'')
+	    case "$FOUND" in
+	    1)
+		echo /dev/input/"$EVENT"
+		rm -rf "$tempdir"
+		return ;;
+	    2)
+		CANDIDATE="/dev/input/$EVENT"
+		;;
+	    esac
+	    FOUND= ;;
+        *) ;;
+	esac
+    done < "$tempdir/fifo"
+    rm -rf "$tempdir"
+    TS_GUESS=1
+    echo "CANDIDATE=$CANDIDATE"
+}
+
+ts_warn() {
+    if [ "$TS_GUESS" != 1 ]; then
+	return
+    fi
+
+    for i in $(seq 1 60)
+    do
+        if [ -e /mnt/onboard/.kobo/KoboReader.sqlite ]
+        then
+            break
+        fi
+
+        sleep 1
+	break
+    done
+
+    if [ ! -e /mnt/onboard/.kobo/KoboReader.sqlite ]; then
+	: return
+    fi
+
+cat > /mnt/onboard/AutoShelf-bugreport.txt <<EOF
+The touchscreen have not been exactly detected.
+To improve AutoShelf, please send the following information to the developpers:
+
+Input devices on the machine:
+$(cat /proc/bus/input/devices)
+
+Machine version:
+$(cat /mnt/onboard/.kobo/version)
+$(uname -a)
+
+EOF
+}
+
 # database escapes
 escape() {
     echo -n "${1//"'"/"''"}"
@@ -241,7 +312,8 @@ then
     grep /mnt/onboard /proc/mounts && exit
     fbink -g file="/usr/local/AutoShelf/autoshelf-off.png"
 
-    while cat /dev/input/event1 | dd bs=1 count=1
+    TS_INPUT="$(ts_input)"
+    while cat "$TS_INPUT" | dd bs=1 count=1
     do
         grep /mnt/onboard /proc/mounts && exit
 
@@ -267,6 +339,7 @@ then
     exit
 elif [ ! -e /tmp/autoshelf-on ]
 then
+    ts_warn
     # disabled mode
     exit
 fi
@@ -285,6 +358,8 @@ do
     sleep 1
 done
 
+ts_warn
+
 if [ -e /mnt/onboard/.kobo/KoboReader.sqlite ]
 then
     cfg_logfile="$BASE"/$(config logfile '')
could you release one for sage users, like me, thanks a lot~~~
YYHHYYHH is offline   Reply With Quote
Old 07-21-2022, 10:07 PM   #215
ajkessel
Connoisseur
ajkessel began at the beginning.
 
Posts: 58
Karma: 10
Join Date: Jul 2017
Device: Kindle Paperwhite 3rd Generation
Is there any way to force an autoshelf other than on disconnect? I use kobocloud to sync Google Drive to my device and would like new items that come in that way to be shelved separately. Under the current implementation, is the only way to do that to connect and disconnect the device from a PC? Could there be a workaround with NickelMenu?
ajkessel is offline   Reply With Quote
Old 07-21-2022, 10:27 PM   #216
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by ajkessel View Post
Is there any way to force an autoshelf other than on disconnect? I use kobocloud to sync Google Drive to my device and would like new items that come in that way to be shelved separately. Under the current implementation, is the only way to do that to connect and disconnect the device from a PC? Could there be a workaround with NickelMenu?
There is a way in NickelMenu to trigger the code run when the device is disconnected from the USB. You should be able to find it in the NickelMenu thread.
davidfor is offline   Reply With Quote
Old 07-22-2022, 01:19 PM   #217
ajkessel
Connoisseur
ajkessel began at the beginning.
 
Posts: 58
Karma: 10
Join Date: Jul 2017
Device: Kindle Paperwhite 3rd Generation
Quote:
Originally Posted by davidfor View Post
There is a way in NickelMenu to trigger the code run when the device is disconnected from the USB. You should be able to find it in the NickelMenu thread.
I've tried :rescan_books_full: and :force_usb_connection: and neither seems to trigger autoshelf. Is there something I'm missing? I'll also post a query on the NickelMenu thread.

I note that NM also has the ability to execute commands directly via cmd_spawn -- is there some way this could be used to hook into autoshelf's reindex action?

Last edited by ajkessel; 07-22-2022 at 01:26 PM.
ajkessel is offline   Reply With Quote
Old 07-22-2022, 02:41 PM   #218
ajkessel
Connoisseur
ajkessel began at the beginning.
 
Posts: 58
Karma: 10
Join Date: Jul 2017
Device: Kindle Paperwhite 3rd Generation
Executing /usr/local/AutoShelf/autoshelf.sh does not seem to trigger a reindex, but the following does:
Quote:
echo usb plug add >>/tmp/nickel-hardware-status
sleep 12
echo usb plug remove >>/tmp/nickel-hardware-status
Is there any way to reindex without actually triggering the USB actions?
ajkessel is offline   Reply With Quote
Old 07-22-2022, 04:47 PM   #219
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by ajkessel View Post
Executing /usr/local/AutoShelf/autoshelf.sh does not seem to trigger a reindex, but the following does:

Is there any way to reindex without actually triggering the USB actions?
This is the code I use

Code:
menu_item :main :Import books       :nickel_misc        :rescan_books_full
JSWolf is offline   Reply With Quote
Old 07-22-2022, 04:53 PM   #220
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
delete post
JSWolf is offline   Reply With Quote
Old 06-03-2023, 08:20 PM   #221
glenk
Enthusiast
glenk doesn't litterglenk doesn't litter
 
Posts: 31
Karma: 166
Join Date: Mar 2016
Device: Kobo
Hi

I am interested in using this, is it still being worked on and does it work with the lastest firmware?

Regards Glen
glenk is offline   Reply With Quote
Old 10-16-2023, 01:53 PM   #222
had
Member
had began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2015
Device: kobo aura hd, aura h20, elipsa 2e
It seems to work on the latest firmware, but it definitely has some issues with the latest devices (for example the Sage and the Elipsa 2e)

vdanjean has noticed that the newer devices need an updated fbink and updated udev rules and has put patches on github.

Last edited by had; 10-16-2023 at 03:57 PM.
had is offline   Reply With Quote
Old 10-16-2023, 02:02 PM   #223
had
Member
had began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2015
Device: kobo aura hd, aura h20, elipsa 2e
Thanks for your patches.

I decided to just rip out the broken fbink and udev functionality from the script, as I want to trigger it from nickelmenu anyway. But I found it would always complain about the database being locked, unless I wrapped my script:

Code:
echo usb plug add >> /tmp/nickel-hardware-status ; my-autoshelf.sh ; echo usb plug remove >> /tmp/nickel-hardware-status
Is there someway to unlock the database without resorting to that USB plug simulation?



Quote:
Originally Posted by vdanjean View Post
Hi,
fbink from https://www.mobileread.com/forums/sh...d.php?t=299110 is not recent enough for Kobo Sage. But recompiling it from github sources works ;-) You can see my messages at the end of the just cited thread.

I've been hit by another problem with AutoShelf. To detect user action, it monitors /dev/input/event1. But, on Kobo Sage, this is not (always?) the good file.
I wrote a patch to detect the good eventX file based on /proc/bus/input/devices.
To be fully correct, we must know the name of the touch screen. I put the one I know in the script (ie for Kobo Sage and Kobo Forma).
If nothing is found, it failback to /dev/input/event1 as before but also generate a file in /mnt/onboard/AutoShelf-bugreport.txt (with the contents of /proc/bus/input/devices) so that my patch can be improved.
had is offline   Reply With Quote
Old 12-28-2023, 09:37 AM   #224
mangonerd
Junior Member
mangonerd began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2023
Device: Kobo Sage
Still struggling to make it work in my Kobo Sage. Could you please share your full script and nickelmenu entry? Thanks!


Quote:
Originally Posted by had View Post
Thanks for your patches.

I decided to just rip out the broken fbink and udev functionality from the script, as I want to trigger it from nickelmenu anyway. But I found it would always complain about the database being locked, unless I wrapped my script:

Code:
echo usb plug add >> /tmp/nickel-hardware-status ; my-autoshelf.sh ; echo usb plug remove >> /tmp/nickel-hardware-status
Is there someway to unlock the database without resorting to that USB plug simulation?
mangonerd is offline   Reply With Quote
Old 12-28-2023, 11:15 AM   #225
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by mangonerd View Post
Still struggling to make it work in my Kobo Sage. Could you please share your full script and nickelmenu entry? Thanks!
IMHO, it's a lot easier to use Calibre to side load.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Beta for BB? FF2 Amazon Kindle 2 05-28-2011 10:21 AM
Development Signing up for the beta glen enTourage Archive 16 04-06-2011 04:33 PM
Beta Beta Test of Major New Features Starson17 Calibre 45 05-17-2010 10:55 AM
0.6 out of beta? Nate the great Calibre 3 07-17-2009 02:45 AM


All times are GMT -4. The time now is 11:21 PM.


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