1 if [ -x /usr/bin/dircolors ]; then
2 alias ls='ls --color=auto'
3 alias dir='dir --color=auto'
4 alias vdir='vdir --color=auto'
5 alias grep='grep --color=auto'
6 alias fgrep='fgrep --color=auto'
7 alias egrep='egrep --color=auto'
11 ls_out=$(\ls -lah --color=always "$@")
12 let "allowed_lines = $(tput lines) - 3"
13 if [ $(echo "$ls_out" | wc -l) -le $allowed_lines ]; then
16 echo "$ls_out" | less -r
19 alias tmux='TERM=xterm-256color tmux'
20 if [ -x /usr/bin/gvim ]; then
26 control_file="$TMPDIR/${1}_ssh_in"
27 if [[ -e $control_file ]]; then
28 echo "Session is already open"
32 cat ~/.tmux.conf | ssh \
35 -o ControlPersist=yes \
37 'cat - > ~/.tmux_ssh.conf'
40 i3-sensible-terminal -e \
43 -o RemoteCommand=\"/bin/sh -c 'exec tmux -f ~/.tmux_ssh.conf new -As remote'\" \
44 -S \"$control_file\" \
47 ssh -O exit -S \"$control_file\" \"$1\""
51 quoted=$(python -c "import urllib.parse, sys; print(urllib.parse.quote_plus(' '.join(sys.argv[1:])))" "${@}")
52 w3m "https://duckduckgo.com/?q=${quoted}"
55 alias black='black --line-length 99'