| 1   2   | Next
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Desktop Entry (https://talk.maemo.org/showthread.php?t=73184)

K9999 2011-05-17 20:23

Desktop Entry
 
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.

misiak 2011-05-17 20:51

Re: Desktop Entry
 
Edit: Allright, see my post below, I checked it and this code does not work, I have no idea why. Old post:


Hi,

change
Quote:

Originally Posted by K9999 (Post 1008542)
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

K9999 2011-05-18 03:25

Re: Desktop Entry
 
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 2011-05-18 08:18

Re: Desktop Entry
 
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

K9999 2011-05-18 09:59

Re: Desktop Entry
 
Thanx Pusak, it worked and I got it on the application menu

http://i.imgur.com/2ZN3W.png

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 :confused:

misiak 2011-05-18 10:03

Re: Desktop Entry
 
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:
Quote:

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?)
Quote:

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 2011-05-18 10:30

Re: Desktop Entry
 
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 :)

misiak 2011-05-18 10:40

Re: Desktop Entry
 
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 ;)

pusak gaoq 2011-05-18 10:55

Re: Desktop Entry
 
Quote:

Originally Posted by K9999 (Post 1008945)
Thanx Pusak, it worked and I got it on the application menu

http://i.imgur.com/2ZN3W.png

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 :confused:

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....

K9999 2011-05-18 14:16

Re: Desktop Entry
 
Quote:

Originally Posted by pusak gaoq (Post 1009014)
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 :D

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


| 1   2   | Next
All times are GMT. The time now is 08:56.

vBulletin® Version 3.8.8