maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   [ANN] Cyclotron - CLI tools to cycle between app windows (https://talk.maemo.org/showthread.php?t=88203)

thp 2012-12-11 10:39

[ANN] Cyclotron - CLI tools to cycle between app windows
 
This is in very early stages, and no GUI is provided (only CLI tools). Source code for enumerating and switching between windows is provided (it's just Xlib + EWHM stuff). Hope this can be put to good use:

http://thp.io/2012/cyclotron/

Ideally we'd integrate this into the mcompositor swipeplugin and make it so that swiping left/right would switch between running apps, just like on webOS and BB Playbook OS. But the swipeplugin is closed source, and reimplementing it from scratch just to add this feature is not something I want to do ;)

thedead1440 2012-12-11 10:43

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Just 10 minutes ago I was trying this out and wondering why no Announce thread and its here :D

It works nice and seamlessly with the volume buttons; MyMoves takes that bit longer to register making it not as seamless...

Only downside of using volume buttons is not being able to use it to control music player's volume but those buttons are useful mainly when the screen is locked on-the-go during which time switcher can be killed :D

veeall 2012-12-11 13:24

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
I'm no programmer, thats why i cannot contribute, but i tried the switcher app and while it worked, it is too sensitive and it flips through open apps like mad if i accidentally hold down volume button too long. Can this be done so that key release switches an app?

Also can homescreen be excluded from swither?

I realise it is your free time and will to implement this. But maybe you'll want to make an purchasable app later? I personally think it would be nice addition to n9.

edit: Or i could add 'next' and 'previous' buttons to quicklaunch running a cycle app, that would be nice too, i'm not using quick launch too often anyway. Just a thought.

ThraxZzz 2012-12-11 14:32

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Good Job thp! :) Keep it up :) hope to have it more like 'permanent' as in,i can close the terminal and it still works...

thedead1440 2012-12-11 14:34

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by ThraxZzz (Post 1303500)
Good Job thp! :) Keep it up :) hope to have it more like 'permanent' as in,i can close the terminal and it still works...

Create start and stop icons on homescreen then ;)

The process runs in a not-intrusive manner...

ThraxZzz 2012-12-11 15:20

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Im no developer :P

thedead1440 2012-12-11 15:26

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by ThraxZzz (Post 1303517)
Im no developer :P

Take any .desktop file for any app from /usr/share/applications/ see how its done; what you need to change is the Exec= field to either /opt/cyclotron/bin/switcher or /opt/cyclotron/bin/cycle depending on your preference; i chose the former...

For the stop change the Exec= to killall switcher and done ;)

Of course once you read sample .desktop files you can see how to change the name, icon etc and you are set :)

See, no developer knowledge required ;)


Edit: When i mean take any .desktop file, take an application's .desktop and use cp -R to make another copy in the same directory and use your favourite text editor like nano, vi etc to do the changes... Of course you could the above using sed in one-line if you are comfortable with it; its all upto your personal preferences :D

ThraxZzz 2012-12-11 15:41

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Hmmm,so,i will need two icons? One for kill,one for it to activate? :)

thedead1440 2012-12-11 15:42

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by ThraxZzz (Post 1303527)
Hmmm,so,i will need two icons? One for kill,one for it to activate? :)

I have two so i can activate and kill on demand; you choose what you want...You can always open terminal and type killall switcher to kill too if you don't intend to use the kill icon much...

Of course that is if you intend to use Volume Buttons; you can make icons with /opt/cyclotron/bin/cycle which you can link as an application to launch in MyMoves too which won't require killing...

As thp says on his page, use your imagination; i tried the volume buttons and MyMoves and prefer to stick to volume buttons...Of course you can use quicklaunch bar for it or think of something else too :)

ThraxZzz 2012-12-11 15:57

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
OMG! it works ! Thanks thedead1440! :) really glad to have you in this forum,also,thanks thp for this :)

Cheers!

qwazix 2012-12-11 16:00

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
you can run it with nohup in front, it should stay running after you close the terminal.

