Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Desktop Entry

    Reply
    Page 1 of 2 | 1   2   | Next
    K9999 | # 1 | 2011-05-17, 20:23 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by K9999; 2011-05-17 at 20:29.

     
    misiak | # 2 | 2011-05-17, 20:51 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

    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, mece, mrsellout

     
    K9999 | # 3 | 2011-05-18, 03:25 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    pusak gaoq | # 4 | 2011-05-18, 08:18 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to pusak gaoq For This Useful Post:
    K9999

     
    K9999 | # 5 | 2011-05-18, 09:59 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    misiak | # 6 | 2011-05-18, 10:03 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    K9999 | # 7 | 2011-05-18, 10:30 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    misiak | # 8 | 2011-05-18, 10:40 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to misiak For This Useful Post:
    K9999

     
    pusak gaoq | # 9 | 2011-05-18, 10:55 | Report

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

    Edit | Forward | Quote | Quick Reply | Thanks

    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

     
    K9999 | # 10 | 2011-05-18, 14:16 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 1 of 2 | 1   2   | Next
vBulletin® Version 3.8.8
Normal Logout