Another broken desktop entry [SOLVED]

Moderator: Forum moderators

Post Reply
User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 times

Another broken desktop entry [SOLVED]

Post by Jasper »

Hi all

I compiled an application that I use for downloading from Usenet.

I can start the application from the terminal

Image

and there is an option to use the webui

Image

To make it easier for others to use, I would like to create a desktop entry that would allow the user to launch the webui.

Code: Select all


[Desktop Entry]
Name=NzbGet
GenericName=Usenet Downloader
Exec=nzbget -s defaultbrowser http://localhost:6789
Icon=/usr/share/icons/nzbget.png
Terminal=false
Type=Application
Categories=X-Internet-transfer;
Keywords=filetransfer;download files;download manager;

When I launch the application via terminal I type in

Code: Select all


nzbget -s

then it should start the default web browser and launch the 'Welcome' page

Code: Select all


defaultbrowser http://localhost:6789

Can someone let me know what I need to do to create the correct it?

Last edited by Jasper on Fri Apr 12, 2024 3:51 pm, edited 1 time in total.
User avatar
rockedge
Site Admin
Posts: 5722
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1997 times
Been thanked: 2099 times
Contact:

Re: ........... lol another broken desktop entry

Post by rockedge »

@Jasper I think a LAUNCH script would be a better choice than the .dektop file. :ugeek:

But there is a way to use a .desktop file to launch URL's!

Example from Zoneminder->

Code: Select all

[Desktop Entry]
Version=1.0
Type=Link
Name=ZoneMinder
Comment=
Icon=/usr/share/zoneminder/icons/16x16/icon.xpm
URL=http://localhost/zm/\r
User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 times

Re: ........... lol another broken desktop entry

Post by Jasper »

@rockedge

I did try your example but it did not display the menu entry and therefore I could not launch it.

However I did try this instead

Code: Select all


[Desktop Entry]
Name=NzbGet
GenericName=Usenet Downloader
Icon=/usr/share/icons/nzbget.png
Terminal=false
Type=Application
Exec=urxvt -e nzbget -s && defaultbrowser http://localhost:6789
Categories=X-Internet-transfer;
Keywords=filetransfer;download files;download manager;

Using the above, I do get a menu entry and when I click on the icon it does launch the terminal window.

To progress forward, I need to close the terminal window and then it will launch the WebUI "Welcome" page ........ which will require the user to enter the login details.

Nearly there :lol: :thumbup:

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 times

Re: ........... lol another broken desktop entry

Post by Jasper »

Image

Ideally, this is what I would like the user to see when the opened the application via the menu entry.

I think I will just leave it as a console application and then just post details on how to access the webui if the user needs it.

User avatar
mikewalsh
Moderator
Posts: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 times

Re: ........... lol another broken desktop entry

Post by mikewalsh »

@Jasper :-

The way I learnt to do this LONG ago - especially where firing-up an app involves more than simply calling an executable! - is to create an appropriately-named script in /root/my-applications/bin which does whatever is required to get your app up-and-running.

Your .desktop entry will then simply call this script. Actually, the script could be anywhere you like.........so long as it's "in the $PATH" (or called via an absolute $PATH, of course.)

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 times

Re: Another broken desktop entry [SOLVED]

Post by Jasper »

@mikewalsh

Thanks for letting me know, I will try it out and hopefully next time, I will provide a script.

The only question is where to place it?

/root/my-applications

User avatar
rockedge
Site Admin
Posts: 5722
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1997 times
Been thanked: 2099 times
Contact:

Re: Another broken desktop entry [SOLVED]

Post by rockedge »

The only question is where to place it?

/root/my-applications/bin from there it is in the $PATH and can run globally

Post Reply

Return to “REQUESTS”