Creating rationalplan.desktop to be add to desktop


#1

Hi,
I would like to create below desktop file and add it to desktop which i copied the desktop file from debian installer.

rationalplan-single.desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Terminal=false
Icon=/sysroot/home/khairul/.local/share/icons/hicolor/128x128/apps/rationalplan-single.png
Type=Application
Categories=Application;Office;ProjectManagement;
Exec=/sysroot/home/khairul/Downloads/RationalPlanS-5.3.7811/RationalPlan/RationalPlan.sh
MimeType=application/x-rationalplan-single;
Name=RationalPlan
GenericName=Single Project Management Software
Comment=Use the Single Project version to handle independent projects by viewing WBS and Gantt charts, allocate resources and estimate costs
Keywords=Project Management Software;Project Management Tool;Project Management Application;Task Management;Project Management;Project Planning Software;Task Scheduling;Task Schedule;Gantt Chart;Critical Path;Work Breakdown Structure;Milestones;

I’ve put the rationalplan.desktop file in /sysroot/home/khairul/.local/share/applications then i run the eos-add-to-desktop RationalPlan

Result: Not appear on desktop


#2
wjt@camille:~$ eos-add-to-desktop --help
Usage:
   eos-add-to-desktop appid
Where:
   appid = application id (where desktop file is named appid.desktop)

It’s unclear from your post whether you named the file rationalplan-single.desktop or rationalplan.desktop but you need to run eos-add-to-desktop with the correct name (and the correct case), so one or other of the following:

eos-add-to-desktop rationalplan-single
eos-add-to-desktop rationalplan

You could also consider:

desktop-file-validate /sysroot/home/khairul/.local/share/applications/rationalplan-single.desktop

to see if the file itself is valid.


#3
$ desktop-file-validate rationalplan.desktop 
rationalplan.desktop: warning: key "Encoding" in group "Desktop Entry" is deprecated
rationalplan.desktop: warning: value "Application;Office;ProjectManagement;" for key "Categories" in group "Desktop Entry" contains a deprecated value "Application"

#4

OK, so let’s check some things:

  • Is rationalplan.desktop in the output of ls -l ~/.local/share/applications
  • Does /sysroot/home/khairul/.local/share/icons/hicolor/128x128/apps/rationalplan-single.png exist? (You may also be able to just write Icon=rationalplan-single.)
  • Is /sysroot/home/khairul/Downloads/RationalPlanS-5.3.7811/RationalPlan/RationalPlan.sh executable? (ie, you can run it with just that path in a terminal, not with bash /sysroot/home/khairul/Downloads/RationalPlanS-5.3.7811/RationalPlan/RationalPlan.sh)
  • Does “RationalPlan” show up in desktop search results? (It’s the same database.)
  • Does your eos-add-to-desktop invocation exactly match the basename, without .desktop extension, of the name of the file in ~/.local/share/applications?

#5

You should also make sure, that the .desktop file has the correct permission and metadata:

gio set ~/.local/share/applications/rationalplan-single.desktop metadata::trusted yes
chmod 755 ~/.local/share/applications/rationalplan-single.desktop 

Now if your file is syntactically correct, you should be able to execute it from with Nautilus:

gio open ~/.local/share/applications

and then double click it. If that works,

eos-add-to-desktop rationalplan-single

should work. As it seems that you are using some deprecated keys in your desktop file, i recommend you to take a look at the current specification:

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html


#6

thanks @egrath !!
finally RationalPlan appeared on the desktop!! but … the bash script doesn’t run the application when i run from desktop :frowning:


#7

it can’t be executed with full path,

$ /sysroot/home/khairul/Downloads/RationalPlanS-5.3.7811/RationalPlan/RationalPlan.sh
Error: Could not find or load main class com.sbs.jpm.Main
Caused by: java.lang.ClassNotFoundException: com.sbs.jpm.Main

but can be run via ./RationalPlan.sh in that folder.

is it because of the JDK path?

export PATH=/sysroot/home/khairul/Downloads/jdk-12.0.2/bin:$PATH


#8

It seems, that the shell script for RationalPlan is using some relative paths. Add a

Path=/sysroot/home/khairul/Downloads/RationalPlanS-5.3.7811/RationalPlan

to your .desktop file and it should work (this will set the working directory before running the script)