WeeChat DevCenter

scripts

Entries feed

Friday, February 26 2021

Script anti_password.py

You've sent your password to the wrong window (ie: WeeChat), and it is now public, viewed by 1,500 people?
For now, you have to change your password.

For the future, a new script is now available: anti_password.py.

How does it work?

When you press Enter to send text to a buffer, the script detects if the input is a password, in two ways:

  1. If the input matches a condition: number of words, lower/upper/digit/special chars.
  2. If a secured data value is in the input (reminder: secured data is the recommended way to store all your passwords in WeeChat) (requires WeeChat ≥ 3.1).

If a password is detected, the text is not sent to the buffer (3 times with the default config).

Note: the WeeChat commands (ie /xxx) are ignored and are always sent.

Options

There are 4 options to configure the script (see /fset anti_password for a list of options with help):

  • allowed_regex: allowed regular expression (checked first)
  • password_condition: the condition used to detect a password
  • check_secured_data: whether the script checks for secured data (disabled, input equals secured data or secured data included in input)
  • max_rejects: the number of times the same input is rejected; after this number, the input is finally sent to the buffer.

Keep your passwords safe!

Updated on 2021-03-13: added option allowed_regex.

Friday, March 16 2012

SameGame

A new script samegame.py is now available! More info about this game is available at http://en.wikipedia.org/wiki/SameGame.

If you are using weeget, just do: /weeget install samegame.py

Mouse is required, so you must have WeeChat >= 0.3.6.

For help: /help samegame.

Screenshot (click for full size):

SameGame

Enjoy!

Monday, October 31 2011

Shorten URLs with own HTTP server

Don't panic with long URLs and don't give your private URLs any more to shortening services!
A new script urlserver.py 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.

Many options are available to customize shortening of URLs, display in WeeChat and HTML page (see /help urlserver and /set plugins.var.python.urlserver.*).

The URLs are saved into ~/.weechat/urlserver_list.txt when script is unloaded, so that URLs are persistent when you restart WeeChat.

A screenshot of HTML page with list of URLs (click for full size):

Urlserver

Friday, October 28 2011

Change short name of buffers

The short name of buffers can be changed with /buffer set short_name <new_name> command. This might be useful for long channel names displayed in the buffers bar (buflist plugin with WeeChat ≥ 1.8 or script buffers.pl with an older version).

For example on channel #weechat:

/buffer set short_name #wee

New value is used immediately, but is not saved in config file. To make it persistent, you have to use script buffer_autoset.py:

/autosetbuffer add irc.freenode.#weechat short_name #wee

Note1: it's not recommended to set short name of query buffers, because WeeChat will change name of buffer when nick changes.

Note2: you should use command /buffer set with precautions, it is not recommended to change other buffer properties if you're not sure about what you do. This could lead to weird behaviour or a crash.

Sunday, October 2 2011

Game Minesweeper

A new script minesweeper.py is now available, the famous Minesweeper game!

If you are using weeget, just do: /weeget install minesweeper.py

256 colors mode is highly recommended, and mouse support (with WeeChat >= 0.3.6). If you have 16 colors or less, you can do: /minesweeper 16col

For help: /help minesweeper.

Screenshot (click for full size):

Minesweeper

Enjoy!

Saturday, August 20 2011

Game Flood'it

A new script floodit.py is now available! You can now play to Flood'it inside WeeChat, with following features:

  • single mode
  • versus mode (play vs computer)
  • demo mode
  • 3 different board sizes.

If you are using weeget, just do: /weeget install floodit.py

For help: /help floodit.

Note: mouse is supported with latest devel version of WeeChat (0.3.6-dev).

Screenshot (click for full size):

Flood'it

Enjoy!

Monday, May 16 2011

Script cmd_help.py

A new script cmd_help.py is now available. It displays contextual help on command line like:

  • commands:
    • list of commands if you type a non-complete command name, for example: /serv
    • help about command arguments if you type command (and optionally arguments), for example with /server add you'll see arguments for adding an IRC server
  • options:
    • list of options if you type a non-complete option name with command /set, for example: /set weechat
    • help about option if you type a complete or unique option name with command /set, for example: /set weechat.look.command_chars

Note: this script requires version 0.3.5 of WeeChat.

Screenshot (click for full size):

cmd_help.py

Wednesday, August 4 2010

Script jabber.py

A new script jabber.py is now available. You can connect to jabber servers and chat with buddies.

Quick start:

  • add server: /jabber add jabberfr myname@jabber.fr mypassword
  • connect: /jabber connect jabberfr
  • chat: /jchat nick

Commands provided by script:

  • /jabber
  • /jchat
  • /jmsg

Configuration file is jabber.conf.

Currently, MUCs are not supported, and you can't manage your account, like create/update account, add/remove buddies in roster (nicklist).

Enjoy Jabber!

Monday, July 26 2010

Script cron.py

A new script cron.py is now available. It can schedule jobs or message like system commands cron and at.

Two commands are provided by this script:

  • /cron: schedule job like system command 'cron'
  • /at: schedule job for only one execution, in near future, like system command 'at'.

You can get more help with /help cron and /help at.

You can setup some options with /set:

  • /set plugins.var.python.cron.auto_reload on/off (default: on)
  • /set plugins.var.python.cron.auto_save on/off (default: on)
  • /set plugins.var.python.cron.filename "path" (default: "%h/cron.txt")
  • /set plugins.var.python.cron.quiet_exec on/off (default: off)
  • /set plugins.var.python.cron.quiet_load on/off (default: off)
  • /set plugins.var.python.cron.quiet_save on/off (default: on)

Thursday, October 15 2009

Script translate.py

A new script translate.py is now available. It can translate words with a command or in input (whole input or last word).

Base and target languages can be customized and given as argument of command, or at beginning of input if you're using a key calling command.

Example of keys you can bind to use script:

  • translate input with Alt+t, Alt+t (using default from_to): /key bind meta-tmeta-t /translate
  • translate input with Alt+t, Alt+r (reverse of from_to): /key bind meta-tmeta-r /translate !
  • translate last word in input with Alt+t, Alt+w (using default from_to): /key bind meta-tmeta-w /translate +
  • restore input as it was before last translation with Alt+t, Alt+u: /key bind meta-tmeta-u /translate <

Other examples:

  • reverse languages (english to french by default): /translate ! this is a test
  • english to italian: /translate en_it I want this string in italian

Recommended alias:

/alias tr /translate

You can get more help with /help translate.

Monday, October 5 2009

Script hlpvitem.py

A new script hlpvitem.py is now available. It displays item in a bar (like status) with highlight or private message, from an hidden buffer. So you will see content of message before switching to that buffer.

You must add item in a bar, like status, with this command:

/set weechat.bar.status.items

then press "Tab" and complete string by adding for example (without quotes): ",[hlpv]"

Screenshot: WeeChat hlpvitem

You can setup some options with /set:

  • /set plugins.var.python.hlpvitem.showallbuffers on/off (default: off)
  • /set plugins.var.python.hlpvitem.buffer_number on/off (default: on)
  • /set plugins.var.python.hlpvitem.buffershortname on/off (default: on)
  • /set plugins.var.python.hlpvitem.highlight on/off (default: on)
  • /set plugins.var.python.hlpvitem.private on/off (default: on)
  • /set plugins.var.python.hlpvitem.string_highlight "string" (default: empty)
  • /set plugins.var.python.hlpvitem.string_private "string" (default: empty)
  • /set plugins.var.python.hlpvitem.string_delimiter "string" (default: " > ")
  • /set plugins.var.python.hlpvitem.colorstringhighlight color (default: empty)
  • /set plugins.var.python.hlpvitem.colorstringprivate color (default: empty)
  • /set plugins.var.python.hlpvitem.colorbuffernumber color (default: empty)
  • /set plugins.var.python.hlpvitem.colorbuffername color (default: "default")
  • /set plugins.var.python.hlpvitem.color_prefix color (default: "white")
  • /set plugins.var.python.hlpvitem.color_delimiter color (default: "cyan")
  • /set plugins.var.python.hlpvitem.color_message color (default: "default")
  • /set plugins.var.python.hlpvitem.visible_seconds N (default: 7)

Saturday, May 2 2009

Data for callbacks in script API

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).
Therefore, all scripts for development version are incompatible with this new version. All official scripts have been updated on plugins page.

This data string must be added after each callback function in arguments of functions. For example in python :

weechat.hook_command("go", "Quick jump to buffers", "", "", "", "go_cmd")
(...)
def go_cmd(buffer, args):

becomes:

weechat.hook_command("go", "Quick jump to buffers", "", "", "", "go_cmd", "")
(...)
def go_cmd(data, buffer, args):

Tuesday, April 7 2009

Script weeget.py, a script manager!

A new script weeget.py is now available. It is a scripts manager: you can install, remove, upgrade your scripts using command /weeget.

Following actions are available :

  • update local cache (list of scripts, which automatically expires after one hour by default),
  • show detailed info about scripts,
  • install scripts,
  • remove scripts,
  • upgrade all obsolete scripts,
  • check status of local scripts.

