A script to launch irssi within screen

Why bother opening a term, running screen and then running irssi, when it can all be automated.

irssi.sh

#!/bin/bash
if [ `screen -ls | grep irssi | wc -l` -ne 0 ]
then
	urxvt -title irssi -name irssi -e sh -c "screen -dr `screen -ls | grep irssi | sed -e 's/(\(Attached\|Detached\))//'`"
else
	urxvt -title irssi -name irssi -e sh -c "screen -S irssi irssi"
fi

If there is no exisiting screen session running irssi this script opens a new terminal and runs irssi within screen, otherwise it reconnects to the existing session.

The terminal it opens (urxvt) is named irssi, so that it can be themed separately in .Xdefaults and handled by your wm – e.g. awesome sends the irssi terminal to my ‘IM’ tag.

Urxvt themed in two ways
Urxvt themed in two ways
Advertisements
A script to launch irssi within screen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s