Results 1 to 3 of 3

Thread: Running shell script with custom launcher

  1. #1
    Join Date
    Jul 2009
    Beans
    98

    Running shell script with custom launcher

    Hi all,
    Noob here

    I have a shell script named my_script.sh which works fine when I run it from the terminal.
    I have also created /usr/share/applications/my_app.desktop which looks like this:

    [Desktop Entry]
    Name=my app
    Exec=bash /path/to/my_script.sh
    Terminal=true
    Type=Application
    Categories=Utility;

    My new app is showing up in the menu but when I click it, nothing happens. Where am I going wrong??

    PS please ignore the attached image file

    Thanks in advance.
    Attached Images Attached Images
    Last edited by amarumayo; June 15th, 2013 at 07:28 PM.

  2. #2
    Join Date
    Aug 2012
    Location
    In front of the computer
    Beans
    159
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Running shell script with custom launcher

    If it's not a problem posting the script would help. You don't need to include bash in the Exec line, /path/to/my_script.sh will do. I suppose when you're running it from a terminal you run it from /path/to/, so adding the following to your launcher may help:
    Code:
    Path=/path/to

  3. #3
    Join Date
    May 2009
    Location
    Courtenay, BC, Canada
    Beans
    1,661

    Re: Running shell script with custom launcher

    if you need to see it, then set the launcher command to
    Code:
    gnome-terminal -x /path/to/script
    otherwise it will run in the background, silently

    note: unless you set gnome-terminal to stay open when finished, it will close when the script finishes

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
  •