Skip to content

Instantly share code, notes, and snippets.

@yeled
Forked from timcowlishaw/gist:2767427
Created May 22, 2012 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yeled/2767431 to your computer and use it in GitHub Desktop.
Save yeled/2767431 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
COMMAND_NAME=`basename $0`
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PATH="$(echo $PATH | sed s#`echo $DIR | sed 's#\\/#\\\\\\/#g'`:##g)"
COMMAND="$(which $COMMAND_NAME)"
if command -v urxvt > /dev/null 2>&1; then
urxvt -name $COMMAND_NAME -e $COMMAND "$@" & disown -h
else
$COMMAND "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment