How to create a desktop-entry in Gnome? - gnome

I have installed ProM 6.8 (a process mining tool, written in Java) and after executing the command ./ProM68.sh & in a terminal, the application starts without problems.
I tried to create both a desktop-entry in Gnome 3 (on Fedora 28) or a menu-item.
This is my desktop-entry:
[Desktop Entry]
Name=Prom
Exec=/home/bengbers/Programs/Prom/ProM68.sh %u
Type=Application
StartupNotify=true
Terminal=false
Categories=Development;Java;
After double-clicking this iscon, nothing happens.
I also tried adding an entry in the main-menu but this entry fails also.
How can I create a working desktop entry?
Ben

Prom needed a .ini file to start. After adding a path to the directory, everything worked fine.
Ben

Related

How to add an icon of app that I have downloaded in Ubuntu?

I have downloaded Webstorm, but accidentally I did not see an icon. Then I just wrote a command "bash webstorm.sh" and then Webstorm run. But I really don't want to run WS with this method. Help me
just create a desktop file ( a file with desktop extension, for example my_app.desktop) and then move this file under "~/.local/share/applications" or under "/usr/share/applications" (if you are a member of sudoers and you can run a command with sudo).
your desktop file should be similar to this
[Desktop Entry]
Name=Webstorm
Comment=terminal app
Exec="bash webstorm.sh"
Terminal=false
Type=Application
Icon=path_to_icon
Categories=IDE;

How can I run a .desktop file which starts a script file, but hides the terminal?

I wrote a .desktop file which should start an .sh file. It works good but opens a terminal with the logs of the started application. When I close the terminal also the application gets closed. The application is the webstorm IDE. Here is my .desktop file.
[Desktop Entry]
Type=Application
Name=webstorm
Terminal=false
Icon=/pah/to/webstorm-icon.svg
Exec=/path/to/webstorm.sh
Is there a way to hide the terminal and only start the application? Please note that I already set the parameter Terminal to false.
Oh oh. Sorry. Seems, that some Props (like Terminal=false) just takes effekt after reboot. I should pay more attention to "It Crowd".

Cannot launch custom desktop app on gnome but it works fine with gtk-launch

I install an application (Ghidra) without .desktop file.
So I created one myself and placed it to ~/.local/share/applications/Ghidra.desktop.
Gnome references it as an application in the show applications, but when I click on it, nothing happens.
So I tried to run gtk-launch Ghidra and it works fine this way.
this is my desktop file :
[Desktop Entry]
Type=Application
Name=Ghidra
Comment=Launch Ghidra
Icon=/opt/ghidra/Ghidra.png
Exec=/opt/ghidra/ghidraRun
Terminal=false
Path=/opt/ghidra
Name[en_US]=Ghidra
Anyone knows the issue here ?
Thanks
I had exactly this problem recently with another program, and was able to fix it by appending %u to the Exec key like so:
Exec=/path/to/program %u
This forwards a given URL to the program as parameter, as described here.
I am not sure why this was needed in my case (as the program doesn't need any parameters to run) but it made it executable through Gnome.

run external application in linux using qprocess

I am creating an GUI application using QT creater in Raspbian. When I click a button I want to open an external application like terminal, or browser, etc.
I have tried many attempts
attempt 1
std::system("/usr/share/raspi-ui-overrides/applications/scratch.desktop&");
it says me permission denied
attempt 2
QDesktopServices::openUrl(QUrl("/usr/share/raspi-ui-overrides/applications/scratch.desktop"));
this one is working but its not opening the application but its opening in terminal:
QDesktopServices::openUrl(QUrl("/usr/share/raspi-ui-overrides/applications/scratch.desktop"));
I'm assuming the question is about Raspberry Pi and Raspbian.
In Raspbian, the scratch.desktop and other *.desktop files are not executables, but just text files that describe which application to run.
Example:
pi#raspberrypi:~ $ cat /usr/share/raspi-ui-overrides/applications/scratch.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
TryExec=scratch
Exec=scratch
Icon=scratch
Terminal=false
Name=Scratch
Comment= Programming system and content development tool
Categories=Application;Development;
MimeType=application/x-scratch-project
You need to use an actual binary to start the process. For scratch, it would be /usr/bin/scratch. For a browser, it's likely to be /usr/bin/epiphany-browser. Look at Exec= line in the *.desktop file to see the name of the executable, then use which in the terminal to see its location:
pi#raspberrypi:~ $ which epiphany-browser
/usr/bin/epiphany-browser
The .desktop files are not executable, but serve as shortcuts for the desktop system. Assuming that the scratch.desktop has the following:
scratch.desktop
[Desktop Entry]
Name=Scratch
Comment= Programming system and content development tool
Exec=scratch
Terminal=false
Type=Application
Icon=scratch
Categories=Development;
MimeType=application/x-scratch-project
Then the executable is /usr/bin/scratch, And you can run it with Qt:
QProcess::startDetached("/usr/bin/scratch");
Or:
QProcess::execute("/usr/bin/scratch");

Not able to run the jar file during startup of system

I have RedHat linux. Intention is to start the java based GUI app after linux system finishes boot up. I have edited /etc/rc.local and kept
/usr/java/jre1.7.0_60/bin/java -jar /home/rfgwtest/Desktop/CEM/CEM_v2.0_Beta08/CEM_v2.0_Beta08/PME_CEM.jar &
at the end of the file. I am able to run this file for testing by executing the file on prompt. no errors of path or so.
what is missing as part of this? i have found this tip from the RedHat website
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-boot-init-shutdown-run-boot.html
is there a common way to do this across the different kind of distribution ?
Maybe, creating a desktop entry will do it.
To do that,
$ cd
$ nano .config/autostart/javaApp.desktop
now, write this inside it,
[Desktop Entry]
Type=Application
Exec=usr/java/jre1.7.0_60/bin/java -jar /home/rfgwtest/Desktop/CEM/CEM_v2.0_Beta08/CEM_v2.0_Beta08/PME_CEM.jar
Hidden=false
NoDisplay=false
Name[en_IN]=StartJAR
Name=StartJAR
Comment[en_IN]=Jar comment
Comment=Jar comment
save the file and then, restart or re-login to the system.

Resources