PDA

View Full Version : iSwap desktop switcher app


KennX
08-13-2007, 12:38 AM
After finding out how to launch a shell script as an application I've put together an app to switch between two desktops to double the number of apps/icons that you have access to at the touch of a button. It's available off of my blog at:

http://digestingreality.blogspot.com/2007/08/iphone-iswap-application.html

If you're interested check it out!

-KennX

ztaafen
08-13-2007, 12:44 AM
This seems great! To bad I don't have an iPhone to test it on.. ;)

Could you make a moive or something where I can see it in action?

KennX
08-13-2007, 01:37 AM
I put this up last night but forgot to mention it. Thanks for reminding me.

http://www.youtube.com/watch?v=TLqG1-XR1ug&v3

-KennX

theviolator
08-13-2007, 02:25 AM
Hey KennX can you put an example of what the syntax should be in those Displayorder.plist files. I always get confused :)

KennX
08-13-2007, 02:57 AM
I don't want to put a specific file up because I'm afraid someone will think that they have to use that one and it will mess up their desktop. Since those .plist files are dependent upon what theme and apps you've installed they vary greatly...

However, I will give some more details and generic examples below.

The DisplayOrder.plist file is divided into 3 main sections (or keys): buttonBar, iconList, and special. Inside of each of these keys/sections an array is set up (which is basically just a list) that is read in. This is designated by the tag <array> and ends with the </array> tag.

buttonBar is where the icons that appear on the bottom row, sometimes thought of as the dock (in Mac parlance) reside. My suggestion is to leave this the same in both the DisplayOrder.plist and the Screen2.plist files as it will give you some apps that you always have ready access to. On mine I have the Phone, iPod, Browser, Email and SMS.

iconList is the 'meat' of these .plist files. This is where all of the other apps are referenced to appear on your desktop. Anything with:

<dict>
<key>displayIdentifier</key>
<string>com.whatever.programname</string>
</dict>

Is a reference to a specific application. For example, the Stocks program is referenced as follows:

<dict>
<key>displayIdentifier</key>
<string>com.apple.stocks</string>
</dict>

Each app that is put into the iconList array in the above format WILL appear on the desktop. The order of the array seems to fill in from right to left and top to bottom giving you room for 4 icons/apps per row and 4 rows total far as I can tell.

special is a the key area for hiding apps. Any entries that are put into the array area of this key will NOT appear on the desktop. This is what we use for the Screen2.plist file. Make a copy of the original DisplayOrder.plist and move all of the apps (the parts listed above from <dict> to </dict> out of the iconList array and into the special array. Voila! They vanish. So when the iSwap app makes the Screen2.plist file your new DisplayOrder.plist anything you've moved into the special array will be gone... making more room for you to put new entries into the Screen2.plist iconList array.

Hopefully, this helps clear things up a bit. If not, let me know and I'll try to put together a short video of how to edit them in the next couple days.

Cheers!

-KennX

bram
08-13-2007, 06:41 AM
Hey.. looks pretty cool, but it seems a bit inconvenient to have to log back in every time you want to switch desktops. I suspect ultimately either Springboard itself will have to be replaced, or an app used to display another listing.

However, I'm curious as to whether Springboard must be fully exited for this trick to work, or if another signal couldn't be used to cause Springboard to simply reload its contents (maybe 'kill -2/-3/-6'?).

Also, as a safety precaution you might want to consider not using 'mv', but instead use a soft link ('ln -s'). Each time, you can then simply delete that link, and make a new one when you want to switch. If you wanted to get fancier, you could also keep a master plist, and then copy part of its contents to the one Springboard will use.

KennX
08-13-2007, 07:26 AM
bram,

Thanks! Great suggestions. I'll keep working on it and see if I can come out with a better and safer version soon. Thanks again for all your help!

-KennX

Miyavi
08-13-2007, 02:28 PM
I've got my Screen2.plist set up correctly, but when I press the iSwap app it goes to the Default.png and 15 seconds later goes to my same desktop.

KennX
08-13-2007, 04:46 PM
Have you changed the Screen2.plist to put the the hidden apps into the <special> key area instead of in the iconList area? Do you, for some reason, have a Screen1.plist and a Screen2.plist in the Springboard.app folder along with your DisplayOrder.plist? Maybe your Screen2.plist has gotten the wrong permissions? Are they the same as your DisplayOrder.plist? Let me know so we can figure out what's going on. I want to put any kind of errors (and their resolution) into a FAQ.

Miyavi
08-13-2007, 09:39 PM
Yes, my Screen2.plist is set up correctly.
I think I may be missing some binary?

theviolator
08-14-2007, 08:57 AM
Hey KennX, I did everything necessary but when I press the iSwap icon it just shows me the screen with "switching your desktop please wait" and then goes back to my original desktop :( Am I missing a binary file?
Can you list all the binaries you're using for this? i.e. 'bash, grep, ps, etc...

P.S. What exatly you put in the string line? for example: for NES.app is it going to be ---> <string>com.apple.NES</string> ????

Thanks.

bboyredcel
08-14-2007, 06:32 PM
I'm no developer but, why not mod the existing springboard.app to allow scrolling?

KennX
08-14-2007, 09:57 PM
Hey all,

For those who have been having issues with your plist files I have decided to make mine available (as an EXAMPLE ONLY) of the differences between the DisplayOrder.plist and Screen2.plist.

They're available as a zip file linked off:

http://digestingreality.blogspot.com/

Let me know if things still seem confusing.

Cheers!

-KennX

theviolator
08-14-2007, 10:15 PM
Thanks KennX :) The plists are not confusing, it is pretty simple actually..you put those apps you want in the "icon" array and those you dont want in the "special" and then vise versa for the other plist. However, theres something else missing...I have looked at your .sh script and tried to identify the binaries you're using for this exercise because I have installed most of the iPhone.binkit but it seems that you're using something else in that script which I dont have :(
Thats why I was asking to name those binaries, its much easier. Thanks for the plist files thou... I appreciate it :)

KennX
08-14-2007, 11:00 PM
Thanks KennX :) The plists are not confusing, it is pretty simple actually..you put those apps you want in the "icon" array and those you dont want in the "special" and then vise versa for the other plist. However, theres something else missing...I have looked at your .sh script and tried to identify the binaries you're using for this exercise because I have installed most of the iPhone.binkit but it seems that you're using something else in that script which I dont have :(
Thats why I was asking to name those binaries, its much easier. Thanks for the plist files thou... I appreciate it :)

Ah! Sorry, didn't understand your question really. Well, if you don't have the mv command then my script certainly wouldn't work. Check to make sure you've got that command.

-KennX

theviolator
08-15-2007, 12:57 AM
kill -9 `ps wwx | grep SpringBoard | grep -v grep | sed -e s/\?.*//`

Besides the "mv" command I see you're using also "kill". "ps", "grep". "sed" and...
"wwx" ???!

I think Im missing the last one :confused:

P.S. The last line of your script is "fi" kinda strange.... double check to see if your script was not trunkated or something.

BenjaminD
08-15-2007, 01:36 AM
"fi" is the closing for a bash (and probably sh) "if" statement, so I don't think it would be at all strange to end a script with it. Wwx is what ps is referencing, not a binary. In that statement, the binaries are: kill, ps, grep, and sed (I'm fairly sure, at least). The easiest way to see if you have a binary is just to type that command at a shell prompt and see if it can execute the command. If it gives you an error and you have it installed, your permissions or the placement of the file is probably wrong and it won't work in the script.

Good luck!

J5892
08-15-2007, 02:10 AM
I'm having the same problems.
My Screen2.plist is correct, and I have all of the binaries (I think).
But it still just goes back to the original springboard when I run iSwap.
It could be a problem with editting the Screen2.plist on windows, or something like that, because when I edit my DisplayOrder.plist, even just swapping two icons, when everything is correct, it shows a completely blank springboard. The permissions are correct and everything.
I don't know where to go from here though. I've tried everything.
I suspect that everyone who is having trouble has the same problem.

theviolator
08-15-2007, 02:37 AM
Its not the Windows, Im doing it on a Mac and I still cant get it to work, even the applications in my "special" array are ignored i.e. they are still showing up on the desktop....Im looking at the plist file and everything is correct (its not a brain science for God sake!) and its still completely disregards whatever I put in those fields. :confused: Go figure....

P.S. I have kill, ps, grep, mv and sed with correct permissions

J5892
08-15-2007, 03:01 AM
Hmm, I don't have "grep". Where do you get that?
I have all the bins from the binkit.

lampcov
08-15-2007, 03:38 AM
Ok, I fully expect the flaming barrage, I am having a brain f@rt.

Where do you find the names of the programs to put into the displayOrder.plist like com.apple.mobilemail

I know that I know the answer, I am just not able to bring it to the front of my brain.

I apologize in advance.

If you need me I'll be sitting in the corner with my dunce cap on

lampcov
08-15-2007, 05:07 AM
Ok, I looked around and got it.

For those who don't know...

You need to get the "CFBundleIdentifier" from the application's Info.Plist

You then add it to the /SpringBoard.app/English.lproj/LocalizedApplicationNames.strings

And then you can use it in the DisplayOrder.plist

Happy to have answered my own question and hope this helps.

If I have got it wrong, or there is a better way, please correct me/PM me and I will edit.
Marc

KennX
08-15-2007, 06:33 AM
Sorry, guys... been swamped at work and haven't had a chance to check back here.

All of the binaries used for iSwap are:

bash
mv
kill
ps
grep
sed

Hope that helps.

Miyavi
08-15-2007, 07:45 AM
Could you please provide us with all of those files. I still can't get it working and I've been trying since you first posted it.

J5892
08-15-2007, 07:53 AM
Ok, got it to work.
I was missing "grep".
Works perfectly now.
Thanks KennX, great script.

theviolator
08-15-2007, 07:56 AM
Dude, still doesnt work :( I compared your two plist files with mine..have all the binaries...dont know what is going on anymore :confused:

Miyavi
08-15-2007, 08:03 AM
Could those that have it working help us out here?

theviolator
08-15-2007, 08:13 AM
Yeah!!! Can somebody post step by step guide (for idiots) how to make it work?
Im on my wits end already the plist files are correct, I tested from the ssh mv DisplayOrder.plist to Screen1.plist and it works. I have grep, mv,kill, ps,sed...they all work as well. But when I press the icon on iSwap it just goes back to my original desktop! Most of all, all the things in the plists are completely ignored also...applications which shouldnt show on the main desktop are still showing and they ARE in the "special" array in my DisplayOrder.plist

I didnt know what else to do ...so I went and gave 777 permissions to those scripts (see how desperate I am) ....still nothing :mad:

P.S. All those who got it to work, have you installed the new firmware update?

Miyavi
08-15-2007, 08:50 AM
I have 1.0.1 and Its not working for me so that seems to not be the issue...

theviolator
08-15-2007, 09:14 AM
Im with 1.0.1 also.....so did yours work or not?

Miyavi
08-15-2007, 09:23 AM
nope lol... we are like the two people that care the most that can't get it working...

theviolator
08-15-2007, 09:28 AM
yeah....I have so many apps now that cant get them to display :(
and I had to update to 1.0.1 recently...so I guess just have to wait for better solution :rolleyes:

KennX
08-15-2007, 06:01 PM
Hey guys,

I had my iPhone at 1.01 as soon as it came out (was going to DefCon so I figured better safe than sorry.. :) Anyway, since it was at 1.01 before I started writing this script so I don't think that's the issue.

It's possible that we are using different versions of the binkit and that might be the issue.

Let me list some of the things that I did on my iPhone prior to creating this script.

I installed SSH using the SSHkit for Windows:
http://www.hacktheiphone.net/downloads/SSHkit.zip

I installed this binkit using WinSCP:
http://iphone.natetrue.com/iphone-binkit-0.06.tar.gz

My Springboard.app directory is set with permissions 755 drwx rx rx
Not sure if that's the default or something I set it at.

Put iSwap.app in /Applications and chmod 755 both the dir and the files inside
Put Screen2.plist in /System/Library/CoreServices/SpringBoard.app/

The desktop theme I'm using is one of the GunMetal ones off modmyiphone.com. Unfortunately, that site is down so I can't tell you the file name or link to it. Not that this should matter, per se, but I'm trying to think of anything.

Beyond that, I'm not sure what to say. I DO have a v.2 of iSwap pretty much ready that will accommodate more screens and uses a somewhat safer approach but I want to test it more before releasing it. Unfortunately, I wasn't able to get a speed increase or negate the necessity of logging back in after a Swap.

Let me know if any of these things make the difference!

-KennX

Miyavi
08-15-2007, 09:32 PM
Still no luck here... =(

elchlngon
08-16-2007, 04:00 AM
i dont know what it was but i had the same problem with u guys but now i got it working, and guess what? it was the app. i just download the app from this site modmyphone http://www.modmyiphone.com/forums/downloads.php?do=file&id=376 and place it in Applications with permissions 0755 app and files inside too :D

Miyavi
08-16-2007, 08:27 AM
Since modmyiphone is down right now, can you put your iSwap.app on Megaupload or Rapidshar?

KennX
08-16-2007, 04:23 PM
Since modmyiphone is down right now, can you put your iSwap.app on Megaupload or Rapidshar?

Kind of late for my answer now... as I believe MMI is back up. However, my app is linked off of my blog http://digestingreality.blogspot.com/ to a site called gigasize... Just in case MMI goes down again.

-KennX

MetalRat
08-16-2007, 07:05 PM
Besides the "mv" command I see you're using also "kill". "ps", "grep". "sed" and...
"wwx" ???!

I think Im missing the last one :confused:

P.S. The last line of your script is "fi" kinda strange.... double check to see if your script was not trunkated or something.

wwx are parameters supplied to ps ;)

theviolator
08-17-2007, 12:57 AM
wwx are parameters supplied to ps

That was aswered already few days ago :p

bboyredcel
08-19-2007, 02:06 AM
I'm no developer but, why not mod the existing springboard.app to allow scrolling?