The git repo behind my blog.

hilight-window-in-weechat.html 11KB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <link href='' rel='stylesheet' type='text/css'>
  5. <link rel="stylesheet" type="text/css" href="">
  6. <link rel="stylesheet" type="text/css" href="">
  7. <link rel="stylesheet" type="text/css" href="">
  8. <link href="" type="application/atom+xml" rel="alternate" title="Phyks' blog Atom">
  9. <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
  10. <link rel="icon" href="/images/favicon.ico" type="image/x-icon">
  11. <meta charset="utf-8" />
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  13. <meta name="HandheldFriendly" content="True" />
  14. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  15. <meta name="robots" content="index, follow" />
  16. <!-- Chrome, Firefox OS and Opera -->
  17. <meta name="theme-color" content="#333">
  18. <!-- Windows Phone -->
  19. <meta name="msapplication-navbutton-color" content="#333">
  20. <!-- iOS Safari -->
  21. <meta name="apple-mobile-web-app-capable" content="yes">
  22. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  23. <!-- Microsoft EDGE -->
  24. <meta name="msapplication-TileColor" content="#333">
  25. <meta name="author" content="Phyks" />
  26. <meta name="description" content="I recently moved from Irssi+Screen to Weechat+Screen (and I’m planning to look at weechat interfaces in the future, to have a local irc client connecting to my server and avoid any latency while typing on low speed internet connection). My first step was to get almost the …" />
  27. <meta name="keywords" content="">
  28. <meta property="og:site_name" content="Phyks' blog"/>
  29. <meta property="og:title" content="Hilight window in weechat"/>
  30. <meta property="og:description" content="I recently moved from Irssi+Screen to Weechat+Screen (and I’m planning to look at weechat interfaces in the future, to have a local irc client connecting to my server and avoid any latency while typing on low speed internet connection). My first step was to get almost the …"/>
  31. <meta property="og:locale" content="en_US.UTF-8"/>
  32. <meta property="og:url" content=""/>
  33. <meta property="og:type" content="article"/>
  34. <meta property="article:published_time" content="2013-12-25 01:33:00+01:00"/>
  35. <meta property="article:modified_time" content=""/>
  36. <meta property="article:author" content="">
  37. <meta property="article:section" content="ConfigPorn"/>
  38. <meta property="og:image" content="/images/profile.png">
  39. <title>Phyks' blog &ndash; Hilight window in weechat</title>
  40. </head>
  41. <body>
  42. <aside>
  43. <div>
  44. <a href="">
  45. <img src="/images/profile.png" alt="Phyks" title="Phyks">
  46. </a>
  47. <h1><a href="">Phyks</a></h1>
  48. <p>I write about dev, FOSS, DIY and more, in French and English.</p>
  49. <ul class="social">
  50. <li><a class="sc-rss" href="feeds/all.atom.xml" target="_blank"><i class="fa fa-rss"></i></a></li>
  51. <li><a class="sc-envelope-o" href="" target="_blank"><i class="fa fa-envelope-o"></i></a></li>
  52. <li><a class="sc-github" href="" target="_blank"><i class="fa fa-github"></i></a></li>
  53. <li><a class="sc-gitlab" href="" target="_blank"><i class="fa fa-gitlab"></i></a></li>
  54. </ul>
  55. </div>
  56. </aside>
  57. <main>
  58. <nav>
  59. <a href="">Home</a>
  60. <a href="">Bookmarks</a>
  61. <a href="/pages/hosted-tools.html">Tools</a>
  62. <a href="/archives.html">Archives</a>
  63. <a href="/pages/memo-autohebergement.html">Autohébergement</a>
  64. <a href="">Atom</a>
  65. </nav>
  66. <article class="single">
  67. <header>
  68. <h1 id="hilight-window-in-weechat">Hilight window in&nbsp;weechat</h1>
  69. <p>
  70. Posted on December 25, 2013 in <a href="">ConfigPorn</a>
  71. &#8226; 3 min read
  72. </p>
  73. </header>
  74. <div>
  75. <p>I recently moved from Irssi+Screen to Weechat+Screen (and I&#8217;m planning
  76. to look at weechat interfaces in the future, to have a local irc client
  77. connecting to my server and avoid any latency while typing on low speed
  78. internet connection). My first step was to get almost the same setup as
  79. irssi. I&#8217;m very pleased with what I achieved, and weechat is definitely
  80. an excellent irc client, although it lacks a bit of usable documentation&nbsp;sometimes…</p>
  81. <p>To get something like my old irssi, I had to install some extensions,
  82. including&nbsp;:</p>
  83. <ul>
  84. <li>text_effects.lua to have some inline text decoration such as
  85. *bold* to display bold in&nbsp;bold</li>
  86. <li> to have a list of opened&nbsp;buffers</li>
  87. <li> to set configuration options&nbsp;easily</li>
  88. <li> (which is very efficient !) to auto away when I
  89. detach my screen&nbsp;session</li>
  90. </ul>
  91. <p>I extensively used <a href="">this
  92. link</a> and
  93. the other articles on weechat on this website, which is a reference in
  94. my opinion, to get a working base weechat&nbsp;configuration.</p>
  95. <p>But, one point that wasn&#8217;t documented very well, is the use of a hilight
  96. window without dedicating a buffer to it. Dedicating a buffer to the
  97. hilight window means having an opened buffer in the main window, which
  98. is useless. You always select it accidentally by typing the wrong number
  99. for another buffer, and it&#8217;s hidous in your buffer list (even though you
  100. can hide it from there). I don&#8217;t know if this could be done in irssi,
  101. but in weechat, you can set highmon to use a bar instead of a buffer to
  102. display the &#8220;hilight window&#8221; and this is what we&#8217;ll see in the
  103. following. I will assume you start with highmon plugin installed and
  104. configured, with a hilight window such as the one from Pascal&nbsp;Poitras.</p>
  105. <p>So, first step is to tell highmon to use a bar for output instead of the
  106. standard buffer&nbsp;:</p>
  107. <div class="highlight"><pre><span></span>/set plugins.var.perl.highmon.output bar
  108. </pre></div>
  109. <p>Highmon should have created a bar automatically, to put the messages in.
  110. Check* options to make sure it did. Next, type&nbsp;:</p>
  111. <div class="highlight"><pre><span></span>/set plugins.var.perl.highmon.bar_lines 250
  112. </pre></div>
  113. <p>to set the number of lines to be stored in your freshly created&nbsp;bar.</p>
  114. <p>Then, you can edit all the preferences for the bar (size, size_max,
  115. position, priority, hide etc.) as for a standard bar, using
  116.* options. Note that priority is important if you
  117. have to bars having the same position. For instance, if two bars are
  118. positioned at the top, the priority property will determine which one is
  119. above the other&nbsp;one.</p>
  120. <p>One last point is that we&#8217;d like to have a title for the new hilight bar
  121. (which by default doesn&#8217;t have any title). The hack is to use another
  122. plugin, to display a bar with some text. To make a title
  123. &#8220;[Hilight Monitor]&#8221;, just run (after having installed&nbsp;</p>
  124. <div class="highlight"><pre><span></span><span class="o">/</span><span class="n">set</span> <span class="n">plugins</span><span class="p">.</span><span class="n">var</span><span class="p">.</span><span class="n">python</span><span class="p">.</span><span class="n">text_item</span><span class="p">.</span><span class="n">hilight_monitor_title_text</span> <span class="n">all</span> <span class="s">&quot;[Hilight Monitor]&quot;</span>
  125. <span class="o">/</span><span class="n">bar</span> <span class="n">add</span> <span class="n">highmon_title</span> <span class="n">top</span> <span class="mi">1</span> <span class="mi">0</span> <span class="n">hilight_monitor_title_text</span>
  126. </pre></div>
  127. <p>And play with the position, priority and colors for the newly created
  128. bar to have a nice setup&nbsp;:)</p>
  129. <p>One last important thing is that, contrary to the buffer solution, you
  130. won&#8217;t be able to clean easily the hilight window and to scroll in it.
  131. But, I found two aliases on #weechat (ty @silverd for the aliases) that
  132. you can bind to any key if you&nbsp;want:</p>
  133. <div class="highlight"><pre><span></span>/alias clear_highmon /mute /set plugins.var.perl.highmon.bar_lines -1;/mute /set &quot;&quot;;/mute /set &quot;highmon&quot;;/mute /set plugins.var.perl.highmon.bar_lines 250
  134. /alias scroll_highmon_down /bar scroll highmon * y+100%
  135. /alias scroll_highmon_up /bar scroll highmon * y-100%
  136. </pre></div>
  137. <p>You can now clear the hilight window with /clear_highmon and scroll in
  138. it with the other aliases. So, I think you are good to go for a (quite)
  139. perfect weechat setup&nbsp;:)</p>
  140. <p><strong>Update:</strong></p>
  141. <ul>
  142. <li>
  143. <p>You can define your own keyboard shortcut in the following&nbsp;way:</p>
  144. <p><code>/key bind KEY /scroll_highmon</code></p>
  145. <p>where <span class="caps">KEY</span> is some key or combination of key (for instance
  146. meta-meta2-A or whatever you want). You can do the same for
  147. <code>/clear_highmon</code> and
  148. <code>/scroll_highmon_up</code>.</p>
  149. </li>
  150. <li>
  151. <p>By default, the highmon bar won&#8217;t autoscroll. To enable autoscroll,
  152. you should set
  153. <code>plugins.var.perl.highmon.bar_scrolldown</code> to
  154. <code>on</code>.</p>
  155. </li>
  156. </ul>
  157. </div>
  158. <div class="tag-cloud">
  159. <p>
  160. </p>
  161. </div>
  162. <div class="addthis_relatedposts_inline">
  163. </article>
  164. <footer>
  165. <p>
  166. &copy; 2017 - This work is licensed under a <a rel="license" href="">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>
  167. </p>
  168. <p>Powered by <a href="" target="_blank">Pelican</a> - <a href="" target="_blank">Flex</a> theme by <a href="" target="_blank">Alexandre Vicenzi</a></p><p>
  169. <a rel="license"
  170. href=""
  171. target="_blank">
  172. <img alt="Creative Commons License"
  173. title="Creative Commons License"
  174. style="border-width:0"
  175. src=""
  176. width="80"
  177. height="15"/>
  178. </a>
  179. </p> </footer>
  180. </main>
  181. <script type="application/ld+json">
  182. {
  183. "@context" : "",
  184. "@type" : "Blog",
  185. "name": " Phyks' blog ",
  186. "url" : "",
  187. "image": "/images/profile.png",
  188. "description": "I write about dev, FOSS, DIY and more, in French and English."
  189. }
  190. </script>
  191. </body>
  192. </html>