Openbox autostart.sh and setting alias on openbox start
I want run the following command to set an alias to use gvim when running an Openbox session and vim when on the console.
Code:
if which gvim > /dev/null ; then alias vi='gvim' ; else alias vi='vim' ; fi I tried adding it to ~/.xinitrc and ~/.config/openbox/autostart.sh but the alias does not get applied. I also tried: Code:
x-terminal-emulator -e "if which gvim > /dev/null ; then alias vi='gvim' ; else alias vi='vim' ; fi" How can I apply this alias when only running and openbox/X session? |
Edit: The below previous post doesn't work OK as my tty was just set to /dev/pts/1..... any suggestions appreciated.
I ended up using the following in ~/.bashrc Code:
if [[ "$(tty)" = "/dev/pts/0" ]] && [[ $(which gvim) ]] ; then |
All times are GMT -5. The time now is 05:13 PM. |