Skip to content

Instantly share code, notes, and snippets.

@dideler
Created August 2, 2012 04:33
Show Gist options
  • Save dideler/3233590 to your computer and use it in GitHub Desktop.
Save dideler/3233590 to your computer and use it in GitHub Desktop.
How to naturally run a program/script in Ubuntu

Symbolic Link

Use this when you don't want the actual program in a folder in your $PATH.

  1. Move folder to /usr/lib/ (optional)

     sudo mv program_directory /usr/lib
    
  2. Create a symbolic link in /usr/local/bin/

     sudo ln -s /usr/lib/program_directory/program /usr/local/bin/program
     # Now you can launch the program from anywhere in the terminal by typing "program".
    
  3. Create a launcher in Unity (optional)

     sudo program /usr/share/applications/program.desktop
    

Place the program in your path

  1. mv path/to/program /usr/local/bin or to some other directory in your PATH.
[Desktop Entry]
Version=1.0
Name=Program Name
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=program
Terminal=false
Icon=/usr/lib/program_directory/icon.png
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
Exec=program -n
TargetEnvironment=Unity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment