3

I want to add a keyboard shortcut to launch a program I typically open from the terminal. The terminal command I setup for it is julia (which points to the relevant binary in my PATH).

So I added a keyboard shortcut under Settings (I am in Ubuntu 18.04)

enter image description here

enter image description here

but it doesn't do anything. I think maybe the issue is I have to tell it somehow that this is a terminal program?

  • you need to provide the full path to the executable. – digiwizkid Nov 8 at 13:38
  • @digiwizkid I tried /usr/bin/julia, but it also doesn't work. Note that I have a julia binary under /usr/bin/, which is on my PATH. – becko Nov 8 at 13:44
3

You can use: bash -c "gnome-terminal -x application" to open a terminal, note that it exits once the application opened stops running.

bash -c "gnome-terminal -x julia"

2

You could create a .desktop file with the following content:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Icon=/path/to/icon/icon.png
Exec=julia
Name=julia

Put this file into ~/.local/share/applications and make it executable by chmod +x . Then you should be able to add a keyboard shortcut to it.

  • Have to argue that even though this is a good solution I prefer over keyboard shortcuts, it's also a correct answer to another question. – Smurfz87 Nov 8 at 14:16
  • @Smurfz87 I will agree that as it is written here, it is not a complete solution to the question. i just have to find out where the desktop file has to be put, so that OP can add a keyboard shortcut to it. Any ideas on that? – Bruni Nov 8 at 14:19
  • ~/.local/share/applications ? – Smurfz87 Nov 8 at 14:21
  • @Smurfz Thank you! I ll adjust my answer. – Bruni Nov 8 at 14:23
  • Hi.. I would like to know what will be the keyboard shortcut command to enter in this case? ~/.local/share/applications/julia.desktop ?? – PRATAP Nov 8 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.