Skip to content

Instantly share code, notes, and snippets.

@boyvanamstel
Created May 15, 2013 07:18
Show Gist options
  • Save boyvanamstel/5582167 to your computer and use it in GitHub Desktop.
Save boyvanamstel/5582167 to your computer and use it in GitHub Desktop.
Add this script to your ~/.bashrc (~/.zshrc, ~/.bash_profile etc) and it'll ask you if you want to run irssi when you start a terminal, unless irssi is already running. The script automatically chooses the default after a timeout (currently 3 seconds). Pressing return or n/N will skip it.
# Run irssi if it's not already running
ps cax | grep irssi > /dev/null
if ! [ $? -eq 0 ]; then
yn="y" # Set the default, if the timeout expires
echo -n "Run irssi? [yn] "
read -t 3 yn
case $yn in
[Yy]* ) irssi;;
* ) ;;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment