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)

thedead1440 2012-12-18 04:23

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

Originally Posted by bibek (Post 1305567)
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?

A simple apt-get install PACKAGES --reinstall would get the original ones hence you'll be back to stock...

E: Of course if you incepted the patched packages you would need to use the -d flag above to download them then manually incept them...

imaginaryenemy 2012-12-18 16:12

Quote:

Originally Posted by thedead1440 (Post 1303707)
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..

I am having permission issues with this. I try to save the script as /home/user/cyclotron.sh on nano, but am denied due to permissions. So I attend to save it elsewhere and execute it from there, but wad debuted due to permissions. I would really appreciate your help.

thedead1440 2012-12-18 16:15

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

Originally Posted by imaginaryenemy (Post 1305768)
I am having permission issues with this. I try to save the script as /home/user/cyclotron.sh on nano, but am denied due to permissions. So I attend to save it elsewhere and execute it from there, but wad debuted due to permissions. I would really appreciate your help.

Did you do it as user or root? /home/user/ partition has user permissions so do it as user and it'll work ;)

imaginaryenemy 2012-12-18 16:16

I can't type, and editing isn't working for me. I attempted to save it elsewhere and execute it from there but was denied due to permission. Please help.

thedead1440 2012-12-18 16:23

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

Originally Posted by imaginaryenemy (Post 1305772)
I can't type, and editing isn't working for me. I attempted to save it elsewhere and execute it from there but was denied due to permission. Please help.

I don't understand...

You open terminal and without devel-su you just type nano /home/user/SCRIPT_NAME.sh then paste contents and save...

You won't get permissions in ~/MyDocs/ due to vFAT...

If you want to use root then save in anywhere in root partition...

imaginaryenemy 2012-12-18 16:37

Quote:

Originally Posted by thedead1440 (Post 1305773)
Quote:

Originally Posted by imaginaryenemy
I can't type, and editing isn't working for me. I attempted to save it elsewhere and execute it from there but was denied due to permission. Please help.

I don't understand...

You open terminal and without devel-su you just type nano /home/user/SCRIPT_NAME.sh then paste contents and save...

You won't get permissions in ~/MyDocs/ due to vFAT...

If you want to use root then save in anywhere in root partition...

Oops, i was in devel-su...
Thank

bibek 2012-12-18 17:01

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

Originally Posted by imaginaryenemy (Post 1305777)
Oops, i was in devel-su...
Thank

I'd say you better use the desktop files I posted, in case you cant figure out the permissions thingy :)

imaginaryenemy 2012-12-18 17:57

I obviously have missed a very important step...
1. Installed the deb
2. Saved icon in appropriate folder
3. Ran the script

Cyclotron turns on after the script is entered and banner pops up. No toggle still. I don't mean to be a bother, I just feel I'm so close...

imaginaryenemy 2012-12-18 19:09

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

Originally Posted by bibek (Post 1305805)
If there's no error output, then its some.logical error. you gotta recheck ur script

I just copied and pasted thedead's script. Is there nothing else that needs to be done? The /home/user/cyclotron.sh is not there...

thedead1440 2012-12-19 05:21

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

Why not just use thp's new version which allows swiping from the status bar?


bibek's implementation is 4 icons or something like that; I haven't tried it as what I aimed to achieve with the script was icon only to toggle cyclotron on/off...

If you still want help on running the script its better you PM me so as not to clutter here ;)


All times are GMT. The time now is 04:04.

vBulletin® Version 3.8.8