You are not logged in.
Hi,
I installed a program from source, it's a biological structure modeling software. How can I make a shortcut so that I just type in the name of the program to get it to start? Thanks!
Offline
Add it to your ~/.bashrc in the path statement
Example:
PATH=$PATH:/path/to/your/app
Then close the shell and reopen it. Now you should just need to type the name of the app in the shell and it'll run.
Alternatively can you just make an alias to it in the same file.
Example:
alias bioapp="/path/to/your/app"
Now whenever you type the word, bioapp the shell will run the /path/to/your/app command.
Last edited by graysky (2009-05-26 22:58:41)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
There are two ways of doing it, depending on what you want to accomplish. Both require that you edit the file ~/.bashrc (I assume you use bash)
1) If the application places all the executable files in a given directory (let's say /opt/Application/bin/), you can access all those executables directly by simply telling your shell where to look (in the same way the shell automatically looks for executable files in eg. /usr/bin). In ~/.bashrc, you would have to add a line that looks like this:
PATH="$PATH:/opt/Application/bin"
2) If you just want to make a traditional "shortcut" that executes a given command, this can be done with alias. Add this command to your ~/.bashrc:
alias shortcut="some command"
In this case, typing shortcut into a terminal will be interpreted just like if you had typed some command instead.
In order to try out these changes, either restart your terminal or run this command:
source ~/.bashrc
[EDIT]
I was obviously beaten to it
Last edited by Peanut (2009-05-26 23:12:47)
Offline
thanks!
Offline
I went with the second option the 'alias' and everything works from terminal. I'm an openbox user using gmrun and it doesn't work from there, why is that?
Offline
I think you just have to re-login in order for openbox to load the new bashrc.
Offline
I use the following alias to reload my .bashrc:
alias reload='source ~/.bashrc'
< Daenyth> tomkx: my girlfriend is linux
< Daenyth> srsly
< Daenyth> she loves the way I «make install»
< Daenyth> all her /dev entries are mode 7 for me
Offline
You can add a script to /usr/bin and gmrun will recognize that.
Also, I believe gmrun has the ability to run shell commands:
sh: command
But I am not sure on that though, check your gmrun config file for more info.
br0tat0chip in #archlinux and on freenode
Offline
To get it to work from gmrun try something like this (which will also make your alias unnecessary):
ln -s /path/to/bioapp /someplace/in/your/$PATH/bioapp
Offline
what do you mean by "/someplace/in/your/$PATH/bioapp"
Offline
what do you mean by "/someplace/in/your/$PATH/bioapp"
eg # ln -s /path/to/bioapp /usr/bin/bioapp
Offline
what do you mean by "/someplace/in/your/$PATH/bioapp"
Pick one of these:
echo $PATH|sed 's/:/\n/g'
Offline
Hi,
I installed a program from source, it's a biological structure modeling software. How can I make a shortcut so that I just type in the name of the program to get it to start? Thanks!
A small tip. makepkg is quite handy to avoid future problems, like uninstall/upgrade. I wrap anything larger than personal scripts in arch packages. Only take a minute or two extra.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline