I would like to be able to have an option in the default file manager to run an executable file in terminal like I have in KDE/Dolphin.

This is useful in order to see the output (that could be temperature, countdown, etc...)

I know how to create contract files, but what I need is the line starting with Exec=, namely I need to know what terminal to use and with what arguments.

  • Can you point me at the documentation for contract files? I can't find it.
    – Mike Wild
    Jan 25, 2017 at 9:41
  • @MikeWild - I cannot, but I have found the answer for the default terminal.
    – user170
    Jan 25, 2017 at 10:02
  • Can you post it? The best I got was this: pastebin.com/mSEbZDuT. But I couldn't get it working.
    – Mike Wild
    Jan 25, 2017 at 10:04
  • @MikeWild - see below; the selected file has to be a proper executable script
    – user170
    Jan 25, 2017 at 10:06

1 Answer 1

gedit ~/.local/share/contractor/run_in_terminal.contract


[Contractor Entry]
Name=Run in terminal
Exec=pantheon-terminal -e %f

Not any file can be run like this, the selected file has to be a proper executable script.

  • What is the difference between %U, %F, and %f?
    – Mike Wild
    Jan 25, 2017 at 10:11
  • 1
    @MikeWild - I don't know much about it, I know %f is a single selected file name, %u is a URL that can be a path, the uppercase forms are usually multiple files or paths. But I don't really understand the subtle differences. I have found this: specifications.freedesktop.org/desktop-entry-spec/… - also: i.sstatic.net/zqyjf.png
    – user170
    Jan 25, 2017 at 10:30
  • I can confirm that this works Feb 9, 2017 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.