[download]

local/bin/term

   1 #!/bin/bash
   2 
   3 xterm=xterm
   4 xfce4=xfce4-terminal
   5 
   6 [[ $1 == -* ]] && shift
   7 [[ $DISPLAY ]] || exec tmux splitw -v "${@//\~/~}"
   8 
   9 [[ $# == 0 ]] && {
  10     $xfce4 ||
  11     $xterm &
  12     exit
  13 }
  14 
  15 [[ $1 == /* ]] && {
  16     $xfce4 -x "$@" ||
  17     $xterm -e "$@" &
  18     exit
  19 }
  20 
  21 s=${1%% *}
  22 set -- "printf \"\e]0;${s^}\a\"; $@"
  23 $xfce4 -x $SHELL -ic "$*" ||
  24 $xterm -e $SHELL -ic "$*" &