Edit: Silly idea, activate it when the proximity sensor is closed and the phone tilts, so that closing the proximity sensor and tilting left cycles left etc...

mousse04 2012-12-11 16:29

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by ThraxZzz (Post 1303533)
OMG! it works ! Thanks thedead1440! :) really glad to have you in this forum,also,thanks thp for this :)

Cheers!

thedead is the best ;)

thedead1440 2012-12-12 08:38

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
I deleted my earlier post as thanks to brkn i've managed to add the Dbus calls!

Also he has helped me to make the script cleaner.

As before Exec=/bin/sh /home/user/cyclotron.sh allows 1 icon to toggle between killing/starting the switcher as well as printing in banner whether it is started/stopped

Contents of /home/user/cyclotron.sh (note icon take from project page; if you don't want the icon just replace the "path/to/icon/" string with '') :
Code:

#!/bin/sh

SERVICE="/opt/cyclotron/bin/switcher"

if ps -ae | grep -v grep | grep "$SERVICE" > /dev/null
then
        kill `pgrep -f "$SERVICE"`
        dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"Cyclotron stopped" string:'' string:"/usr/share/icons/hicolor/80x80/apps/cyclotron.png" uint32:0
else
        "$SERVICE" &
        dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"Cyclotron started" string:'' string:"/usr/share/icons/hicolor/80x80/apps/cyclotron.png" uint32:0

fi


The last optional stage if needed would be to make it a toggle like Piratebox which shows the status although I'm not very sure about implementing a toggled icon like Piratebox due to speed issues...


I understand the above may be very basic for most so please ignore it; I'm just sharing what I managed for my set-up ;)


N.B. The above has been edited to point everything to cyclotron instead of generic names like switcher or cycle as well as an icon has been added which can be gotten from the project page. Screenshots for the above can be viewed here and here...

Kabouik 2012-12-12 09:29

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by thedead1440 (Post 1303707)
I understand the above may be very basic for most so please ignore it; I'm just sharing what I managed for my set-up ;)

I wouldn't be that sure. There are many people here who don't post often because they're just users and not devs, but they like when "basic" stuff like that is provided. Some of them talk often though they don't know anything, like me. :o

Thanks.

zaidk9 2012-12-13 04:25

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
how to use it
installed but nothing happened

bibek 2012-12-13 07:19

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
For the lazy guys like me, I created few desktop files and a png icon.
After you install the cyclotron deb file, copy the .desktop files to /usr/share/applications

and copy the icon to usr/share/icons/hicolor/80x80 (optional)

you'll have four icons for starting, killing swutcher, previous window, and next window.
you can link these to myMoves to have a swipey ui switching running :)

http://dl.dropbox.com/u/30937627/Cyclotron.rar

qwazix 2012-12-13 20:46

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Systemui is still opensource so it is possible (if somebody wants to hack it) to implement swipe on the statusbar (a bit hard to hit though) to switch between windows.

coderus 2012-12-13 21:05

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
then it will be only next window switch...

bnwg 2012-12-14 13:36

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Thxk. This is awesome.
I use this by ProfileMatic with custom action. Now I can switch between apps when the device is awake and disable it when it's idle.

veeall 2012-12-14 15:50

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Does the new version of this program only flips one app per keypress or continously (when clicking and holding volume button down) like the first version did? I'd prefer the second behaviour to be disabled, no use for it at all, it just gets in the way too often. Please share an info if it can be disabled.

thedead1440 2012-12-14 15:53

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by veeall (Post 1304518)
Does the new version of this program only flips one app per keypress or continously (when clicking and holding volume button down) like the first version did? I'd prefer the second behaviour to be disabled, no use for it at all, it just gets in the way too often. Please share an info if it can be disabled.

There is a new version? :confused:

veeall 2012-12-14 21:40

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
I thought for now there should already be a new version out. Sorry, i like the app, but i keep accidentally flippin' over multiple appwindows at once. Also, home screen is on the list of running apps but lacks nice animation when switched to, this seems halfly done, and while you can get to homescreen by swiping there's no need for it to appear in apps switcher.

