Create a short cut to a program that needs to be started from a console

KDE desktop,

I feel stupid because I can’t get the shortcut working.

On my desk top I made a new desktop.

What I want to start is a jar file, this is a java file, and the command from the console to start it is:

java -jar sheepit-client-6.2020.0\(1\).jar

From the console this command works, but I must have made a mistake because when I click the short cut, it get’s opened with kate.

I checked under advanced options, execute in a terminal. and typed in the command.

Because I googled I also found that on some Ubuntu versions, you can right click the .jar file, then select open with java. I tried that but I can select java on openSUSE.

For those wondering what this is is about:

Run it from a bash/sh script and a desktop file;

java -jar sheepit-client-6.2020.0\(1\).jar

Save into ~/bin and chmod 0755 it and check it works as required from the command line, then create your shortcut or whatever is needed.

A really simple approach?
Find a popular java app, install it and then use it as a template for the app you want to set up.

So, for example…
I like to use JDownloader as my cross-platform streaming downloader that can download practically anything you want in greatest detail (point it at a YouTube video and you’ll be amazed how many things a common downloader doesn’t expose to you).

Inspect the Desktop shortcuts and menu entries it creates (YMMV depending on your Desktop).
For JDownloader, I also used it as an example how to create a menu entry for the LXDE and LXQt Desktops
For any other Desktop, you’d probably use the same connection string but set up the shortcut or menu entry differently.

BTW - note the Exec-java command plus various optional flags


I managed to make a bash script ? rotfl!
With the hint given by Malcom nand some googling.

Started a txt file, with kate, and although, I was wondering if it could work, everything on Linux is a file so why not try.
Saved it as a .sh file.
I had put in two lines and it did not work, until I released I needed to add the path to the file.
Then saved it as

java -jar /home/username/Downloads/sheepit-client-6.2020.0.jar

I really need to find a book or course on the Linux (openSUSE ?) cli. ( any suggestions ? )
Then maybe make some cheat sheet.

Copy and move command. ( I tried and failed )
How to make text files on the command line, vi ?

But of course I have dolphin and kate to get around my cli limitations. :slight_smile:

So I copy pasted the file with dolphin to ~bin.

Now I only need to figure out how to do the shortcut, but I suspect that to be simple now.

I have a working bash script and it’s my first. There might be hope for me to really learn Linux yet.

Thank you guys.

Problem solved.

Created a short cut and pointed it to the script ( Downloaded a sheep it logo picture, to use with the shortcut. :slight_smile:
Now it even looks nice.

Any suggestions on any good Linux and or sopensuse courses on the cli ?

You may start with bash:

For your specific commands (cp and mv),
The help and MAN pages are probably most convenient.
The help is abbreviated so it’s fastest but maybe so abbreviated it’s incomprehensible.
The MAN pages are typically exhaustively detailed

cp --help
man cp

And, although you can skip creating the file first by simply starting to edit a “file to be named” with vi and saving your edits

vi newfile

You can always create an empty file with touch

touch newfile

For practical commands and some beginning script building, I’ve posted some articles in my Wiki.
The Wiki for beginning scripts includes a simple online editor that’ll catch errors
Each page more often than not is more than just how to execute a command, it also is an example and illustration of something more

Probably the most comprehensive reference for all things Linux scripting is The Linux Documentation Project


How about adding a new item to “Applications”?

  • click on Application Launcher
  • right click in the top
  • select “Edit Applications”
  • click “New Item”
  • enter “name” and “command”
  • select a suitable icon
  • save


Omg this is embarrassing. I had of-course googled, and found one page that did help but it was from a mac user, who said this will work on Linux too.
He said to use touch, and I assumed because I never had heard of this command, it would be a mac thingy.

Even though I know mac os and Linux have the same roots, UNIX.

Learning moment about not to draw conclusions too fast.

Bookmarked the links. :slight_smile:

Learning new stuff, thank you. :slight_smile:

Thank you :slight_smile:

I might be going into town to a certain bookstore.

Lets see if I can find out what in the book. :slight_smile:

I do not know the book, but it looks as being specific about openSUSE Leap 15.2. IMHO that would mean that it assumes you are fluent with Unix/Linux already and that the book then woudl teach you the differences, details and specialties of this version assuming certain knowledge.

BTW, you seem to be in the Netherlands. When you also speak Dutch, I assume you are aware of

There are there no starters in bash programming. They assume that you have at least a basic knowledge about bash. The third section “De onleesbare shell commando’s” is however something you will need very soon after you started writing bash commands.

Thank you, and that why I did not order that book yet, I can’t find online what it is about.
I might go to that store though, and look if does the basics of bash.

Gonna read the link you posted a few times.

When I google I often stumble on the same problem, lacking some basic cli knowledge.

It’s a compliment to openSUSE in a way, that I after so many years on openSUSE, still suck at the command line. :slight_smile:
Think version 9.3 was my first, not called openSUSE yet, if I recall right.