WeeChat dev news - Tag - scriptWeeChat development blog2024-01-22T17:53:19+01:00urn:md5:edd364dae4d94114a2ba146603903683DotclearScript anti_password.pyurn:md5:199d6ccdcd843158f9e4b2f98880620b2021-02-26T18:39:00+00:002021-03-13T00:46:55+00:00Sébastien Helleuscriptspasswordscript <p>You've sent your password to the wrong window (ie: WeeChat), and it is now public, viewed by 1,500 people?<br />
For now, you have to change your password.</p>
<p>For the future, a new script is now available: <a href="https://weechat.org/scripts/source/anti_password.py.html/">anti_password.py</a>.</p>
<p><strong>How does it work?</strong></p>
<p>When you press Enter to send text to a buffer, the script detects if the input is a password, in two ways:</p>
<ol>
<li>If the input matches a condition: number of words, lower/upper/digit/special chars.</li>
<li>If a secured data value is in the input (reminder: <a href="https://weechat.org/files/doc/devel/weechat_user.en.html#secured_data" hreflang="en" title="secured data">secured data</a> is the recommended way to store all your passwords in WeeChat) (requires WeeChat ≥ 3.1).</li>
</ol>
<p>If a password is detected, the text is not sent to the buffer (3 times with the default config).</p>
<p>Note: the WeeChat commands (ie <code>/xxx</code>) are ignored and are always sent.</p>
<p><strong>Options</strong></p>
<p>There are 4 options to configure the script (see <code>/fset anti_password</code> for a list of options with help):</p>
<ul>
<li><strong><code>allowed_regex</code></strong>: allowed regular expression (checked first)</li>
<li><strong><code>password_condition</code></strong>: the condition used to detect a password</li>
<li><strong><code>check_secured_data</code></strong>: whether the script checks for secured data (disabled, input equals secured data or secured data included in input)</li>
<li><strong><code>max_rejects</code></strong>: the number of times the same input is rejected; after this number, the input is finally sent to the buffer.</li>
</ul>
<p>Keep your passwords safe!</p>
<p><strong>Updated on 2021-03-13</strong>: added option <code>allowed_regex</code>.</p>Split of scripting Debian packagesurn:md5:fec9aa5055c9e47416c2c00d6d6aa79e2017-11-04T12:49:00+01:002021-06-18T09:09:06+02:00Sébastien Helleucoredebianpackagingscript <p>Starting on Sunday, Nov 3rd 2017 at 02:00 (CET), the Debian packaging will change in <a href="https://weechat.org/download/debian/" hreflang="en" title="weechat.org Debian/Ubuntu/Raspbian repositories">weechat.org Debian/Ubuntu/Raspbian repositories</a>: the scripting plugins are split into multiple packages, so that Perl, Python, Ruby, ... can be installed separately.</p>
<p>Only development packages will be updated, the released versions (1.9.1 and earlier) will not be updated.</p>
<p><strong>Important</strong>: if you are using the WeeChat development packages from weechat.org, you will have to install manually the scripting packages (according to the languages you'll use in WeeChat).</p>
<p>Old packaging (until 2017-11-04):</p>
<ul>
<li>weechat</li>
<li>weechat-core</li>
<li>weechat-curses</li>
<li>weechat-dbg</li>
<li>weechat-dev</li>
<li>weechat-doc</li>
<li>weechat-plugins</li>
<li><strong>weechat-plugins</strong> (<strong>14</strong> plugins):
<ul>
<li>aspell</li>
<li>exec</li>
<li>fifo</li>
<li>guile</li>
<li>javascript</li>
<li>lua</li>
<li>perl</li>
<li>php</li>
<li>python</li>
<li>relay</li>
<li>ruby</li>
<li>script</li>
<li>tcl</li>
<li>trigger</li>
</ul></li>
</ul>
<p>New packaging, with <strong>8</strong> new packages:</p>
<ul>
<li>weechat</li>
<li>weechat-core</li>
<li>weechat-curses</li>
<li>weechat-dbg</li>
<li>weechat-dev</li>
<li>weechat-doc</li>
<li>weechat-plugins</li>
<li><strong>weechat-plugins</strong> (<strong>6</strong> plugins remaining):
<ul>
<li>aspell</li>
<li>exec</li>
<li>fifo</li>
<li>relay</li>
<li>script</li>
<li>trigger</li>
</ul></li>
<li><strong>weechat-python</strong></li>
<li><strong>weechat-perl</strong></li>
<li><strong>weechat-ruby</strong></li>
<li><strong>weechat-lua</strong></li>
<li><strong>weechat-tcl</strong></li>
<li><strong>weechat-guile</strong></li>
<li><strong>weechat-javascript</strong></li>
<li><strong>weechat-php</strong></li>
</ul>
<p>GitHub issue: <a href="https://github.com/weechat/weechat/issues/1085" hreflang="en" title="https://github.com/weechat/weechat/issues/1085">https://github.com/weechat/weechat/issues/1085</a></p>Automatic tests of scripting APIurn:md5:e8b33295853633b1525a43bf95f8fde22017-10-17T07:43:00+02:002017-10-17T06:44:09+02:00Sébastien Helleucorescripttests <p>Automatic tests of the scripting API have been added a few days ago. For now only a small part of API functions are checked.</p>
<p>This is done with 3 new Python scripts in directory tests/scripts/python:</p>
<ul>
<li>unparse.py: convert Python code to other languages (including Python itself)</li>
<li>testapigen.py: generate scripts in all languages to test the API</li>
<li>testapi.py scripting API tests</li>
</ul>
<p>The script unparse.py can convert Python code to other languages: Python, Perl, Ruby, Lua, TCL, Guile, JavaScript and PHP (new plugin in version 2.0).
The Python code is first parsed using AST (ast.parse), and then this tree is recursively scanned to produce code in Python or another language (note: only part of AST is supported, the minimum for WeeChat tests).</p>
<p>Example of code conversion in other languages:</p>
<pre>
$ ./unparse.py --language all
Enter the code to convert (Enter + ctrl+D to end)
def test_list_new():
ptr_list = weechat.list_new()
check(ptr_list != '')
check(weechat.list_size(ptr_list) == 0)
python:
def test_list_new():
ptr_list = weechat.list_new()
check(ptr_list != '')
check(weechat.list_size(ptr_list) == 0)
perl:
sub test_list_new
{
$ptr_list = weechat::list_new();
check($ptr_list ne "");
check(weechat::list_size($ptr_list) == 0);
}
ruby:
def test_list_new
ptr_list = weechat.list_new()
check(ptr_list != '')
check(weechat.list_size(ptr_list) == 0)
end
lua:
function test_list_new()
ptr_list = weechat.list_new()
check(ptr_list ~= '')
check(weechat.list_size(ptr_list) == 0)
end
tcl:
proc test_list_new {} {
set ptr_list [weechat::list_new]
check [expr {$ptr_list ne ""}]
check [expr {[weechat::list_size $ptr_list] == 0}]
}
guile:
(define (test_list_new)
(let ((ptr_list (weechat:list_new)))
(begin
(check (string<> ptr_list ""))
(check (= (weechat:list_size ptr_list) 0))
)
)
)
javascript:
function test_list_new() {
ptr_list = weechat.list_new()
check(ptr_list != '')
check(weechat.list_size(ptr_list) == 0)
}
php:
function test_list_new()
{
$ptr_list = weechat_list_new();
check($ptr_list != "");
check(weechat_list_size($ptr_list) == 0);
}
</pre>
<p>The script testapigen.py generates scripts in all supported languages. These scripts are loaded in WeeChat during tests, and print the results of tests, for example in Python:</p>
<pre>
>>> Running command: /script load -q ./tmp_weechat_test/testapi/testapi.py
>>> Running command: /testapi.py
>>>
>>> ------------------------------
>>> Testing python API
> TESTS: 57
> test_plugins
TEST OK: weechat.plugin_get_name('') == 'core'
TEST OK: weechat.plugin_get_name(weechat.buffer_get_pointer(weechat.buffer_search_main(), 'plugin')) == 'core'
> test_strings
TEST OK: weechat.charset_set('iso-8859-15') == 1
TEST OK: weechat.charset_set('') == 1
TEST OK: weechat.iconv_to_internal('iso-8859-15', 'abc') == 'abc'
TEST OK: weechat.iconv_from_internal('iso-8859-15', 'abcd') == 'abcd'
TEST OK: weechat.gettext('abcdef') == 'abcdef'
TEST OK: weechat.ngettext('file', 'files', 1) == 'file'
TEST OK: weechat.ngettext('file', 'files', 2) == 'files'
TEST OK: weechat.strlen_screen('abcd') == 4
TEST OK: weechat.string_match('abcdef', 'abc*', 0) == 1
TEST OK: weechat.string_eval_path_home('test ${abc}', {}, {'abc': '123'}, {}) == 'test 123'
TEST OK: weechat.string_mask_to_regex('test*mask') == 'test.*mask'
TEST OK: weechat.string_has_highlight('my test string', 'test,word2') == 1
TEST OK: weechat.string_has_highlight_regex('my test string', 'test|word2') == 1
TEST OK: weechat.string_remove_color('test', '?') == 'test'
TEST OK: weechat.string_is_command_char('/test') == 1
TEST OK: weechat.string_is_command_char('test') == 0
TEST OK: weechat.string_input_for_buffer('test') == 'test'
TEST OK: weechat.string_input_for_buffer('/test') == ''
TEST OK: weechat.string_input_for_buffer('//test') == '/test'
TEST OK: weechat.string_eval_expression('100 > 50', {}, {}, {'type': 'condition'}) == '1'
TEST OK: weechat.string_eval_expression('${buffer.full_name}', {}, {}, {}) == 'core.weechat'
> test_lists
TEST OK: ptr_list != ''
TEST OK: weechat.list_size(ptr_list) == 0
TEST OK: weechat.list_size(ptr_list) == 1
TEST OK: weechat.list_size(ptr_list) == 2
TEST OK: weechat.list_search(ptr_list, 'abc') == item_abc
TEST OK: weechat.list_search(ptr_list, 'def') == item_def
TEST OK: weechat.list_search(ptr_list, 'ghi') == ''
TEST OK: weechat.list_search_pos(ptr_list, 'abc') == 0
TEST OK: weechat.list_search_pos(ptr_list, 'def') == 1
TEST OK: weechat.list_search_pos(ptr_list, 'ghi') == -1
TEST OK: weechat.list_casesearch(ptr_list, 'abc') == item_abc
TEST OK: weechat.list_casesearch(ptr_list, 'def') == item_def
TEST OK: weechat.list_casesearch(ptr_list, 'ghi') == ''
TEST OK: weechat.list_casesearch(ptr_list, 'ABC') == item_abc
TEST OK: weechat.list_casesearch(ptr_list, 'DEF') == item_def
TEST OK: weechat.list_casesearch(ptr_list, 'GHI') == ''
TEST OK: weechat.list_casesearch_pos(ptr_list, 'abc') == 0
TEST OK: weechat.list_casesearch_pos(ptr_list, 'def') == 1
TEST OK: weechat.list_casesearch_pos(ptr_list, 'ghi') == -1
TEST OK: weechat.list_casesearch_pos(ptr_list, 'ABC') == 0
TEST OK: weechat.list_casesearch_pos(ptr_list, 'DEF') == 1
TEST OK: weechat.list_casesearch_pos(ptr_list, 'GHI') == -1
TEST OK: weechat.list_get(ptr_list, 0) == item_abc
TEST OK: weechat.list_get(ptr_list, 1) == item_def
TEST OK: weechat.list_get(ptr_list, 2) == ''
TEST OK: weechat.list_string(item_def) == 'def2'
TEST OK: weechat.list_next(item_abc) == item_def
TEST OK: weechat.list_next(item_def) == ''
TEST OK: weechat.list_prev(item_abc) == ''
TEST OK: weechat.list_prev(item_def) == item_abc
TEST OK: weechat.list_size(ptr_list) == 1
TEST OK: weechat.list_get(ptr_list, 0) == item_def
TEST OK: weechat.list_get(ptr_list, 1) == ''
TEST OK: weechat.list_size(ptr_list) == 0
> TESTS END
>>> Tests python: 57 tests, 57 OK, 0 errors, 0 unexpected messages, 9 ms
</pre>New plugin Javascripturn:md5:478bfcc29adf2782d41599640a1cac9b2015-03-14T10:40:00+01:002015-04-11T16:35:44+02:00Sébastien Helleupluginsjavascriptscript <p>A new plugin called "javascript" has been added to WeeChat. You can now load and execute Javascript scripts in WeeChat!</p>
<p>This plugin uses Google's v8 engine.</p>
<p>WeeChat now supports Python, Perl, Ruby, Lua, Tcl, Guile and Javascript!</p>
<p>To load/unload JS scripts, you can use the <code>/script</code> or <code>/javascript</code> command.</p>
<p>An example of script is available here: <a href="https://weechat.org/files/temp/scripts/example.js" hreflang="en">https://weechat.org/files/temp/scripts/example.js</a>.</p>Scripts managerurn:md5:186f5eb10940f5fc7e74dd21e5a95fd72012-08-14T18:37:00+02:002019-11-04T21:55:10+01:00Sébastien Helleupluginspluginscript <p>A new scripts manager has been added, the plugin is called "script" and provides the <code>/script</code> command.</p>
<p>This plugin will replace two scripts: weeget.py (the current scripts manager) and script.pl (providing a <code>/script</code> command to load/unload/reload scripts for any language).</p>
<p>The new <code>/script</code> command is similar to command <code>/weeget</code> with some minor differences (see <code>/help script</code> for more info).</p>
<p>The plugin provides a buffer with list of scripts in repository, which makes installation or removal of scripts very fast: just press <strong>alt+i</strong> on this buffer, and the script is installed! Not satisfied with the script? Key <strong>alt+r</strong> and the script is gone!</p>
<p>The buffer allows you to search string in scripts (description, tags, ...) and to sort scripts with many keys. Columns displayed can be fully customized (order, columns displayed), as well as colors.</p>
<p>For list of options, just do: <code>/set script.*</code></p>
<p>List of scripts (click for full size):</p>
<p><a href="https://blog.weechat.org/public/weechat_script_plugin.png"><img src="https://blog.weechat.org/public/./.weechat_script_plugin_m.jpg" alt="Script plugin: list of scripts" style="display:table; margin:0 auto;" title="Script plugin: list of scripts" /></a></p>
<p>Detail of a script (click for full size):
<a href="https://blog.weechat.org/public/weechat_script_plugin_detail.png"><img src="https://blog.weechat.org/public/./.weechat_script_plugin_detail_m.jpg" alt="Script plugin: detail of a script" style="display:table; margin:0 auto;" title="Script plugin: detail of a script" /></a></p>
<p>Enjoy!</p>SameGameurn:md5:3e176c033465ec7f995446ef907015a82012-03-16T18:33:00+01:002019-11-04T21:55:30+01:00Sébastien Helleuscriptsgamepythonscript <p>A new script <a href="https://weechat.org/scripts/source/stable/samegame.py">samegame.py</a> is now available! More info about this game is available at <a href="http://en.wikipedia.org/wiki/SameGame">http://en.wikipedia.org/wiki/SameGame</a>.</p>
<p>If you are using weeget, just do: <code>/weeget install samegame.py</code></p>
<p>Mouse is required, so you must have WeeChat >= 0.3.6.</p>
<p>For help: <code>/help samegame</code>.</p>
<p>Screenshot (click for full size):</p>
<p><a href="https://blog.weechat.org/public/weechat_samegame_2012-03-16.png"><img src="https://blog.weechat.org/public/./.weechat_samegame_2012-03-16_m.jpg" alt="SameGame" style="display:table; margin:0 auto;" title="samegame.py" /></a></p>
<p>Enjoy!</p>Shorten URLs with own HTTP serverurn:md5:aa88030a15a0a988ec089f1cb6f2489f2011-10-31T18:24:00+01:002021-06-18T09:18:07+02:00Sébastien Helleuscriptspythonscripturl <p>Don't panic with long URLs and don't give your private URLs any more to shortening services!<br />
A new script <a href="https://weechat.org/scripts/source/urlserver.py.html/">urlserver.py</a> has been added. This script shortens URLs displayed and serve them using own HTTP server, which can be used to display a list of all URLs as well.</p>
<p>Many options are available to customize shortening of URLs, display in WeeChat and HTML page (see <code>/help urlserver</code> and <code>/set plugins.var.python.urlserver.*</code>).</p>
<p>The URLs are saved into <code>~/.weechat/urlserver_list.txt</code> when script is unloaded, so that URLs are persistent when you restart WeeChat.</p>
<p>A screenshot of HTML page with list of URLs (click for full size):</p>
<p><a href="https://blog.weechat.org/public/weechat_urlserver_2011-10-31.png"><img src="https://blog.weechat.org/public/./.weechat_urlserver_2011-10-31_m.jpg" alt="Urlserver" style="display:table; margin:0 auto;" title="urlserver.py" /></a></p>New plugin Guileurn:md5:2fc41b57ac8fde76c379c49dd99360162011-10-27T07:52:00+02:002017-05-07T14:22:33+02:00Sébastien Helleupluginsguileschemescript <p>A new plugin called "guile" has been added to WeeChat. You can now load and execute <a href="http://en.wikipedia.org/wiki/Scheme_%28programming_language%29" hreflang="en" title="Scheme">Scheme</a> scripts in WeeChat!</p>
<p>WeeChat now supports Python, Perl, Ruby, Lua, Tcl and Guile!</p>
<p>To load/unload scheme scripts, command is <code>/guile</code> with same syntax as other script languages:</p>
<pre>/guile load /path/to/example.scm
/guile reload example
/guile unload example</pre>
<p>An example of script:</p>
<pre>;; example.scm
(weechat:register "example" "FlashCode" "0.1" "GPL3" "Scheme script" "" "")
(weechat:print "" "Hey, I'm a scheme script for WeeChat!")</pre>Game Minesweeperurn:md5:4fb355d779977d869db5fec5fc8dfb552011-10-02T11:51:00+02:002019-11-04T21:58:47+01:00Sébastien Helleuscriptsgamepythonscript <p>A new script <a href="https://weechat.org/scripts/source/stable/minesweeper.py">minesweeper.py</a> is now available, the famous Minesweeper game!</p>
<p>If you are using weeget, just do: <code>/weeget install minesweeper.py</code></p>
<p>256 colors mode is highly recommended, and mouse support (with WeeChat >= 0.3.6). If you have 16 colors or less, you can do: <code>/minesweeper 16col</code></p>
<p>For help: <code>/help minesweeper</code>.</p>
<p>Screenshot (click for full size):</p>
<p><a href="https://blog.weechat.org/public/weechat_minesweeper_2011-10-02.png"><img src="https://blog.weechat.org/public/./.weechat_minesweeper_2011-10-02_m.jpg" alt="Minesweeper" style="display:table; margin:0 auto;" title="minesweeper.py" /></a></p>
<p>Enjoy!</p>Game Flood'iturn:md5:3ef1d35eaeacecbf9bf125085b687c522011-08-20T19:15:00+02:002019-11-04T21:59:08+01:00Sébastien Helleuscriptsgamepythonscript <p>A new script <a href="https://weechat.org/scripts/source/stable/floodit.py">floodit.py</a> is now available!
You can now play to Flood'it inside WeeChat, with following features:</p>
<ul>
<li>single mode</li>
<li>versus mode (play vs computer)</li>
<li>demo mode</li>
<li>3 different board sizes.</li>
</ul>
<p>If you are using weeget, just do: <code>/weeget install floodit.py</code></p>
<p>For help: <code>/help floodit</code>.</p>
<p>Note: mouse is supported with latest devel version of WeeChat (0.3.6-dev).</p>
<p>Screenshot (click for full size):</p>
<p><a href="https://blog.weechat.org/public/weechat_floodit_2011-08-20.png"><img src="https://blog.weechat.org/public/./.weechat_floodit_2011-08-20_m.jpg" alt="Flood'it" style="display:table; margin:0 auto;" title="floodit.py" /></a></p>
<p>Enjoy!</p>Data for callbacks in script APIurn:md5:53e6358f03857e220548f4530da931f22009-05-02T16:38:00+02:002017-05-07T14:29:34+02:00Sébastien Helleuscriptsapiscript <p>Major changes were done in script API: data string was added to all callbacks. C plugin API is already ok (there is data pointer for callbacks).
<br />Therefore, all scripts for development version are incompatible with this new version. All official scripts have been updated on plugins page.</p>
<p>This data string must be added after each callback function in arguments of functions. For example in python :</p>
<pre>weechat.hook_command("go", "Quick jump to buffers", "", "", "", "go_cmd")
(...)
def go_cmd(buffer, args):</pre>
<p>becomes:</p>
<pre>weechat.hook_command("go", "Quick jump to buffers", "", "", "", "go_cmd", "")
(...)
def go_cmd(data, buffer, args):</pre>Script weeget.py, a script manager!urn:md5:0411284a4c6d8e243b2a71a40fbdbd722009-04-07T18:42:00+02:002021-03-13T01:37:10+01:00Sébastien Helleuscriptspythonscript <p>A new script <a href="https://weechat.org/scripts/source/stable/weeget.py">weeget.py</a> is now available. It is a scripts manager: you can install, remove, upgrade your scripts using command /weeget.</p>
<p>Following actions are available :</p>
<ul>
<li><strong>update</strong> local cache (list of scripts, which automatically expires after one hour by default),</li>
<li><strong>show</strong> detailed info about scripts,</li>
<li><strong>install</strong> scripts,</li>
<li><strong>remove</strong> scripts,</li>
<li><strong>upgrade</strong> all obsolete scripts,</li>
<li><strong>check</strong> status of local scripts.</li>
</ul>
<p>Weeget uses its own configuration file, called <em>wg.conf</em>.</p>
<p>You can setup some options with /set:</p>
<ul>
<li><code>/set wg.color.installed color</code> (default: yellow)</li>
<li><code>/set wg.color.language color</code> (default: lightblue)</li>
<li><code>/set wg.color.obsolete color</code> (default: lightmagenta)</li>
<li><code>/set wg.color.running color</code> (default: lightgreen)</li>
<li><code>/set wg.color.script color</code> (default: cyan)</li>
<li><code>/set wg.color.unknown color</code> (default: lightred)</li>
<li><code>/set wg.scripts.cache_expire time</code> (default: 60)</li>
<li><code>/set wg.scripts.dir directory</code> (default: %h/weeget)</li>
<li><code>/set wg.scripts.url url</code> (default: http://www.weechat.org/files/plugins.xml.gz)</li>
</ul>
<p><strong>Updated on 2012-09-29</strong>: since version 0.3.9, weeget.py has been replaced by a C plugin called "script" (command /script), see <a href="https://blog.weechat.org/post/2012/08/14/Scripts-manager">Scripts manager</a>.</p>
<p>Screenshot:
<a href="https://blog.weechat.org/public/weechat_weeget_2009-04-06.png"><img src="https://blog.weechat.org/public/.weechat_weeget_2009-04-06_m.jpg" alt="WeeChat weeget" style="display:table; margin:0 auto;" title="weeget.py" /></a></p>Script vdm.pyurn:md5:7c2b88195097a66c6a46c7371e91693a2009-03-08T09:48:00+01:002019-11-04T22:05:39+01:00Sébastien Helleuscriptspythonscript <p>A new script <a href="https://weechat.org/scripts/source/stable/vdm.py">vdm.py</a> is now available. With that script, you can read <a href="http://www.fmylife.com">fmylife.com</a> and <a href="http://www.viedemerde.fr">viedemerde.fr</a> websites in WeeChat, using command /vdm.
<br />
Help is available with <code>/help vdm</code> when script is loaded.</p>
<p>You can setup some options with /set:</p>
<ul>
<li><code>/set plugins.var.python.vdm.auto_switch on/off</code> (default: on)</li>
<li><code>/set plugins.var.python.vdm.blank_line on/off</code> (default: on)</li>
<li><code>/set plugins.var.python.vdm.color_number color</code> (default: cyan)</li>
<li><code>/set plugins.var.python.vdm.colors color1;color2;...</code> (default: default;green;brown)</li>
<li><code>/set plugins.var.python.vdm.lang fr/en</code> (default: en)</li>
<li><code>/set plugins.var.python.vdm.number<sub>as</sub>prefix on/off</code> (default: on)</li>
<li><code>/set plugins.var.python.vdm.reverse on/off</code> (default: off)</li>
<li><code>/set plugins.var.python.vdm.url url</code> (default: http://api.betacie.com/view/%s?key=readonly&language=%s)</li>
</ul>
<p>Screenshot:
<a href="https://blog.weechat.org/public/weechat_vdm_2009-03-08.png"><img src="https://blog.weechat.org/public/.weechat_vdm_2009-03-08_m.jpg" alt="WeeChat vdm" style="display:table; margin:0 auto;" title="vdm.py" /></a></p>New hook "process"urn:md5:c1f3e86c0b7b21ca14cb85bf140b60fd2009-03-06T18:38:00+01:002010-07-26T15:18:05+02:00Sébastien Helleupluginsapiexecpluginscript <p>New hook type "process" has been added to WeeChat. You can use it in C plugins, and all scripts languages (perl, python, ruby, lua and tcl).</p>
<p>It runs a command with fork, and send you result (return code, stdout and stderr) via a callback, when command has ended, or if WeeChat output buffer is full (then it will be partial result of command). There is optional timeout (in milliseconds), to kill process if it's still running after given time.</p>
<p>The script <a href="http://www.weechat.org/scripts/source/stable/shell.py">shell.py</a> has been updated to use that new hook.</p>Script go.pyurn:md5:ec42a66a3990927b3e0700516d98448c2009-02-08T20:19:00+01:002019-11-04T22:05:57+01:00Sébastien Helleuscriptspythonscript <p>A new script <a href="https://weechat.org/scripts/source/stable/go.py">go.py</a> is now available. With that script, you can quickly jump to other buffers, by typing some letters. You can use Tab and shift-Tab keys to select next/previous buffer in list.
<br />
Help is available with <code>/help go</code> when script is loaded.</p>
<p>Screenshot:
<a href="https://blog.weechat.org/public/weechat_go_2009-02-08.png"><img src="https://blog.weechat.org/public/.weechat_go_2009-02-08_m.jpg" alt="WeeChat go" style="display:table; margin:0 auto;" title="go.py" /></a></p>New version of script iset.plurn:md5:124f3746e0b7d30aae9b7434e3b82b4a2009-01-04T12:29:00+01:002021-03-13T01:39:20+01:00Sébastien Helleuscriptsperlscript <p>Script <a href="https://weechat.org/scripts/source/stable/iset.pl">iset.pl</a> has been improved. Now you can setup colors for option names, types and values. And null values are displayed with different color (for IRC server options).
There's new config options, you can set with /set command:</p>
<ul>
<li><code>/set plugins.var.perl.iset.color<sub>bg</sub>selected color</code></li>
<li><code>/set plugins.var.perl.iset.color_option color</code></li>
<li><code>/set plugins.var.perl.iset.color<sub>option</sub>selected color</code></li>
<li><code>/set plugins.var.perl.iset.color_type color</code></li>
<li><code>/set plugins.var.perl.iset.color<sub>type</sub>selected color</code></li>
<li><code>/set plugins.var.perl.iset.color_value color</code></li>
<li><code>/set plugins.var.perl.iset.color<sub>value</sub>selected color</code></li>
<li><code>/set plugins.var.perl.iset.color<sub>value</sub>undef color</code></li>
<li><code>/set plugins.var.perl.iset.color<sub>value</sub>undef_selected color</code></li>
</ul>
<p>A screenshot is better than long speech:
<a href="https://blog.weechat.org/public/weechat_iset_2009-01-04.png"><img src="https://blog.weechat.org/public/.weechat_iset_2009-01-04_m.jpg" alt="weechat_iset_2009-01-04.png" style="display:table; margin:0 auto;" title="weechat_iset_2009-01-04.png, jan 2009" /></a></p>
<p><strong>Updated on 2017-06-26</strong>: the script is now obsolete, replaced by the builtin <a href="https://blog.weechat.org/post/2017/06/26/Fset-plugin">fset plugin</a>.</p>Script mastermind.plurn:md5:07cbaebf07159e3a0983a9d7985ca94f2008-11-13T18:53:00+01:002019-11-04T22:07:32+01:00Sébastien Helleuscriptsgameperlscript <p>A new script <a href="https://weechat.org/scripts/source/stable/mastermind.pl">mastermind.pl</a> is now available!</p>
<p>Screenshot:
<a href="https://blog.weechat.org/public/weechat_mastermind_2008-11-13.png"><img src="https://blog.weechat.org/public/.weechat_mastermind_2008-11-13_m.jpg" alt="Mastermind" style="display:table; margin:0 auto;" title="mastermind.pl" /></a></p>
<p>Keys are displayed on buffer displayed by /mastermind, enjoy!</p>New version of script buffers.plurn:md5:732cb9f22ce4c3df411a9f37eb9edbf32008-09-02T20:29:00+02:002021-11-08T22:23:24+01:00Sébastien Helleuscriptsbarperlscript <p>Script <a href="https://weechat.org/scripts/source/stable/buffers.pl">buffers.pl</a> has been improved. Now you can hide categories, and there's color for lines according to hotlist (activity on buffers).
There's new config options, you can set with /set command:</p>
<p>Hide categories:</p>
<ul>
<li><code>/set plugins.var.perl.buffers.show_category off</code></li>
</ul>
<p>Change colors (replace "color" by your color, which may be "fg" or "fg,bg"):</p>
<ul>
<li><code>/set plugins.var.perl.buffers.color_number color</code></li>
<li><code>/set plugins.var.perl.buffers.color_slash color</code></li>
<li><code>/set plugins.var.perl.buffers.color_hotlist_low color</code></li>
<li><code>/set plugins.var.perl.buffers.color_hotlist_message color</code></li>
<li><code>/set plugins.var.perl.buffers.color_hotlist_private color</code></li>
<li><code>/set plugins.var.perl.buffers.color_hotlist_highlight color</code></li>
</ul>
<p>A screenshot is better than long speech:
<a href="https://blog.weechat.org/public/weechat_bar_buffers_2008-09-02.png"><img src="https://blog.weechat.org/public/.weechat_bar_buffers_2008-09-02_m.jpg" alt="weechat_bar_buffers_2008-09-02.png" style="display:table; margin:0 auto;" title="weechat_bar_buffers_2008-09-02.png, sep 2008" /></a></p>
<p><strong>Updated on 2017-05-13</strong>: the script is now obsolete, replaced by the builtin buflist plugin, introduced in <a href="https://blog.weechat.org/post/2017/05/13/Version-1.8">version 1.8</a>.</p>Script iset.plurn:md5:7ade3e976d2dc202ae7ca9759dd258492008-04-19T20:55:00+02:002021-03-13T01:39:39+01:00Sébastien Helleuscriptsperlscript <p>A new script <a href="https://weechat.org/scripts/source/stable/iset.pl">iset.pl</a> is now available. With that script, you can change WeeChat options with better interface than /set.
<br />
Help is available with <code>/help iset</code> when script is loaded.</p>
<p>Screenshot:
<a href="https://blog.weechat.org/public/weechat_iset_2008-10-22.png"><img src="https://blog.weechat.org/public/.weechat_iset_2008-10-22_m.jpg" alt="WeeChat iset" style="display:table; margin:0 auto;" title="iset.pl" /></a></p>
<p><strong>Updated on 2017-06-26</strong>: the script is now obsolete, replaced by the builtin <a href="https://blog.weechat.org/post/2017/06/26/Fset-plugin">fset plugin</a>.</p>Script weetris.plurn:md5:e3b9ee5cff8edadbc295bdf44a273e702008-03-29T20:57:00+01:002022-10-09T13:56:40+02:00Sébastien Helleuscriptsgameperlscript <p>A new script weetris.pl is now available! You can now play to your favorite game inside WeeChat :)</p>
<p>Screenshot:
<a href="https://blog.weechat.org/public/weetris_2008-08-12.png"><img src="https://blog.weechat.org/public/./.weetris_2008-08-12_m.jpg" alt="WeeTris" style="display:table; margin:0 auto;" title="weetris.pl" /></a></p>
<p>Short instructions:</p>
<ul>
<li>keys are:
<ul>
<li>Left/Right/Bottom: move</li>
<li>Up: rotate</li>
<li>Alt+n: start a new game</li>
</ul></li>
<li>number of lines are displayed</li>
</ul>
<p>Incoming features:</p>
<ul>
<li>pause key</li>
<li>view of next form</li>
<li>save/resume game</li>
<li>network game: vs other players (over IRC or other network protocol)</li>
</ul>
<p><strong>Updated on 2019-09-29</strong>: the script has been rewritten in Python: <a href="https://weechat.org/scripts/source/weetris.py">weetris.py</a>.</p>Barsurn:md5:957df0b6614087c63284ecf36c8abd632008-03-15T17:09:00+01:002021-03-13T01:40:03+01:00Sébastien Helleucorebarscript <p>Bars have been added to WeeChat. They are used to display informations around chat area. In near future, some existing items will become real bars (like title, nicklist, status, input).
<br />
Plugin and script API is now ready for using these bars. Following screenshot is a demo of scripts <a href="https://weechat.org/scripts/source/stable/buffers.pl">buffers.pl</a> and uptime.pl:</p>
<p><strong>Updated on 2008-10-12</strong>: new bars are now used: title, nicklist, status, input.</p>
<p><a href="https://blog.weechat.org/public/weechat_bars_buffers_uptime.png"><img src="https://blog.weechat.org/public/.weechat_bars_buffers_uptime_m.jpg" alt="weechat_bars_buffers_uptime.png" style="display:table; margin:0 auto;" title="weechat_bars_buffers_uptime.png, aoû 2008" /></a></p>