thp 2012-12-15 13:19

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by veeall (Post 1304650)
I thought for now there should already be a new version out. Sorry, i like the app, but i keep accidentally flippin' over multiple appwindows at once. Also, home screen is on the list of running apps but lacks nice animation when switched to, this seems halfly done, and while you can get to homescreen by swiping there's no need for it to appear in apps switcher.

There's no new version out. Rate-limiting could be done, but right now I can't distinguish between "user keeps the button pressed" and "user presses the button rapidly". And in the second case, it could be annoying if the user wants to switch between apps quickly.

The "nice animation" is something that's totally dependent on the window manager (mcompositor / swipeplugin), I didn't do anything there.

As far as excluding the home screen view from the application switching goes, this could be implemented (to exclude it from the list), but I thought it was kind of nice to have it in there. I'll think about maybe removing it in a future version - but first, I think I'll have a look at systemui (thanks qwazix for the great idea!). Swiping left/right on the statusbar seems doable, I'd just need to figure out where the input handling for that is (help here is welcome of course).

thp 2012-12-15 18:17

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
WIP status bar interaction: http://www.youtube.com/watch?v=ARs3wABmXZA

Works great so far, but needs openmode (just copy over a replacement libmeegotouchviews) or inception (would also require either rebuilding libmeegotouch packages or re-packaging the existing .deb with a new libmeegotouchviews). Also a little problematic - if you swipe down without hitting the status bar, you would close the app. Swiping left/right and staying on the status bar also works (and avoids accidental closing), but does open the status bar menu sometimes for some reason (still have to investigate). Also QML apps not working right now (probably needs qt-components changes).

optimaxxx 2012-12-15 19:14

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Could this be integrated with swipe manager?

thp 2012-12-15 19:19

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by optimaxxx (Post 1304855)
Could this be integrated with swipe manager?

No, because swipe manager only sets some configuration options of the closed source swipeplugin (that's mentioned in the original post of this thread). I'd love to have it integrated directly into the window manager, but we can't do that (in a clean way) without the source.

qwazix 2012-12-15 19:27

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Maybe ditching the swipe plugin altogether and using the one from nemo?

thp 2012-12-16 14:56

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Status Bar Integration ready for a first round of brave testers.

Patches and build instructions: http://thp.io/2012/cyclotron/
Binaries and installation instructions: http://o.thp.io/tmp/cyclotron-statusbar/
Updated video: http://youtu.be/_Nxdeza6X84

Feedback welcome. Read the instructions carefully. Make backups. Be prepared to reflash. Enjoy!

thedead1440 2012-12-16 15:15

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
The latest version works very nicely :)

Thanks thp!

Noticed that this version doesn't base itself on cyclotron itself but on the qt-components and libmeegotouchviews patched files so does this mean the ability to enable/disable on-demand is lost permanently?


Edit: Just noticed a side-advantage (?) that if the screen is locked and a notification arrives, even after a minute or two unlocking the screen still shows the notification in the status bar...


Edit 2: Usually when clicking the status bar to open it, there is no sound but during closing it there is a click sound... This persists but what I wish to request for a consistent experience is that while switching between apps this sound doesn't occur; currently, it alternates i.e. one swipe comes without any sound and the second swipe has the sound...


Edit 3: Also is it deliberate that when swiping right, the home-screen is excluded from the carousel but swiping left includes the home-screen too? Didn't find this in the project page but then again I may have been blinded by my excitement to try the new implementation :D

evujumenuk 2012-12-16 16:06

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Looks almost flawless, except that windows always slide in from the left. :)

ThraxZzz 2012-12-16 16:08

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Works great! Thanks thp :)

thp 2012-12-16 16:34

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by thedead1440 (Post 1305090)
Noticed that this version doesn't base itself on cyclotron itself but on the qt-components and libmeegotouchviews patched files so does this mean the ability to enable/disable on-demand is lost permanently?

