Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-05-2013, 04:53 PM   #1
peterhey
Member
peterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the husk
 
Posts: 21
Karma: 141126
Join Date: Dec 2013
Device: touch
Switching between opened applications.

Hi.
Is any simple method to switch between applications, which are in background?
I know how to create a script to manage a "Home button". It checks if some of defined applications are running, adds them to the carousel, shows running apps and chooses app which we want on foreground. Somewhat like alt+tab in many OS. If none of defined apps are running, "Home" acts generally. However I don't know how to put app on foreground. I suppose there are some system events but which? Or is it at all possible?

Thanks in advance.
peterhey is offline   Reply With Quote
Old 12-05-2013, 05:00 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Hmm, wrong forum?

You mentioned a carousel, which sounds suspiciously like a Kindle Fire thing... .

(We only deal with the eInk models here, you want the Fire subforum for the tablets ).
NiLuJe is offline   Reply With Quote
Advert
Old 12-05-2013, 05:11 PM   #3
peterhey
Member
peterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the husk
 
Posts: 21
Karma: 141126
Join Date: Dec 2013
Device: touch
Quote:
Originally Posted by NiLuJe View Post
Hmm, wrong forum?

You mentioned a carousel, which sounds suspiciously like a Kindle Fire thing... .

(We only deal with the eInk models here, you want the Fire subforum for the tablets ).
K5 Touch.
I'll write carousel, but I don't know how to put on foreground some app.
peterhey is offline   Reply With Quote
Old 12-05-2013, 05:55 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
What do you mean by 'apps'?
NiLuJe is offline   Reply With Quote
Old 12-05-2013, 06:32 PM   #5
peterhey
Member
peterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the husk
 
Posts: 21
Karma: 141126
Join Date: Dec 2013
Device: touch
Midori, kterm, dictionary.mobi (booklet, reader or wua), leafpad - this mainly - and other defined by name in conf file by user.

Last edited by peterhey; 12-05-2013 at 06:36 PM.
peterhey is offline   Reply With Quote
Advert
Old 12-05-2013, 07:51 PM   #6
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
You could make a javascript/html thing to switch between running apps. Don't know if there are better ways, but you could use xdotool from twobob to simply hide/show apps windows:

Download link

Usage samples

For a custom dialog sample, quite similar to the one you are going to make, give a glance to KindleTask app in Kindle Menu package (even if it only allows to terminates/kills process, not to switch between them).

This is what you should do in my opinion, step by step:
- make a list of the executables you want to be shown in your switcher
- check which ones are currently running (with "ls" command, for example)
- build a custom dialog (html page) with a link for each of them
- associate to each link an onclick event, that through nativeBridge maximizes/minimizes the corresponding window, using xdotool
- launch the custom dialog

Ah, as you can see, the app switcher thingy was already between Kindle Menu TODOs... even if I didn't make it yet because I don't find it so necessary, to me at least.

Last edited by Aeris; 12-05-2013 at 08:06 PM.
Aeris is offline   Reply With Quote
Old 12-06-2013, 03:34 AM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Do remember that the device has almost no free RAM for fun stuff, so backgrounding multiple stuff isn't really a great idea/actually feasible. It's already giving us nightmares for getting a single modest application to run, so if you want to multitask on top of that, brrr!

Last edited by NiLuJe; 12-06-2013 at 03:45 AM.
NiLuJe is offline   Reply With Quote
Old 12-06-2013, 04:21 AM   #8
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
But setting up a swap file is easy, and even a small one makes a big difference.
Multiple examples given in twobob's posts.

Some of the applications he has ported are so big, that they **require** a swap file running to just run a single instance of the application.

And he and Aires had a discussion of the subject in a recent thread.
knc1 is offline   Reply With Quote
Old 12-06-2013, 05:48 AM   #9
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
Yes, anyway I still agree with Niluje that take care also of multitasking would be quite annoying... and, above all, pretty useless in my opinion (for the app bundle currently available).

But, if peterhey needs it and wants to play with it, it is totally doable as I suggested
Aeris is offline   Reply With Quote
Old 12-06-2013, 07:16 AM   #10
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
I doubt that. They do not necessarily have means to share resources yet and are not prepared for being preempted. Without at least some modification, I would consider such an approach as being pretty futile.
hawhill is offline   Reply With Quote
Old 12-06-2013, 08:06 AM   #11
peterhey
Member
peterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the husk
 
Posts: 21
Karma: 141126
Join Date: Dec 2013
Device: touch
Works fine with midori, kterm, leafpad.

Two things makes it useless for me:

1. Some apps are in background. During start off dictionary.mobi the device stops and no response. The "/usr/bin/wua -l com.lab126.acxwua -s com.lab126.acxManager" (*.mobi) starts only after I close through ssh all apps in background.

2. Ctrl+c crtl+v doesn't work between apps. No clipboard on OS. I would have to additionally create something similar but I've no idea how without interference in apps.

Maybe I'll use this information in a different way. For something usable.
Thanks.
peterhey is offline   Reply With Quote
Old 12-06-2013, 11:47 AM   #12
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
Oh, i didn't see that this is just about X applications. i think awesome WM is standards compatible and should support EMWH. And may be itself configurable enough using Lua to implement everything that's needed.
hawhill is offline   Reply With Quote
Old 01-07-2014, 01:47 PM   #13
peterhey
Member
peterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the husk
 
Posts: 21
Karma: 141126
Join Date: Dec 2013
Device: touch
Instead of xdotool I used gestures engine.
Related to https://www.mobileread.com/forums/sho...d.php?t=166080

Two files.
"./gesturetail" file to run
"gesture" defines which applications you want to run

The combination of ctrl+c, ctrl+v also works between some apps.
Attached Thumbnails
Click image for larger version

Name:	screenshot_2014-01-07T18_51_02-0100.gif
Views:	232
Size:	49.7 KB
ID:	117680   Click image for larger version

Name:	screenshot_2014-01-07T18_51_17-0100.gif
Views:	217
Size:	43.4 KB
ID:	117681   Click image for larger version

Name:	screenshot_2014-01-07T18_51_34-0100.gif
Views:	254
Size:	49.0 KB
ID:	117682  
Attached Files
File Type: zip gesture.zip (843 Bytes, 161 views)
peterhey is offline   Reply With Quote
Old 01-28-2014, 05:47 AM   #14
peterhey
Member
peterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the husk
 
Posts: 21
Karma: 141126
Join Date: Dec 2013
Device: touch
It's simple switcher. I use it with gesture engine and it's what I need. It operates with applications on the application layer, omitting some excluded. To fine finish, it needs some instructions for "home button" in "rc.lua" file. Thanks for your tips.

switcher:
Code:
#!/bin/sh

list=`/mnt/us/bin/wmctrl -l | grep L:A_N: |  grep -v blankBackground | grep -v titleBar | grep -v lab126.booklet.home | awk '{print $4" "$1}'`
hm=`echo $list | awk 'BEGIN {i=0} {while ($i!="") i++} END {print (i-1)/2}'`

if [ $hm -gt 1 ]; then
	WHICHAPP=`cat /tmp/WHICHAPP`
	if [ "$WHICHAPP" == "" ]; then WHICHAPP=1 ; fi

	if [ "$1" == "next" ]; then 
		if [ $WHICHAPP -lt $hm ]; then WHICHAPP=$((WHICHAPP+1))
		else WHICHAPP=1
		fi
	fi
	if [ "$1" == "prev" ]; then 
		if [ $WHICHAPP -gt 1 ]; then WHICHAPP=$((WHICHAPP-1))
		else WHICHAPP=$hm
		fi
	fi
	idapp=`echo $list | awk -v i=$WHICHAPP 'BEGIN {i=i*2} {print $i}'`
	layerA=`echo $list | awk -v i=$WHICHAPP 'BEGIN {i=i*2-1} {print $i}'`
	layerD=`echo $layerA | awk 'BEGIN {i=3; printf "L:D_N" ; } FS=":" {while ($i!="") { printf ":"$i ;i++ ;}}'`
	/mnt/us/bin/xdotool set_window --name $layerD $idapp
	/mnt/us/bin/xdotool set_window --name $layerA $idapp
fi
#export $WHICHAPP
echo $WHICHAPP > /tmp/WHICHAPP
gesture:
Code:
case "$run" in

...
	# -  pinch + left
	3)
	$ext/gestures/bin/switcher next &;;
	
	# -  pinch + right
	4)
	$ext/gestures/bin/switcher prev &;;

...

Last edited by peterhey; 01-28-2014 at 06:07 AM.
peterhey is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not all opened books are being read Wyndham Marvin 4 09-27-2013 05:24 AM
Just opened up my IQ! TallMomof2 PocketBook 22 11-25-2010 09:06 PM
2 windows opened? rcuadro Sigil 3 12-18-2009 08:03 PM
PocketBook US site opened... :) brecklundin PocketBook 4 10-02-2009 01:42 AM


All times are GMT -4. The time now is 10:24 PM.


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