maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Design (https://talk.maemo.org/forumdisplay.php?f=46)
-   -   Custom Icon e.g. Starting Favorite Webradio (https://talk.maemo.org/showthread.php?t=39858)

Reflektorfalke 2010-01-09 14:35

Custom Icon e.g. Starting Favorite Webradio
 
Hi,

inspired by this thread: http://talk.maemo.org/showthread.php?t=35858 I came up with the idea of creating a desktop shortcut for starting my favorite internet radio:

Step 1: Create a file named e.g. "webradio.desktop" in the /usr/share/applications/hildon/ directory
(will need root access to do that).

Step 2: Enter the text below in the new file and replace the text within < ... > (custom name + link to stream) with whatever you want...

Step 3: Afterwards you have a new entry in your application list with your custom name and may create a shortcut on your desktop.
When you click on your new icon / shortcut a xterm window will appear for a second before media player starts playing your webradio...

PHP Code:

[Desktop Entry
Encoding=UTF-
Version
=0.1 
Type
=Application 
Terminal
=true 
Name
=<custom name
Exec=/usr/bin/osso-xterm '/usr/bin/dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:"<link to your webradio / stream>"' 
Icon
X-HildonDesk-ShowInToolbar=true 
X
-Osso-Type=application/x-executable 

BTW, you can also exchange the blue standard icon - check this post to see what you need to do!
http://talk.maemo.org/showpost.php?p...0&postcount=26

Thanx to archebyte for the great work!!!

Please share with whatever other functions you create your own custom icons / shortcuts...

orientel 2010-01-17 03:18

Re: Custom Icon e.g. Starting Favorite Webradio
 
Quote:

Originally Posted by Reflektorfalke (Post 461072)
When you click on your new icon / shortcut a xterm window will appear for a second before media player starts playing your webradio...

Thanks, cool idea! I also found a way to avoid seing xterm windows:
  • Create a script file (e.g. "play.sh") like the following including the xterm command to be executed
    Code:

    #!/bin/bash
    /usr/bin/dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:"<link to your webradio / stream>"
    exit 0

  • Change the Exec including sh command followed by the script file created, e.g.:
    Code:

    ...
    Exec=sh /home/user/play.sh
    Terminal=false
    ...


Reflektorfalke 2010-01-17 17:47

Re: Custom Icon e.g. Starting Favorite Webradio
 
Quote:

Originally Posted by orientel (Post 477427)
Thanks, cool idea! I also found a way to avoid seing xterm windows

Aah sweet, nice improvement!!!

Was experimenting with realizing it via script...
Somehow it didnīt work.
Whatever now it does - Thanks a lot!!!

cardiff-blues 2010-02-03 21:12

Re: Custom Icon e.g. Starting Favorite Webradio
 
How do you create the file in the first instance? Do you do this on the N900 first?

cardiff-blues 2010-02-03 21:53

Re: Custom Icon e.g. Starting Favorite Webradio
 
Have followed the instructions but don't see the shortcut. DO you have to keep the <> or remove them?

les_garten 2010-02-03 22:47

Re: Custom Icon e.g. Starting Favorite Webradio
 
Quote:

Originally Posted by orientel (Post 477427)
Thanks, cool idea! I also found a way to avoid seing xterm windows:
  • Create a script file (e.g. "play.sh") like the following including the xterm command to be executed
    Code:

    #!/bin/bash
    /usr/bin/dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:"<link to your webradio / stream>"
    exit 0

  • Change the Exec including sh command followed by the script file created, e.g.:
    Code:

    ...
    Exec=sh /home/user/play.sh
    Terminal=false
    ...


I rebooted and still don't see my entry showing up. I've seen this before with other applications and then they mysteriously appear some hours later. Any idea how to refresh the applications Icon menu?

Reflektorfalke 2010-02-03 22:54

Re: Custom Icon e.g. Starting Favorite Webradio
 
Quote:

Originally Posted by cardiff-blues (Post 509319)
How do you create the file in the first instance? Do you do this on the N900 first?

Just create a copy of another .desktop-file by typing

cp example.desktop examplecopy.desktop

in Xterm.

Reflektorfalke 2010-02-03 22:55

Re: Custom Icon e.g. Starting Favorite Webradio
 
Quote:

Originally Posted by cardiff-blues (Post 509381)
Have followed the instructions but don't see the shortcut. DO you have to keep the <> or remove them?

You have to remove <>, they just highlight the parts you want to edit

Reflektorfalke 2010-02-03 23:02

Re: Custom Icon e.g. Starting Favorite Webradio
 
Quote:

Originally Posted by les_garten (Post 509479)
I rebooted and still don't see my entry showing up. I've seen this before with other applications and then they mysteriously appear some hours later. Any idea how to refresh the applications Icon menu?

Well I remember reading about a command that refreshs the icon cache, but reboot will do the same!
If your icon does not appear recheck if you followed the steps as described or have typos somewhere!?
I think once it didnīt work for me when I created the .desktop file from the scratch on my Win PC, but it worked when I edited a copy of an existing .desktop file...

cardiff-blues 2010-02-03 23:13

Re: Custom Icon e.g. Starting Favorite Webradio
 
Quote:

Originally Posted by Reflektorfalke (Post 509491)
Just create a copy of another .desktop-file by typing

cp example.desktop examplecopy.desktop

in Xterm.

OK it wouldn't show up in app manager so I have followed your tip here. Now how do I put the content into my webradio.desktop file that I have just created?


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

vBulletin® Version 3.8.8