From 96500da2b1430bff690d368bd2f0ccec23305aa8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 2 Aug 2016 10:50:32 +0300 Subject: [PATCH] .shellrc: test existing of programs before creating wrappers for them --- .shellrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.shellrc b/.shellrc index 7b362b8..2b79a64 100644 --- a/.shellrc +++ b/.shellrc @@ -165,8 +165,7 @@ KillAll() { } -# git-related - +if test -x /usr/bin/git >/dev/null 2>&1; then # chdir to a remote's directory (if the remote is on the local FS) cdremote() { cd "`git config --get remote.$1.url`" @@ -204,6 +203,7 @@ if test -n "$BASH_VERSION"; then complete -F _git_open git-open fi +fi include() { @@ -308,6 +308,7 @@ mkcd() { } +if which tmux >/dev/null 2>&1; then tmux() { case "$TERM" in rxvt) @@ -319,6 +320,7 @@ tmux() { ;; esac } +fi #if which pyenv >/dev/null 2>&1; then @@ -331,5 +333,8 @@ if [ -f /usr/local/bin/virtualenvwrapper_lazy.sh ]; then fi +if [ "$SHLVL" -eq 1 ] && which startx >/dev/null 2>&1; then X() { startx >> .Xserver.log 2>&1; cyr; } +fi + x() { exit; } -- 2.39.5