{"id":218,"date":"2012-07-01T14:29:53","date_gmt":"2012-07-01T12:29:53","guid":{"rendered":"http:\/\/blog.garion.org\/?p=218"},"modified":"2012-07-01T17:36:07","modified_gmt":"2012-07-01T15:36:07","slug":"irssi-tricks-join-channels-automatically","status":"publish","type":"post","link":"https:\/\/joost.vunderink.net\/blog\/2012\/07\/01\/irssi-tricks-join-channels-automatically\/","title":{"rendered":"Irssi tricks: join channels automatically"},"content":{"rendered":"<p>Today, we shall learn how to make irssi connect to servers, join channels and open queries on startup.<\/p>\n<p>Let&#8217;s assume that we want irssi to automatically connect to the following networks, join these channels and open these queries:<\/p>\n<ul>\n<li>EFnet\n<ul>\n<li>use server <strong>efnet.xs4all.nl<\/strong> or <strong>irc.underworld.no<\/strong><\/li>\n<li>use nickname <strong>TheJustin<\/strong><\/li>\n<li>join channel <strong>#irssitest<\/strong> in window 2<\/li>\n<li>join channel <strong>#quartix<\/strong> with channel password <strong>oodle<\/strong> in window 4<\/li>\n<li>open query with <strong>Chang_X<\/strong> in window 6<\/li>\n<\/ul>\n<\/li>\n<li>QuakeNet\n<ul>\n<li>use server <strong>irc.quakenet.org<\/strong><\/li>\n<li>use nickname <strong>Justin^^<\/strong><\/li>\n<li>join channel <strong>#monogaming<\/strong> in window 3<\/li>\n<li>open query with <strong>Smyter1<\/strong>\u00a0in window 7<\/li>\n<\/ul>\n<\/li>\n<li>CNQNet\n<ul>\n<li>use server <strong>irc.carnique.nl<\/strong><\/li>\n<li>use nickname <strong>Justin^^<\/strong><\/li>\n<li>join channel <strong>#carnique<\/strong> in window 5<\/li>\n<li>open query with <strong>Garion<\/strong> in window 8<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>To accomplish this all, we shall first configure the irc networks, then the servers of each network, and then the channels and queries in the correct windows.<\/p>\n<p>Let&#8217;s get to work. First of all, start irssi in a <a title=\"running irssi in screen\" href=\"http:\/\/quadpoint.org\/articles\/irssi\/#learning_screen\">screen<\/a> or <a title=\"running irssi in tmux\" href=\"http:\/\/blog.hbar.co\/post\/12732127747\/irssi-and-tmux-quick-start-guide\">tmux<\/a>.<\/p>\n<h2>Network configuration<\/h2>\n<p>To list all IRC networks that irssi knows by default, type<\/p>\n<pre>\/network list<\/pre>\n<p>The output is:<\/p>\n<pre>EFNet: max_kicks: 4, max_msgs: 3, max_whois: 1\r\nQuakeNet: max_kicks: 1, max_msgs: 3, max_whois: 30\r\n[other networks not shown here]<\/pre>\n<p>As you can see, <a title=\"EFnet\" href=\"http:\/\/www.efnet.org\">EFnet<\/a> and <a title=\"QuakeNet\" href=\"http:\/\/www.quakenet.org\/\">QuakeNet<\/a> are already there, but CNQnet is not. Let&#8217;s add that network:<\/p>\n<pre>\u00a0\/network add -modes 4 -nick Justin^^ -user justin -realname \"The Justin\" CNQnet<\/pre>\n<p>We also want to make sure that irssi uses the correct nickname, username and realname on EFnet and QuakeNet:<\/p>\n<pre>\/network add -nick TheJustin -user justin -realname \"The Justin\" EFnet\r\n\/network add -nick Justin^^ -user justin -realname \"The Justin\" QuakeNet<\/pre>\n<p>Note that you need to use <strong>\/network add<\/strong> to change the settings of an already existing network. The network configuration should be good now; let&#8217;s verify that with <strong>\/network list<\/strong>:<\/p>\n<pre>EFNet: nick: TheJustin, username: justin, realname: The Justin,\r\n       max_kicks: 4, max_msgs: 3, max_whois: 1\r\nQuakeNet: nick: Justin^^, username: justin, realname: The Justin,\r\n          max_kicks: 1, max_msgs: 3, max_whois: 30\r\nCNQnet: nick: Justin^^, username: justin, realname: The Justin,\r\n        max_modes: 4<\/pre>\n<p>Looking good!\u00a0Time to configure the servers.<\/p>\n<h2>Server configuration<\/h2>\n<p>When you type<\/p>\n<pre>\/server list<\/pre>\n<p>you can see the servers per network that have already been defined in the default configuration of irssi:<\/p>\n<pre>irc.quakenet.org \u00a0 \u00a0 6667 \u00a0QuakeNet\r\nirc.efnet.org \u00a0 \u00a0 \u00a0 \u00a06667 \u00a0EFNet\r\n[other networks not shown here]<\/pre>\n<p>The QuakeNet configuration already uses the correct server. However, it does not automatically connect on startup, so we need to fix that. Also, the EFnet config uses the wrong server for us (irc.efnet.org instead of the 2 servers we want to use), and CNQnet does not have any servers at all. To change all this, we type:<\/p>\n<pre>\/server add -network QuakeNet -auto irc.quakenet.org\r\n\/server remove irc.efnet.org\r\n\/server add -network EFnet -auto efnet.xs4all.nl\r\n\/server add -network EFnet irc.underworld.no\r\n\/server add -network CNQnet -auto irc.carnique.nl<\/pre>\n<p>Just like changing the settings of an existing network, we use <strong>\/server add<\/strong> to overwrite the existing server entry with the new settings. After these commands, <strong>\/server list<\/strong> shows:<\/p>\n<pre>irc.quakenet.org     6667  QuakeNet   autoconnect\r\nefnet.xs4all.nl      6667  EFNet      autoconnect\r\nirc.underworld.no    6667  EFNet\r\nirc.carnique.nl      6667  CNQnet     autoconnect<\/pre>\n<h2>Channel configuration<\/h2>\n<p>Let&#8217;s start by adding the channels to the configuration.<\/p>\n<pre>\/channel add -auto #irssitest EFnet\r\n\/channel add -auto #quartix EFnet oodle\r\n\/channel add -auto #monogaming QuakeNet\r\n\/channel add -auto #carnique CNQnet<\/pre>\n<p>With <strong>\/channel list<\/strong>, we can see all currently configured channels:<\/p>\n<pre>Channel         Network    Password   Settings\r\n#irssitest      EFnet                 autojoin\r\n#quartix        EFnet      oodle      autojoin\r\n#monogaming     QuakeNet              autojoin\r\n#carnique       CNQnet                autojoin<\/pre>\n<p>The last step of configuration is to actually join the channels and open the queries. This seems to be the easiest way to do it:<\/p>\n<pre>\/join -efnet #irssitest\r\n\/join -quakenet #monogaming\r\n\/join -efnet #quartix\r\n\/join -cnqnet #carnique\r\n\/query -efnet Chang_X\r\n\/query -quakenet Smyter1\r\n\/query -cnqnet Garion<\/pre>\n<p>We have to make sure to do this in the right order, so the channels and queries end up in the right windows. If, for whatever reason, we end up with the windows in a different order than we want, we can move windows around until the order is as we desire. For example, to move window 6 to position 2, we would do:<\/p>\n<pre>\/win 6\r\n\/win move 2<\/pre>\n<p>There is one last, and very important, thing that we have to do: we have to make sure that irssi stores our hard work, so we won&#8217;t have to do it again. We do this by the following two commands:<\/p>\n<pre>\/layout save\r\n\/save<\/pre>\n<p>The command <strong>\/layout save<\/strong> tells irssi to store which channels and queries are in which windows when next we use <strong>\/save<\/strong>, and<br \/>\n<strong>\/save<\/strong> stores the configuration (which networks and servers we defined, and which channels and queries were open in which windows).<\/p>\n<p>From now on, whenever we type <em>irssi<\/em>\u00a0to start irssi, irssi will automatically connect to EFnet, QuakeNet and CNQnet, join the 4 channels we defined and open the 3 queries, all in the correct windows!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we shall learn how to make irssi connect to servers, join channels and open queries on startup. Let&#8217;s assume that we want irssi to automatically connect to the following networks, join these channels and open these queries: EFnet use &hellip; <a href=\"https:\/\/joost.vunderink.net\/blog\/2012\/07\/01\/irssi-tricks-join-channels-automatically\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[217,100,81,98,99,87,101,86,82,88,89,102,83,103,84,85],"class_list":["post-218","post","type-post","status-publish","format-standard","hentry","category-irssi","tag-irssi","tag-irssi-channels","tag-irssi-config","tag-irssi-network","tag-irssi-networks","tag-irssi-screen","tag-irssi-servers","tag-irssi-settings","tag-irssi-startup","tag-irssi-tmux","tag-irssi-tricks","tag-join-automatically","tag-join-channel","tag-join-channels-automatically","tag-open-query","tag-startup"],"_links":{"self":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/218"}],"collection":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/comments?post=218"}],"version-history":[{"count":14,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/218\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/218\/revisions\/230"}],"wp:attachment":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/media?parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/categories?post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/tags?post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}