Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xo() {
- xo_exit() {
- disown
- exit
- }
- case "$1" in
- g:*)
- exo-open "https://www.google.ru/search?q=`echo $* | sed 's/g\://'`" &
- xo_exit
- ;;
- w:*)
- exo-open "https://ru.wikipedia.org/wiki/`echo $* | sed 's/w\://'`" &
- xo_exit
- ;;
- esac
- if (( $+commands[$1] ))
- then
- $* &
- xo_exit
- elif [ -e "$1" ]
- then
- if [ -x "$1" ] && [ ! -d "$1" ]
- then
- if [[ "$(dirname $1)" = "." ]]
- then
- ./$* &
- xo_exit
- else
- $* &
- xo_exit
- fi
- else
- exo-open "$1" &
- xo_exit
- fi
- else
- exo-open "$1" &
- xo_exit
- fi
- }
- _xo()
- {
- _arguments '1: : _alternative "commands\:commands\: _command_names -e" "files\:files\:_files"' '*:: : _normal';
- };
- compdef _xo xo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement