-1

trying to create a desktop shortcut for

flatpak run org.gimp.GIMP//beta

Not sure how to use a command instead of an executable. I saw another answer but it was 2013. It said to create a .sh file based on this command. But I do not know how to create a .sh file like that. It would be nice if someone could help. Thanks.

user227495
  • 4,089
  • 17
  • 56
  • 101
  • Not sure why you are giving me how to create a shortcut. As you can see from the answer posted by me, I am well aware of the process. I need an answer to how to use a command as a desktop shortcut to launch an application which needs that specific command to run. I thought using a .sh and using it in .desktop was the only way. Then I figured out that I can use the command directly in the .desktop. If you actually wanted to help than negative voting my totally valid question, you could have at least shared how to create a .sh out of a command, which was the clear intention of my question. – user227495 Sep 27 '23 at 09:54
  • I didn't downvote it or your answer either, but it's not clear to me why you can't run the required command(s) directly as a bash one-liner in the Exec line of the desktop launcher without making it into a shell script. That is what I got wrong if anything. – karel Sep 27 '23 at 10:05
  • Functionally, there is no difference between a bash shell script and a bash one-line command that is derived from it. Both can be used to execute the same sequence of commands. The main difference is that a bash shell script is a file that contains a sequence of commands, while a bash one-line command is a single line of code that contains a sequence of commands. – karel Sep 27 '23 at 10:40
  • Understood, thanks. I did see a 2013 topic where it was (bash in .desktop) displayed. Most topics were a bit old and I was not sure whether to adopt them blindly. I do not understand bash well but know enough that a wrong command can do more harm than good. That is I thought of starting a new topic. – user227495 Sep 27 '23 at 11:41

1 Answers1

-1

You can simply put the command in the executable entry as seen below

in a text file and save it as GIMP299.desktop

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec= flatpak run org.gimp.GIMP//beta
Name=GIMP 2.99
Icon= /path/to/icon

Save the file, allow to Run as program and allow launching by right click.

user227495
  • 4,089
  • 17
  • 56
  • 101