local/bin/start.sh

   1 #!/bin/bash
   2 
   3 shopt -s nocasematch
   4 start(){ xterm -title "$1" -e bash -ic "$@"; }
   5 
   6 if [[ $TMUX ]]; then
   7     start(){ tmux neww -n "$1" "$@"; }
   8     x-www-browser(){ w3m "$@"; }
   9     rofi(){ echo "rofi $@" >&2; }
  10     gvim(){ vim; }
  11 fi
  12 
  13 case $1 in
  14     files) start ranger ;;
  15     editor) gvim --role pop-up ;;
  16     shell) start 'tmux attach -t Start || tmux new -s Start' ;;
  17 
  18     music) start mocp ;;
  19     calendar) start calcurse ;;
  20     contacts) start abook ;;
  21 
  22     mail) start mutt ;;
  23     news) start newsbeuter ;;
  24     browser) x-www-browser ;;
  25     torrents) start transmission-remote-cli ;;
  26 
  27     windows) rofi -show window ;;
  28     apps) rofi -show drun -modi drun,run -sidebar-mode ;;
  29 
  30     start) $0 $($0 | sed 's/.*/\u&/' | rofi -dmenu -i -p 'Start:') ;;
  31     audio) audio.sh $(audio.sh | rofi -dmenu -i -p 'Device:' | cut -f 2) ;;
  32 
  33     '') grep -o '    \w\+)' $0 | sort | sed 's/[) ]//g' ;;
  34     *) start "$*" ;;
  35 esac
  36