Created
May 15, 2013 07:18
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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