You can disable it by uninstalling (or renaming) the cyclotron package (or binaries in /opt). Of course, this should be made more configurable and (as mentioned on the Cyclotron website) using system(3) isn't the nicest solution ;)

Quote:

Originally Posted by thedead1440 (Post 1305090)
Edit: Just noticed a side-advantage (?) that if the screen is locked and a notification arrives, even after a minute or two unlocking the screen still shows the notification in the status bar...

Could be one of these issues that happen when manually switching windows, which confuses mcompositor and/or the swipe plugin.

Quote:

Originally Posted by thedead1440 (Post 1305090)
Edit 3: Also is it deliberate that when swiping right, the home-screen is excluded from the carousel but swiping left includes the home-screen too? Didn't find this in the project page but then again I may have been blinded by my excitement to try the new implementation :D

That's just a bug. It *should* switch forward/backward, always including the homescreen (until we make that configurable). However, some windows such as overlays / notifications / the keyboard also count as *normal* windows and that's why sometimes windows are skipped. That's mostly a Cyclotron issue - it should filter/ignore non-toplevel windows and be more intelligent about what the next/previous window is.

Quote:

Originally Posted by evujumenuk (Post 1305100)
Looks almost flawless, except that windows always slide in from the left. :)

That's something that we can't really control (we just tell the window manager "this is the active window now, switch to it"). Fun fact: It doesn't slide from the left always, it depends on the direction to which you swiped away the last window (swipe window to the left, windows come back from the left, swipe window to the right, windows come back from the right, swipe window up, windows come back from the top).

evujumenuk 2012-12-16 16:38

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Well, for bragging purposes the volume buttons seem to be better-suited, then. ;)

bibek 2012-12-16 16:42

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Really great to see the project moving forward and achieving new possibilities. Haven't tested the status bar integration yet, maybe a little too lazy to flash if I screw up.

Would like to know if you've something more easy in plan for the *common* users?

veeall 2012-12-16 17:01

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Quote:

Originally Posted by thp (Post 1304801)
There's no new version out. Rate-limiting could be done, but right now I can't distinguish between "user keeps the button pressed" and "user presses the button rapidly". And in the second case, it could be annoying if the user wants to switch between apps quickly.

The "nice animation" is something that's totally dependent on the window manager (mcompositor / swipeplugin), I didn't do anything there.

As far as excluding the home screen view from the application switching goes, this could be implemented (to exclude it from the list), but I thought it was kind of nice to have it in there. I'll think about maybe removing it in a future version - but first, I think I'll have a look at systemui (thanks qwazix for the great idea!). Swiping left/right on the statusbar seems doable, I'd just need to figure out where the input handling for that is (help here is welcome of course).

Thanks for an answer! I don't know if there are different states available for volume buttons, like pushing a volume button down vs releasing the button, what if releasing the button actually launches the cyclotrons commands, then there's no need for rate-limiting. Imho, even quickly browsing through apps by keeping button pressed still needs some rate-limiting applied to be really usable.

qwazix 2012-12-16 19:52

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
seems to work as expected. Thanks for this, it's very useful.

thedead1440 2012-12-17 16:30

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
I have noticed a bug whereby when unlocking the screen, after swiping the lock-screen away, the phone locks to standby screen again...Its very random; at times 1 additional unlock allows you access while today in a meeting the worst I suffered was 5 attempts required...


Edit: Following the two posts below I have uninstalled harmattan-power-menu and will try it today if the bug doesn't re-surface it means its a harmattan-power-menu bug not cyclotron...


Edit 2: After several days of testing I confirm this is not a cyclotron bug; it happened only while harmattan-power-menu was installed so maybe its the latter that caused it.

coderus 2012-12-17 17:43

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
never happened.

TMavica 2012-12-17 17:55

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
never happen too

bibek 2012-12-18 03:16

Re: [ANN] Cyclotron - CLI tools to cycle between app windows
 
Just in case I want to revert back to my default meegotouch and qt comps after trying it out? What should I do? Which files to backup n how to restore them?


All times are GMT. The time now is 23:08.

vBulletin® Version 3.8.8