Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I define settings, such as ircname, nick and such things, in .bashrc for Irssi?

share|improve this question

migrated from stackoverflow.com Sep 27 '09 at 1:15

This question came from our site for professional and enthusiast programmers.

    
Keep in mind that after successfully updating this, you need to /disconnect and reconnect, before they'll update. –  isomorphismes Nov 5 at 22:41

4 Answers 4

up vote 2 down vote accepted

The settings for Irssi go in ~/.irssi/config.

However, in general, any Bash environment variable is set in ~/.bashrc like this:

export varname=value

The real question is how do you get Irssi to use those variables?

share|improve this answer
2  
I'd like to keep my freenode password in an environment variable or external file, so I can keep my irssi config in a public dotfiles repository. Any suggestions? –  rizumu Apr 18 '11 at 10:31
    
From github.com/irssi/irssi/blob/master/docs/special_vars.txt, it appears that env vars are made available as variables in the config –  dimadima Oct 5 at 18:26

A much better way would be to set all these settings to your irssi config file. For example, this command will change the nickname:

/set nick Heoa

And every time you start irssi, this nickname will be used.


If you still want it - irssi supports these environment variables:

  • IRCNICK - nick
  • IRCNAME - real_name (the ircname line in /whois output)
  • IRCUSER - user_name (also called ident)
  • IRCHOST - hostname (you will probably never use this one)

Note that these environment variables are only set on the first run, and they are ignored if ~/.irssi/config exists.

share|improve this answer
1  
I'd like to keep my freenode password in an environment variable or external file, so I can keep my irssi config in a public dotfiles repository. Any suggestions? –  rizumu Apr 18 '11 at 10:32
    
@rizumu: Passwords in environment variables are a stupid idea, because every program would get a copy of it without even asking. As for external file... As for external files, you can have this on Freenode - by using a SASL authentication script. SASL is the preferred way of authentication on IRC. –  grawity Apr 18 '11 at 11:24
    
@rizumu: However, next time you have questions not directly related to my answer, please submit them as a separate post, not as a comment. –  grawity Apr 18 '11 at 11:24
1  
I now realize this should have been a separate question, but all searching led me here and it seemed related enough at the time. Well thanks for the tip. –  rizumu May 31 '11 at 19:47
1  
@isomorphismes: This information is sent only once when connecting; it cannot be updated in the middle of connection. (Also, it is /set and /whois.) –  grawity May 30 at 6:07

While I can imagine setting alias like:

alias irssi="irssi -c some.server -n your_nick"

it doesn't make sense. Irssi is very configurable, and it has a proper config file, so why don't you use it?

For example:

Start irssi, issue /network add; /server add; /channel add commands - best if you'd set the server and channel to auto-connect and autojoin.

Then, do /save, and quit irssi.

And then restart irssi, and voila - it will autoconnect everywhere you configured it to.

If you'll have any problems, just consult docs.

share|improve this answer

Try the following:

sudo gedit ~/.irssi/config

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.