Search:  
Gentoo Wiki

TIP_Irssi_init_script

This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

This is a little script I wrote up to make irssi always load at boot.

File: /etc/init.d/irssi
#!/sbin/runscript
# By ObsidianX
# Place in /etc/init.d.. for Gentoo Linux only
# $Header: $

depend() {
    use net
}

start() {
    ebegin "Starting irssi session"
    start-stop-daemon --start -v -b -x /bin/su -p /tmp/irssi.screen.session -m --chdir /home/ryan -- - ryan -c "screen -D -m -S irssi -- irssi -c  efnet" 1>>/log.irssi
    eend $? "Failed to start irssi"
}

stop() {
    ebegin "Stopping irssi"
    start-stop-daemon --stop -x /bin/su -p /tmp/irssi.screen.session -q
    eend $? "Failed to stop irssi"
}

Of course you'll need to change a few things when you use it.

... --chdir /home/ryan ...

Should have your home folder there, not mine.

... -- - ryan -c ...

Should have your username there so `su` can know what user to use.

After it starts to access it simply do the following in any terminal:

screen -x irssi

You can also do `screen -r irssi` if you want exclusive access to the screen session. NOTE: need verification on this, not positive. Also, to exit without exiting irssi and the screen session push ctrl+a release it, then press d, it will detatch and leave irssi running in the background.

For more useful information on screen, you can see this other TIP about Screen.

(for some reason, I could not get this runscript to function without '# $Header: $' at the place where i put it)--M0zes

Enjoy!

-ObsidianX

Retrieved from "http://www.gentoo-wiki.info/Irssi/init_script"

Last modified: Fri, 29 Aug 2008 04:52:00 +0000 Hits: 15,723