..:: PCSX2 Forums ::..

Full Version: Adding an Alias for PCSX2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For anyone who doesn't feel like typing "cd path/to/pcsx2/bin && ./pcsx2" every time you want to run it, I figured out a way to add an alias to make it easier (a bash alias, not the kind you see in Finder). If you don't already have a bash profile in your home directory create one now:

Code:
sudo touch ~/.profile

Then open it with whatever text editor you prefer (let's say nano):

Code:
sudo nano ~/.profile

Add the following line to the bottom and save it:

Code:
alias pcsx2='export TEMPPWD=`pwd` && cd /path/to/pcsx2/bin/ && ./pcsx2 && cd $TEMPPWD'

The first part creates a temporary variable called TEMPPWD and sets it to your current directory. Then it cd's to the pcsx2/bin directory and runs the executable. When you close PCSX2, it cd's back to whatever directory you started in. This is all you need to do if you launch it from Terminal, but it still won't work in xterm, since by default X11 doesn't start a login shell when you open it. You can fix that pretty easily, though:

Code:
defaults write org.x.X11 app_to_run "/usr/X11/bin/xterm -ls"

Now you can just open X11 and type "pcsx2" (without the quotes) and hit enter.
hey that could be done for windows too Laugh (in a totally different way {using environment variables} but it can be done Biggrin )
Would be better if it called chdir on it's own exe path, or accessed its files relative to that.