Advertisement
zaiger

My perfect Irssi setup

Jan 20th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.75 KB | None | 0 0
  1. My perfect Irssi setup
  2.  
  3. Here it is! The new and updated version of my perfect Irssi setup! The way I like to customize Irssi to make it perfect for me. You probably have different taste so you can either use everything as it is or just some of it as inspiration. If you have any suggestions, please drop a comment below.
  4.  
  5. This updated guide uses new and cool functionality from BitlBee 3. Some of the Irssi scripts are replaced with better versions and I have made the guide a bit more user friendly by including more detailed support on how to use Irssi, BitlBee, the scripts and installing everything in Ubuntu. I’ve also tried to link to other guides of the more complicated parts.
  6.  
  7.  
  8.  
  9. Overview
  10. Installation
  11. Basic Irssi usage
  12. Scripts
  13. Themes
  14. BitlBee
  15. Setting up BitlBee with Twitter and Google Talk
  16. Nicklist
  17. Xchat nick color
  18. Hilight window
  19. Advanced Window List
  20. Auto Away
  21. Autoreply (BitlBee)
  22. Status notice (BitlBee)
  23. OTR encryption for Irssi and BitlBee
  24. Notifications
  25. Last.FM
  26. Installation
  27. This guide focuses on Ubuntu since it is one of the most common platforms. Everything else in the guide is however the same everywhere.
  28.  
  29. I have created a shell script which download everything in this tutorial. Use it only if you want to use everything and autoload all scripts. It will ask you if you want to install the Ubuntu packages (use only if you have Ubuntu Lucid or greater with Backports enabled) which requires root password. If you run any other distro or older version of Ubuntu, press “n” (no), an install the manually. The scripts will be downloaded anyway.
  30.  
  31. To run it:
  32.  
  33. wget http://files.kungfoocode.org/kungfooirssi.sh
  34. chmod +x kungfooirssi.sh
  35. sh kungfooirssi.sh
  36. I Will presume that you have not executed the script and through the guide provide necessary setups to install everything “manually”.
  37.  
  38. To install everything we need (in Ubuntu Lucid or greater, enable Backports), type:
  39.  
  40. sudo apt-get install irssi bitlbee screen bitlbee-plugin-otr libtime-duration-perl libnotify-bin irssi-plugin-otr
  41. This will install the latest (currently) version of Irssi, BitlBee 3 and Screen. It is important that you have Backports or you will not get Bitlbee 3. You need screen for the nicklist-script and it is totally awesome on its own so you should learn to use it anyway.
  42.  
  43. Learn more about Irssi and Screen: http://quadpoint.org/articles/irssi
  44.  
  45. Now type irssi in your terminal to get going!
  46.  
  47. Basic Irssi usage
  48. All Irssi-commands starts with a forward slash /. You can use the tab-key to auto-complete commands and you can browse through all commands by pressing tab several times.
  49.  
  50. First of all you should set your nickname:
  51.  
  52. /nick my-cool-nickname
  53. If you want to connect to a IRC-server you can use either /server or /connect. Using /server will kill the old connection (if you have one) but using /connect will establish a new parallel connection so that you can have several active connection.
  54.  
  55. If you want to auto connect and join channels on start up you can use:
  56.  
  57. /server ADD -auto -network NetworkName irc.host.com 6667
  58. /channel ADD -auto #channel NetworkName password
  59. To switch between servers press CTRL + X. To switch between windows / channels press ALT + number or use:
  60.  
  61. /window number
  62. To use the ALT-combination on numbers higher than 10 (which uses key 0) you can use the letters below the numbers on a qwerty-keyboard. ALT+Q = 11, ALT+W = 12 and so forth.
  63.  
  64. To close a window use:
  65.  
  66. /wc
  67. When you have customized Irssi as you wanted it, execute:
  68.  
  69. /save
  70. This will save all your settings and apply the current theme.
  71.  
  72. Consult the official manual to get more information about commands and features.
  73. http://irssi.org/documentation/manual
  74.  
  75. Scripts
  76. The really great thing about Irssi is that there are thousands of scripts and customizations. I will walk you through my favorite scripts further down.
  77.  
  78. Irssi scripts are written i Perl and are usually located in ~/.irssi/scripts/. To load a script you can use the /script command:
  79.  
  80. /script load mycoolscript.pl
  81. Or you can auto-load the scripts so you don’t have to use the script command every time you start Irssi. You can do this by putting the .pl-file in a folder called autorun in the scripts folder ~/.irssi/scripts/autorun/.
  82.  
  83. You can find a lot of scripts on Irssi’s official script site.
  84. http://scripts.irssi.org/
  85.  
  86. Themes
  87. There are tons of themes. I use a theme called xchat which you will see in this guide. You can find a lot of themes if you Google for it or visit the official Irssi Theme page:
  88. http://irssi.org/themes
  89.  
  90. The xchat theme is located at http://irssi.org/themefiles/xchat.theme
  91.  
  92. To load a theme (located in ~/.irssi/):
  93.  
  94. /set theme xchat
  95. Replace xchat with the name of your theme of choice.
  96.  
  97.  
  98.  
  99. Note that I use a special script with this theme. You can read about it further down.
  100.  
  101. Bitlbee
  102. BitlBee is an “IRC to other networks gateway”. This means that you can use the protocols XMPP/Jabber (used by Google Talk and Facebook chat), MSN Messenger, Yahoo! Messenger, AIM and ICQ from inside and IRC-client like Irssi. You can connect to a public server but there is no hassle setting up your own which means that your information (like passwords and chat records) isn’t transmitted to any unknown servers.
  103.  
  104. This guide uses BitlBee 3.0.1 which you can install in Ubuntu Maverick Lucrid or gerater (enable Backports) by executing:
  105.  
  106. sudo apt-get install bitlbee
  107. You can control the BitlBee service from your terminal:
  108.  
  109. sudo service bitlbee {start|stop|restart|force-reload}
  110. The config file is located at /etc/bitlbee/bitlbee.conf . Look it up and customize it for your own needs. You need to restart the service if you make any changes to the configuration file.
  111.  
  112. When you are ready to connect to your BitlBee server (and if you haven’t changed any configurations) execute the following in Irssi:
  113.  
  114. /connect localhost
  115. Once you are connected you should get a channel called BitlBee. This is where your contacts will be located and where you execute all your BitlBee commands. The first thing you should do is to go to the channel and register a new account.
  116.  
  117. Do this by typing this in the BitlBee channel:
  118.  
  119. register (password)
  120. Make sure that you have the nickname which you want to use and note that we want to send command to the Bitlbee-channel and not to Irssi so make sure you don’t have a / in front of any commands to Bitlbee.
  121.  
  122. The next time you return to Bitlbee you’ll use:
  123.  
  124. identify (password)
  125. To load all of your accounts.
  126.  
  127. What we need to do now is to add one of your IM-accounts to Bitlbee. The syntax for this is:
  128.  
  129. account add (protocol) (username)
  130. /OPER
  131. Note that we used the Irssi command /OPER to hide the password instead of typing it directly to BitlBee.
  132.  
  133. To list all of your accounts:
  134.  
  135. account list
  136. All accounts are numbered and these numbers are used when modifying and connecting etc.
  137.  
  138. To bring an account online use.
  139.  
  140. account (number) on
  141. If you do not provide any account number all of your accounts will be connected.
  142.  
  143. There is a help command which you can use if you want to know about the syntax of any of the commands. Usually you’ll do it in several steps:
  144.  
  145. help account
  146. help account add
  147. help account add msn
  148. You might want want to stript out html-tags from the incoming messages since our client is text based. Do this with the following Bitlbee-command:
  149.  
  150. set strip_html true
  151. I will guide you how to use Twitter and Google Talk in Bitlbee. You should have no problem adding other accounts the same way.
  152.  
  153. Google Talk
  154. account add jabber (email)
  155. /OPER
  156. account (number) set server talk.google.com:5223:ssl
  157. The account is now ready to be brought online!
  158.  
  159. Twitter
  160. This setup is a bit different since Twitter use OAuth.
  161.  
  162. Firstly do as normal:
  163.  
  164. account add twitter (username)
  165. /OPER
  166. The new “twitter user” will send ju a PM. With a link for the OAuth authentication. Open the link in your browser, sign in and press Allow. Get the numeric code and send it back to the twitter user in the same window.
  167.  
  168. You should now be signed in to your twitter account. If you like you can rename this or any other user:
  169.  
  170. rename twitter_username twitter
  171. Once signed in a new channel will be open which displays all tweets from your contacts. Send a message in this channel to post a status update to Twitter.
  172.  
  173. Nicklist
  174. This script places all nicknames in a channel in a bar at the side of the window like many other IRC-channels. You can use it in two ways. None of them is perfect but I prefer using it together with Screen.
  175.  
  176. You have to start Irssi inside a Gnu Screen session for it to work. You can do this directly from the console by typing:
  177.  
  178. screen irssi
  179. You must specify the script to use Screen from inside Irssi:
  180.  
  181. /nicklist screen
  182. Download: http://scripts.irssi.org/scripts/nicklist.pl
  183. Learn more about Irssi and Screen: http://quadpoint.org/articles/irssi
  184.  
  185.  
  186.  
  187. Xchat nick color
  188. This script works together with the xchat-theme (as you can find if you scroll up a bit) and does two very important things. First of all, it aligns all nicknames to the right in the chat area which creates a vertical line with the chat messages. This makes it a lot easier to read. And secondly, it will give all nicknames a unique color so it is easier to see who sends what.
  189.  
  190. Download: http://dave.waxman.org/irssi/xchatnickcolor.pl
  191.  
  192.  
  193.  
  194. Hilight window
  195. Every time you get hilighted (someone types your nickname or any other higlighted word or sends you a private message) a copy of that message will be sent to a separate window.
  196.  
  197. A great option is to display that window on the top of the terminal at all time. That way you’ll never miss a message.
  198.  
  199. /window new split
  200. /window name hilight
  201. /window size 4
  202. Download: http://scripts.irssi.org/scripts/hilightwin.pl
  203. More info: http://quadpoint.org/articles/irssi#hilight_window
  204.  
  205.  
  206.  
  207. Advanced Window List
  208. AWL customizes the list at the bottom which displays the window list with channels etc.
  209.  
  210. This is my configuration which I’ve stoled from the link below:
  211.  
  212. /set awl_display_key $Q%K|%n$H$C$S
  213. Download: http://anti.teamidiot.de/static/nei/*/Code/Irssi/adv_windowlist.pl
  214. More info: http://quadpoint.org/articles/irssi#channel_statusbar_using_advanced_windowlist
  215.  
  216.  
  217.  
  218.  
  219. Auto away
  220. Another script to use together with Screen. It marks you as away when Screen detects that you are not active in the session.
  221.  
  222. /set screen_away_active ON
  223. /set screen_away_message
  224. /set screen_away_nick
  225. Download: http://scripts.irssi.org/scripts/screen_away.pl
  226.  
  227. Auto-reply Bitlbee
  228. This will reply to all incoming conversation within BitlBee with a custom message when you are away. This of it as an answering machine.
  229.  
  230. You will need the Perl library time-duration. Ubuntu users can use:
  231.  
  232. sudo apt-get install libtime-duration-perl
  233. And to activate it in Irssi:
  234.  
  235. /set bitlbee_autoreply_duration ON
  236. Download: https://github.com/msparks/irssiscripts/raw/master/bitlbee_autoreply.pl
  237.  
  238.  
  239.  
  240. Status notice (BitlBee)
  241. Displays additional information when a users change status such as how long the user was marked as away / offline.
  242.  
  243. Download: http://github.com/msparks/irssiscripts/raw/master/bitlbee_status_notice.pl
  244.  
  245.  
  246.  
  247. OTR encryption for Irssi & BitlBee
  248. Installation for Ubuntu users:
  249.  
  250. sudo apt-get install bitlbee-plugin-otr irssi-plugin-otr
  251. You need to load the OTR module inside Irssi:
  252.  
  253. /LOAD otr
  254. If you wish to do it automatically add this to or create the file ~/.irssi/startup:
  255.  
  256. LOAD otr
  257. Note that we do not use forward-slash in this file.
  258.  
  259. Irssi OTR settings:
  260.  
  261. Commands:
  262.  
  263. /otr genkey nick@irc.server.com
  264. Manually generate a key for the given account(also done on demand)
  265. /otr auth [<nick>@<server>] <secret>
  266. Initiate or respond to an authentication challenge
  267. /otr authabort [<nick>@<server>]
  268. Abort any ongoing authentication
  269. /otr trust [<nick>@<server>]
  270. Trust the fingerprint of the user in the current window.
  271. You should only do this after comparing fingerprints over a secure line
  272. /otr debug
  273. Switch debug mode on/off
  274. /otr contexts
  275. List all OTR contexts along with their fingerprints and status
  276. /otr finish [<nick>@<server>]
  277. Finish an OTR conversation
  278. /otr version
  279. Display irc-otr version. Might be a git commit
  280.  
  281. Settings:
  282.  
  283. otr_policy
  284. Comma-separated list of "<nick>@<server> <policy>" pairs. See comments
  285. above.
  286. otr_policy_known
  287. Same syntax as otr_policy. Only applied where a fingerprint is
  288. available.
  289. otr_ignore
  290. Conversations with nicks that match this regular expression completely
  291. bypass libotr. It is very unlikely that you need to touch this setting,
  292. just use the OTR policy never to prevent OTR sessions with some nicks.
  293. otr_finishonunload
  294. If true running OTR sessions are finished on /unload and /quit.
  295. otr_createqueries
  296. If true queries are automatically created for OTR log messages.
  297. OTR for BitlBee is loaded automatically when installing the Ubuntu package. Use the help command in BitlBee to get information about how to use it:
  298.  
  299. help otr
  300. Notifications
  301. This script provides notifications when you get hilighted via libnotify. In Ubuntu you need to install libnotify-bin:
  302.  
  303. sudo apt-get install libnotify-bin
  304. It works with SSH and GNU Screen but remember to forward X when using SSH with the -X switch.
  305.  
  306. Download: http://irssi-libnotify.googlecode.com/svn/trunk/notify.pl
  307. More info: http://code.google.com/p/irssi-libnotify/
  308.  
  309.  
  310.  
  311. Last.FM
  312. I use this to show my friends what I’m listening to. It prints out the last played song from Last.FM.
  313.  
  314. Set your username:
  315.  
  316. /set lastfm_user
  317. And show what’s playing:
  318.  
  319. /np
  320. Download: http://scripts.irssi.org/scripts/lastfm.pl
  321.  
  322. Official sites
  323. http://irssi.org/
  324. http://bitlbee.org/
  325. http://irssi-otr.tuxfamily.org/
  326.  
  327. More help
  328. Official Irssi documentation:
  329.  
  330. http://irssi.org/documentation
  331.  
  332. Official BitlBee wiki:
  333. http://wiki.bitlbee.org/
  334.  
  335. Quadpoint – the best known Irssi guides:
  336. http://quadpoint.org/articles/irssi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement