Notices


Reply
Thread Tools
K9999's Avatar
Posts: 168 | Thanked: 116 times | Joined on Mar 2011 @ Malaysia
#1
Hi all,
so what I'm trying to do is to create an icon on the application menu that takes you to a website once it's launched (or to start a flash game in a saved directory). I've been trying this for the past 2 days and used different types of codes and still no use. Here's the latest I've done so far :

PHP Code:
[Desktop Entry]
Encoding=UTF-8
Icon
=cimb
Type
=Link
URL
[$e]=http://www.mobile.cimbclicks.com.my/ 
I placed "cimb" icon on the scalable icons directory:
/home/opt/usr/Share/icons/hicolor/scalable/hildon

Where I named the code file "cimb.desktop" and placed it in:
/usr/share/applications/hildon

This is the first time I make "Link" type of desktop entry. What exactly am I missing?
Thanx in a advance,


p/s: sorry if I posted this thread in the wrong section as I realized it too late.

Last edited by K9999; 2011-05-17 at 20:29.
 
Posts: 805 | Thanked: 1,605 times | Joined on Feb 2010 @ Gdynia, Poland
#2
Edit: Allright, see my post below, I checked it and this code does not work, I have no idea why. Old post:


Hi,

change
Originally Posted by K9999 View Post
Code:
[Desktop Entry]
Encoding=UTF-8
Icon=cimb
Type=Link
URL[$e]=http://www.mobile.cimbclicks.com.my/
to

Code:
[Desktop Entry]
Encoding=UTF-8
Icon=cimb
Type=Application
Exec=/usr/bin/browser\ --url=http://www.mobile.cimbclicks.com.my/
It should work remember that in Exec=blahblah line you need to put "\" character in front of every space character you type, that's why above command
Code:
/usr/bin/browser --url=http://www.mobile.cimbclicks.com.my/
needs to be written
Code:
Exec=/usr/bin/browser\ --url=http://www.mobile.cimbclicks.com.my/
That command actually runs default browser (MicroB unless one installed browser switchboard and changed) pointing it to address given as --url parameter. Source: bottom of page http://browser.garage.maemo.org/docs/dummy.html

Last edited by misiak; 2011-05-18 at 09:56. Reason: typos
 

The Following 3 Users Say Thank You to misiak For This Useful Post:
K9999's Avatar
Posts: 168 | Thanked: 116 times | Joined on Mar 2011 @ Malaysia
#3
thanx a lot for the reply mate. I copied ur command in case i dun make mistakes. but i'm still not getting the menu shortcut. I tried restarting and still
 
pusak gaoq's Avatar
Posts: 723 | Thanked: 519 times | Joined on Nov 2010 @ Kuching:Malaysia
#4
to make desktop icon do this.....


[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Name=cimb
Exec=/usr/bin/browser\ --
url=http://www.mobile.cimbclicks.com.my/
X-Osso-Type=application/x-executable
Terminal=true
Icon=cimb


also icon must be put in....

usr/share/icon/hicolor/48x48/apps
 

The Following User Says Thank You to pusak gaoq For This Useful Post:
K9999's Avatar
Posts: 168 | Thanked: 116 times | Joined on Mar 2011 @ Malaysia
#5
Thanx Pusak, it worked and I got it on the application menu



Though there's still something wrong with the execution line as u can see from the picture the icon glows once pressed but nothing happens and keeps glowing
 
Posts: 805 | Thanked: 1,605 times | Joined on Feb 2010 @ Gdynia, Poland
#6
Ok, I also tried and made it now to work :P

Create a script somewhere, for test purposes let's assume it's in /opt/openwebsite.sh:
Originally Posted by /opt/openwebsite.sh
#!/bin/sh
`/usr/bin/browser --url=$1 &`
What it does is just open url given as parameter in browser and return immediately (that's why "&" character is in the end, if it was not there, strangely "browser" never returns on my device... anyone have same problems?)

Don't forget to make it executable (chmod a+x /opt/openwebsite.sh). You must edit (or create) the script as root and also chmod command must me executed as root.

And now I have a working shortcut (wtf? no need to "\" before space? I thought that's required?)
Originally Posted by /usr/share/applications/hildon/test.desktop
[Desktop Entry]
Version=1.0
Name=cimb
Type=Application
Comment=Shortcut to some website
Exec=/opt/openwebsite.sh "http://www.google.com"
Icon=cimb
Does it work for you also? Try with http://www.google.com and then change to your website address
 
K9999's Avatar
Posts: 168 | Thanked: 116 times | Joined on Mar 2011 @ Malaysia
#7
U made it on ur phone? waw man I dun know wut's wrong here, I tried here using my phone but still nothing. Will try again through my laptop as soon as I get home and let u know
 
Posts: 805 | Thanked: 1,605 times | Joined on Feb 2010 @ Gdynia, Poland
#8
Steps to debug:
0. install leafpad if you don't have it, it's great text editor
1. open terminal
2. type "sudo gainroot"
3. type "leafpad /opt/openwebsite.sh"
4. write contents (or paste from here):
Code:
#!/bin/sh
`/usr/bin/browser --url=$1 &`
5. Exit and save
6. type "chmod a+x /opt/openwebsite.sh"
7. close terminal
8. open new terminal (so that you are now user again, not root)
9. check if it works so far, type:
Code:
/opt/openwebsite.sh "http://www.google.com
It should open website in new browser window. If it doesn't you either don't have execution rights of /opt/openwebsite.sh (note that any file in /home/user/MyDocs or /media/mmc1 cannot have execution rights as these partitions are FAT-type) or have a typo in your script
10. If it worked correctly, close terminal again
11. open new terminal
12. type "sudo gainroot" to become root
13. type "leafpad /usr/share/applications/hildon/test.desktop"
14. type or copy and paste the contents of the file:
Code:
[Desktop Entry]
Version=1.0
Name=cimb
Type=Application
Comment=Shortcut to some website
Exec=/opt/openwebsite.sh "http://www.google.com"
Icon=cimb
15. Exit and save
16. Close terminal
17. Open applications menu, find "Test app" icon.
18. Tap it, check if it works. If it doesn't - try replacing in test.desktop file
Code:
/opt/openwebsite.sh "http://www.google.com"
to
Code:
/opt/openwebsite.sh\ "http://www.google.com"
(so basically adding "\" in front of space) and check if it works.
19. If it worked, play with test.desktop file and modify it to suit your needs.

It works on my phone If it does not on yours, tell me how far did you go untill something failed
 

The Following User Says Thank You to misiak For This Useful Post:
pusak gaoq's Avatar
Posts: 723 | Thanked: 519 times | Joined on Nov 2010 @ Kuching:Malaysia
#9
Originally Posted by K9999 View Post
Thanx Pusak, it worked and I got it on the application menu



Though there's still something wrong with the execution line as u can see from the picture the icon glows once pressed but nothing happens and keeps glowing
ok change the url to this....

/usr/bin/browser_dbuscmd.sh load_url http://www.mobile.cimbclicks.com.my/

put the line in the exec on the cimb.desktop....

Last edited by pusak gaoq; 2011-05-18 at 12:17.
 

The Following User Says Thank You to pusak gaoq For This Useful Post:
K9999's Avatar
Posts: 168 | Thanked: 116 times | Joined on Mar 2011 @ Malaysia
#10
Originally Posted by pusak gaoq View Post
ok change the url to this....

/usr/bin/browser_dbuscmd.sh load_url http://www.mobile.cimbclicks.com.my/

put the line in the exec on the cimb.desktop....
Thanx Genius!! that was it. it worked. thanx a LOT

Thanx to u guys too and your posts, I believe there're several ways of doing it. I appreciate your time
 
Reply


 
Forum Jump


All times are GMT. The time now is 07:58.