3 if [ -x /usr/bin/dircolors ]; then
4 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
5 alias ls='ls --color=auto'
6 alias dir='dir --color=auto'
7 alias vdir='vdir --color=auto'
9 alias grep='grep --color=auto'
10 alias fgrep='fgrep --color=auto'
11 alias egrep='egrep --color=auto'
15 ls_out=$(\ls -lah --color=always "$@")
16 let "allowed_lines = $(tput lines) - 3"
17 if [ $(echo "$ls_out" | wc -l) -le $allowed_lines ]; then
20 echo "$ls_out" | less -r
23 alias tmux='TERM=xterm-256color tmux'
24 if [ -x /usr/bin/gvim ]; then
30 control_file="$TMPDIR/${1}_ssh_in"
31 if [[ -e $control_file ]]; then
32 echo "Session is already open"
36 cat ~/.tmux.conf | ssh \
39 -o ControlPersist=yes \
41 'cat - > ~/.tmux_ssh.conf'
44 i3-sensible-terminal -e \
47 -o RemoteCommand=\"/bin/sh -c 'exec tmux -f ~/.tmux_ssh.conf new -As remote'\" \
48 -S \"$control_file\" \
51 ssh -O exit -S \"$control_file\" \"$1\""