Skip to content

Instantly share code, notes, and snippets.

@timcowlishaw
Created May 22, 2012 07:54
Show Gist options
  • Save timcowlishaw/2767427 to your computer and use it in GitHub Desktop.
Save timcowlishaw/2767427 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