So, today, I wanted to install a famous text editor called "Sublime Text 2" in my Ubuntu installation. I downloaded the tar file provided by them. Like many programs, I found no installer package or program but just the executables. Yes it was usable but I wanted more. I wanted to call the program with it's name not always navigate to the directory where I downloaded it just to use it. So I found this tutorial here and made it accessible via both Unity Dash and CLI (Terminal). I realized I often fall into this kind of problem when I'm using Ubuntu / Linux in general. So, I decided to write down the things I have to know when I'm doing such a thing.
First of all, you need to move your executables folder to the /usr/lib directory. Suppose you're too installing Sublime Text. You extract it via the tar tool like this.
First of all, you need to move your executables folder to the /usr/lib directory. Suppose you're too installing Sublime Text. You extract it via the tar tool like this.
tar xf Sublime\ Text\ 2\ Build\ 2181\ x64.tar.bz2Then you get the folder "Sublime Text 2". You move it to the /usr/lib directory using this command.
sudo mv Sublime\ Text\ 2 /usr/lib/Now you create a Symbolic Link, more like a Command to call the application via command line interface (CLI) using this
sudo ln -s /usr/lib/Sublime\ Text\ 2/sublime_text /usr/bin/sublimeNow create a launcher (icon you search for using HUD)
sudo sublime /usr/share/applications/sublime.desktopEdit that .desktop file (specify what it does) and configure it to run Sublime Text when it's clicked on, paste all this in it, you can even spend time trying to understand it (for future applications)
[Desktop Entry] Version=1.0 Name=Sublime Text 2 # 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=sublime #The symbolic link Terminal=false #Don't run it using terminal Icon=/usr/lib/Sublime Text 2/Icon/48x48/sublime_text.png #Which icon to use Type=Application #Type type type :P Categories=TextEditor;IDE;Development #More info X-Ayatana-Desktop-Shortcuts=NewWindow [NewWindow Shortcut Group] Name=New Window Exec=sublime -n TargetEnvironment=UnityThat's it, now you can run the program using terminal (without pointing to where it's stored) and click on a launcher to run it. :)
No comments:
Post a Comment
Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.