screen irssi load script

December 3, 2005

This is a very useful script I wrote to load and run irssi in screen. I aliased it in .bash_profile to "irc". So, now I just run "irc" and if irssi has not been placed in screen already it will run irssi in screen; otherwise, it will attach irssi to the irc screen session. It makes running irc with screen superduper fast.


#!/bin/bash
# Run/Load IRC Script
# This script runs irssi in screen if it has not already been done.
# If irssi in screen is already running, it will then attach to
# the irc screen session for you.
if screen -ls | egrep '^[[:space:]]+[^[:space:]]' | awk '{print $1}' | egrep '.irc$'
then # running
screen -x irc
else # not running
screen -c ~/.screenrc.irc -S irc -t irssi irssi
fi

And here is .screenrc.irc


# detach on hangup
autodetach on
# multiusers
multiuser on
# no copyright notice during startup
startup_message off
# remove some bad bindings
bind k  #kill
bind ^k #kill
bind .  # dump termcap
bind ^h # hardcopy
bind h  # hardcopy
bind A  # title (clashes with vim's increment)

Something also useful: /bind meta-home scroll_start and /bind meta-end scroll_end (to scroll buffer to beginning and end with alt+home and alt+end, respectively).

3 Responses to “screen irssi load script”

  1. omegabeta said

    Very useful, where do i put the .sh file so that i can call it from anywhere?

  2. map2 said

    comment – map2

  3. [...] j’oublie régulierement de lancer mon Irssi dans screen, j’ai utilisé un alias et une astuce pour lancer screen automatiquement quand je tappe “irssi”. [...]

Leave a Reply