i have this bash script: test.sh that i would like to be able to find in my apps and/or as a favorite in my dock.
since i've never done that i relied on: Execute sh script from *.desktop file?
i then created a file: test.desktop
[Desktop Entry]
Name=TEST
Comment=bash copy/resize
Exec=bash ~/mybash/test.sh
NoDisplay=False
Terminal=False
Type=Application
Icon=~/usr/share/pixmaps/copy-resize.png
Categories=Accessories;
set permission to execute, and created /usr/share/applications
, /usr/share/pixmaps
and /mybash
in my home directory to start with.
I could right click it and run as application, but it was not visible in settings>applications
dragging it to the desktop didn't help, so found: Cannot launch .desktop files (opens with Text Editor instead)
since i did not know how to find the /.local folder i decided to copy the file:
sudo cp ~/usr/share/applications/test.desktop ~/.local/share/applications
It now can be found under settings>applications alas it is listed without the icon but i cannot find it under apps.
If i search in the app view (9 dots) i find the /.local/share/applications/test.desktop
listed as a text file and right clicking does not give me the option to set it to favorites and left it opens in geany (as it was made with that app)
if i try in a terminal:
bash ~/.local/share/applications/test.desktop
it starts the sh script, output in terminal:
/home/maarten/.local/share/applications/test.desktop: 1: [Desktop: not found
/home/maarten/.local/share/applications/test.desktop: 3: Cam: not found
starting gui...
and that does it's job, in the dock I see the icon I choose and a dot that it's active and the gui opens. so except for the icon location in settings>applications this part works. But double clicking still leads to the text editor. If placed on the desktop i can set 'allow launching' changing the file icon to a text document, but then double click does nothing.
the big question is Who can fill me in on what i missed in making this work?
At this moment i've copied test.desktop to:
(home)/test.desktop, (with/without allow launching)
/Desktop/test.desktop,
/.local/share/applications/test.desktop and
/usr/share/applications/test.desktop.
on all placed i can use a rightclick and choose to run as program, but nowhere does a double click lead to opening the file.