Results 1 to 8 of 8

Thread: running console applications from nautilus

  1. #1
    Join Date
    Nov 2010
    Location
    Italy
    Beans
    10
    Distro
    Ubuntu 10.10 Maverick Meerkat

    running console applications from nautilus

    Hi everyone,

    I'm coding some very simple console applications for university work, but trying to run them from nautilus results in no output.

    As opening a terminal each time is cumbersome and annoying, is there an easy way to automatically have the application running in a terminal?

  2. #2
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: running console applications from nautilus

    Quote Originally Posted by ampetrosillo View Post
    Hi everyone,

    I'm coding some very simple console applications for university work, but trying to run them from nautilus results in no output.

    As opening a terminal each time is cumbersome and annoying, is there an easy way to automatically have the application running in a terminal?
    hi
    you can create in your ~/Desktop a file like this:

    [Desktop Entry]
    Version=1.0
    Name=test
    Comment=test
    Exec=/bin/bash # for /bin/bash use the path to your application
    Icon=/home/richi/flippig/minixlogo02.png
    Terminal=true
    Type=Application
    Categories=Utility;Application;
    Name[de_DE]=test_ap

    1. filename must end with .desktop
    2. belongs to you
    3. Terminal=true !!!!
    4. but when your aplication exit the terminal will be closed
    if you want you can copy the icon you used to the desktop
    if you double klick on the icon the app will start in a terminal
    ciao
    Last edited by rnerwein; January 8th, 2013 at 05:42 PM.
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  3. #3
    Join Date
    Jun 2007
    Location
    Minneapolis, MN
    Beans
    749
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: running console applications from nautilus

    Use alacarte to create a launcher.
    Change "Type" to "Application in terminal.
    The alacarte program is called "Main Menu"
    It is located in Applications=>System Tools=>Preferences.
    Moderation in all things; including moderation.

  4. #4
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: running console applications from nautilus

    Yes there are several way to do such things.

    0. You can easily open terminal windows by the hotkey combination (press all 3 keys at the same time)

    ctrl + alt + t

    1. It is possible to install a plug-in in Nautilus, to right-click and open a terminal window in the current directory.

    2. You can make a .desktop file, that is clickable and will run your application in a terminal window.

    3. You can have one or many terminal windows open and run the applications with & at the end of the command line. This means that they run in the back-ground (detached from the terminal window).

    ... (others may suggest more ways to work)
    Last edited by sudodus; January 8th, 2013 at 05:45 PM. Reason: ... they already have ...

  5. #5
    Join Date
    Oct 2010
    Location
    India
    Beans
    32
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: running console applications from nautilus

    When you execute an executable file from nautilus, it asks if you want to run it in terminal.

    To make it executable, right click on your file > permissions > tick "Allow executing file as a program" and then double click on it.
    What do you mean by you don't see the output?
    Your program runs in terminal and terminal closes down automatically and that's why you don't see any output?
    If that's the case, add a line at the end of your program which asks for user input, so the terminal waits for user input and you will be able to see your program output.
    IF you are looking for stability, stick with LTS. The interim releases (between LTS releases) aren't meant to be stable, they are used to try out new features that will be included in the next LTS release.

  6. #6
    Join Date
    Nov 2010
    Location
    Italy
    Beans
    10
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: running console applications from nautilus

    Thanks, but I'm using Ubuntu 12.10, and I don't have the familiar Applications -> System Tools menus (but I have to use the Unity lens, and searching for "Main Menu" doesn't yield any results).

    Alacarte doesn't seem to be installed, I might as well install it, but if you can explain to me how to custom write a launcher (I haven't really understood, based only on rnerwein's post, sorry), using simply a text editor, I might just do that.

    I tried making a <whatever>.desktop file, but it doesn't seem to work.

    Anyway, I'm doing console applications in C (ie. executable files), not shell scripts, so I don't get any dialog boxes such as the one referred to by bhaveshnande.

  7. #7
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: running console applications from nautilus

    Yes, custom write a launcher using simply a text editor

  8. #8
    Join Date
    Jun 2007
    Location
    Minneapolis, MN
    Beans
    749
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: running console applications from nautilus

    Quote Originally Posted by ampetrosillo View Post
    Thanks, but I'm using Ubuntu 12.10, and I don't have the familiar Applications -> System Tools menus (but I have to use the Unity lens, and searching for "Main Menu" doesn't yield any results).

    Alacarte doesn't seem to be installed, I might as well install it, but if you can explain to me how to custom write a launcher (I haven't really understood, based only on rnerwein's post, sorry), using simply a text editor, I might just do that.

    I tried making a <whatever>.desktop file, but it doesn't seem to work.

    Anyway, I'm doing console applications in C (ie. executable files), not shell scripts, so I don't get any dialog boxes such as the one referred to by bhaveshnande.
    I gave you instructions based on Ubuntu 10.10 bacause that is what it says in your user profile.
    For 12.10 you will need to install alacarte, use the command:
    Code:
    sudo apt-get install alacarte
    You can then search for either "alacarte" or "Main Menu" with the Unity lens to find it.

    To learn how to write a .desktop file look at the existing .desktop files.
    They are in /usr/share/applications.
    The .desktop files you create with alacarte are in /home/USERNAME/.local/share/applications
    Last edited by JRV; January 8th, 2013 at 06:18 PM.
    Moderation in all things; including moderation.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •