Page 1 of 1
Another broken desktop entry [SOLVED]
Posted: Fri Apr 12, 2024 2:36 pm
by Jasper
Hi all
I compiled an application that I use for downloading from Usenet.
I can start the application from the terminal
and there is an option to use the webui
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
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?
Re: ........... lol another broken desktop entry
Posted: Fri Apr 12, 2024 2:42 pm
by rockedge
@Jasper I think a LAUNCH script would be a better choice than the .dektop
file.
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
Re: ........... lol another broken desktop entry
Posted: Fri Apr 12, 2024 3:26 pm
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
Re: ........... lol another broken desktop entry
Posted: Fri Apr 12, 2024 3:36 pm
by Jasper
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.
Re: ........... lol another broken desktop entry
Posted: Fri Apr 12, 2024 3:52 pm
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.
Re: Another broken desktop entry [SOLVED]
Posted: Fri Apr 12, 2024 4:18 pm
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
Re: Another broken desktop entry [SOLVED]
Posted: Fri Apr 12, 2024 4:59 pm
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