The git repo behind my blog.

highmon_weechat.html 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Phyks' blog - Hilight window in weechat</title>
  6. <link rel="stylesheet" href="//phyks.me/design.css"/>
  7. <link type="text/plain" rel="author" href="//phyks.me/humans.txt"/>
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <link rel="alternate" type="application/rss+xml" title="RSS" href="//phyks.me/rss.xml" />
  10. </head>
  11. <body>
  12. <div id="wrapper">
  13. <!-- Sidebar -->
  14. <aside id="sidebar-wrapper">
  15. <header><h1><a href="//phyks.me">~Phyks</a></h1></header>
  16. <h2>Catégories</h2>
  17. <nav id="sidebar-tags">
  18. <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (2)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (7)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (2)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (2)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (7)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (5)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (7)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (2)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (6)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (2)</a> </div>
  19. </nav>
  20. <h2>Derniers articles</h2>
  21. <ul id="sidebar-articles">
  22. <li><a href="//phyks.me/2014/10/dhcp_server.html">Utiliser son PC sous Arch pour connecter un Raspberry Pi à Internet</a></li><li><a href="//phyks.me/2014/08/sortez_vos_emails.html">Sortez vos emails, c'est pas sale&nbsp;!</a></li><li><a href="//phyks.me/2014/08/synchronisation_backups_1.html">Synchroniser ses ordinateurs 1/2</a></li><li><a href="//phyks.me/2014/08/free_mobile_fluctuant.html">Les énigmes du réseau Free Mobile</a></li><li><a href="//phyks.me/2014/07/notification_sms_free.html">Recevoir ses emails par SMS avec Free Mobile</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
  23. </ul>
  24. <h2>Liens</h2>
  25. <ul id="sidebar-links">
  26. <li><a href="//phyks.me/contact.html" title="Contact">Me contacter</a></li>
  27. <li class="monospace"><a href="//links.phyks.me" title="Mon Shaarli">find ~phyks -type l</a></li>
  28. <li><a href="https://github.com/phyks/" title="Github">Mon Github</a></li>
  29. <li><a href="//phyks.me/divers.html" title="Divers">Divers</a></li>
  30. </ul>
  31. </aside>
  32. <!-- Page content -->
  33. <header id="header">
  34. <h1><a href="//phyks.me">~Phyks</a></h1>
  35. </header>
  36. <div id="note_responsive">
  37. <p><em>Note</em> : Cliquez sur la bande bleue à gauche pour faire apparaître le menu.</p>
  38. </div>
  39. <div id="articles">
  40. <article>
  41. <aside>
  42. <p class="day">25</p>
  43. <p class="month">Décembre</p>
  44. </aside>
  45. <div class="article">
  46. <header><h1 class="article_title"><a href="//phyks.me/2013/12/highmon_weechat.html">Hilight window in weechat</a></h1></header>
  47. <!--
  48. @author=Phyks
  49. @date=25122013-0133
  50. @title=Hilight window in weechat
  51. @tags=Weechat
  52. -->
  53. <p>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 same setup as irssi. I'm very pleased with what I achieved, and weechat is definitely an excellent irc client, although it lacks a bit of usable documentation sometimes…</p>
  54. <p>To get something like my old irssi, I had to install some extensions, including :</p>
  55. <ul>
  56. <li>text_effects.lua to have some inline text decoration such as *bold* to display bold in bold</li>
  57. <li>buffers.pl to have a list of opened buffers</li>
  58. <li>iset.pl to set configuration options easily</li>
  59. <li>screen_away.py (which is very efficient !) to auto away when I detach my screen session</li>
  60. </ul>
  61. <p>I extensively used <a href="http://pascalpoitras.com/2013/05/25/my-weechat-configuration/">this link</a> and the other articles on weechat on this website, which is a reference in my opinion, to get a working base weechat configuration.</p>
  62. <p>But, one point that wasn't documented very well, is the use of a hilight window without dedicating a buffer to it. Dedicating a buffer to the hilight window means having an opened buffer in the main window, which is useless. You always select it accidentally by typing the wrong number for another buffer, and it's hidous in your buffer list (even though you can hide it from there). I don't know if this could be done in irssi, but in weechat, you can set highmon to use a bar instead of a buffer to display the "hilight window" and this is what we'll see in the following. I will assume you start with highmon plugin installed and configured, with a hilight window such as the one from Pascal Poitras.</p>
  63. <p>So, first step is to tell highmon to use a bar for output instead of the standard buffer :</p>
  64. <pre>/set plugins.var.perl.highmon.output bar</pre>
  65. <p>Highmon should have created a bar automatically, to put the messages in. Check weechat.bar.highmon.* options to make sure it did. Next, type :</p>
  66. <pre>/set plugins.var.perl.highmon.bar_lines 250</pre>
  67. <p>to set the number of lines to be stored in your freshly created bar.</p>
  68. <p>Then, you can edit all the preferences for the bar (size, size_max, position, priority, hide etc.) as for a standard bar, using weechat.bar.highmon.* options. Note that priority is important if you have to bars having the same position. For instance, if two bars are positioned at the top, the priority property will determine which one is above the other one.</p>
  69. <p>One last point is that we'd like to have a title for the new hilight bar (which by default doesn't have any title). The hack is to use another plugin, text_item.py to display a bar with some text. To make a title "[Hilight Monitor]", just run (after having installed text_item.py):</p>
  70. <pre>/set plugins.var.python.text_item.hilight_monitor_title_text all "[Hilight Monitor]"
  71. /bar add highmon_title top 1 0 hilight_monitor_title_text
  72. </pre>
  73. <p>And play with the position, priority and colors for the newly created bar to have a nice setup :)</p>
  74. <p>One last important thing is that, contrary to the buffer solution, you won't be able to clean easily the hilight window and to scroll in it. But, I found two aliases on #weechat (ty @silverd for the aliases) that you can bind to any key if you want:</p>
  75. <pre>/alias clear_highmon /mute /set plugins.var.perl.highmon.bar_lines -1;/mute /set weechat.bar.highmon.items "";/mute /set weechat.bar.highmon.items "highmon";/mute /set plugins.var.perl.highmon.bar_lines 250
  76. /alias scroll_highmon_down /bar scroll highmon * y+100%
  77. /alias scroll_highmon_up /bar scroll highmon * y-100%
  78. </pre>
  79. <p>You can now clear the hilight window with /clear_highmon and scroll in it with the other aliases. So, I think you are good to go for a (quite) perfect weechat setup :)</p>
  80. <p><strong>Update:</strong></p>
  81. <ul>
  82. <li>You can define your own keyboard shortcut in the following way:
  83. <pre>/key bind KEY /scroll_highmon</pre>
  84. where KEY is some key or combination of key (for instance meta-meta2-A or whatever you want). You can do the same for <span class="monospace">/clear_highmon</span> and <span class="monospace">/scroll_highmon_up</span>.
  85. </li>
  86. <li>By default, the highmon bar won't autoscroll. To enable autoscroll, you should set <span class="monospace">plugins.var.perl.highmon.bar_scrolldown</span> to <span class="monospace">on</span>.</li>
  87. </ul>
  88. <footer><p class="date">Le 25/12/2013 à 01:33</p>
  89. <p class="tags">Tags : <a href="//phyks.me/tags/Weechat.html">Weechat</a></p></footer>
  90. </div>
  91. </article>
  92. </div>
  93. <footer id="rss">
  94. <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
  95. </footer>
  96. </div>
  97. </body>
  98. </html>