Weeget uses its own configuration file, called wg.conf.

You can setup some options with /set:

  • /set wg.color.installed color (default: yellow)
  • /set wg.color.language color (default: lightblue)
  • /set wg.color.obsolete color (default: lightmagenta)
  • /set wg.color.running color (default: lightgreen)
  • /set wg.color.script color (default: cyan)
  • /set wg.color.unknown color (default: lightred)
  • /set wg.scripts.cache_expire time (default: 60)
  • /set wg.scripts.dir directory (default: %h/weeget)
  • /set wg.scripts.url url (default: http://www.weechat.org/files/plugins.xml.gz)

Updated on 2012-09-29: since version 0.3.9, weeget.py has been replaced by a C plugin called "script" (command /script), see Scripts manager.

Screenshot: WeeChat weeget

Sunday, March 8 2009

Script vdm.py

A new script vdm.py is now available. With that script, you can read fmylife.com and viedemerde.fr websites in WeeChat, using command /vdm.
Help is available with /help vdm when script is loaded.

You can setup some options with /set:

  • /set plugins.var.python.vdm.auto_switch on/off (default: on)
  • /set plugins.var.python.vdm.blank_line on/off (default: on)
  • /set plugins.var.python.vdm.color_number color (default: cyan)
  • /set plugins.var.python.vdm.colors color1;color2;... (default: default;green;brown)
  • /set plugins.var.python.vdm.lang fr/en (default: en)
  • /set plugins.var.python.vdm.numberasprefix on/off (default: on)
  • /set plugins.var.python.vdm.reverse on/off (default: off)
  • /set plugins.var.python.vdm.url url (default: http://api.betacie.com/view/%s?key=readonly&language=%s)

Screenshot: WeeChat vdm

Sunday, February 8 2009

Script go.py

A new script go.py 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.
Help is available with /help go when script is loaded.

Screenshot: WeeChat go

Sunday, January 4 2009

New version of script iset.pl

Script iset.pl 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:

  • /set plugins.var.perl.iset.colorbgselected color
  • /set plugins.var.perl.iset.color_option color
  • /set plugins.var.perl.iset.coloroptionselected color
  • /set plugins.var.perl.iset.color_type color
  • /set plugins.var.perl.iset.colortypeselected color
  • /set plugins.var.perl.iset.color_value color
  • /set plugins.var.perl.iset.colorvalueselected color
  • /set plugins.var.perl.iset.colorvalueundef color
  • /set plugins.var.perl.iset.colorvalueundef_selected color

A screenshot is better than long speech: weechat_iset_2009-01-04.png

Updated on 2017-06-26: the script is now obsolete, replaced by the builtin fset plugin.

Thursday, November 13 2008

Script mastermind.pl

A new script mastermind.pl is now available!

Screenshot: Mastermind

Keys are displayed on buffer displayed by /mastermind, enjoy!

Tuesday, September 2 2008

New version of script buffers.pl

Script buffers.pl 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:

Hide categories:

  • /set plugins.var.perl.buffers.show_category off

Change colors (replace "color" by your color, which may be "fg" or "fg,bg"):

  • /set plugins.var.perl.buffers.color_number color
  • /set plugins.var.perl.buffers.color_slash color
  • /set plugins.var.perl.buffers.color_hotlist_low color
  • /set plugins.var.perl.buffers.color_hotlist_message color
  • /set plugins.var.perl.buffers.color_hotlist_private color
  • /set plugins.var.perl.buffers.color_hotlist_highlight color

A screenshot is better than long speech: weechat_bar_buffers_2008-09-02.png

Updated on 2017-05-13: the script is now obsolete, replaced by the builtin buflist plugin, introduced in version 1.8.

Saturday, April 19 2008

Script iset.pl

A new script iset.pl is now available. With that script, you can change WeeChat options with better interface than /set.
Help is available with /help iset when script is loaded.

Screenshot: WeeChat iset

Updated on 2017-06-26: the script is now obsolete, replaced by the builtin fset plugin.

Saturday, March 29 2008

Script weetris.pl

A new script weetris.pl is now available! You can now play to your favorite game inside WeeChat :)

Screenshot: WeeTris

Short instructions:

  • keys are:
    • Left/Right/Bottom: move
    • Up: rotate
    • Alt+n: start a new game
  • number of lines are displayed

Incoming features:

  • pause key
  • view of next form
  • save/resume game
  • network game: vs other players (over IRC or other network protocol)

Updated on 2019-09-29: the script has been rewritten in Python: weetris.py.