Skip to content

Instantly share code, notes, and snippets.

View pascalpoitras's full-sized avatar

Pascal Poitras Dubois pascalpoitras

  • Longueuil, Quebec, Canada
View GitHub Profile
@pascalpoitras
pascalpoitras / difference-focus-bind.md
Last active June 1, 2024 17:20
difference-focus-bind.md

the hook_focus is triggered only if there's already a bind

for example the buflist already have a mouse bind so

/trigger add buflist_click focus buflist "" "" "/print -core clicked on buflist item"

then click on the buflist, the message is print

the time item in the status bar doesn't have any bind by default so

@pascalpoitras
pascalpoitras / gist.md
Last active November 18, 2025 19:13
For someone on IRC

WeeChat Screenshot

I could have pipe the output to jq but I always prefer to avoid using /exec -sh whenever possible

/alias add price_get /exec -hsignal price_value url:https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,livepeer,arbitrum,celestia&vs_currencies=usd&precision=2
/price_get
/item addreplace price "" "${plugins.var.price}"
/trigger addreplace item_price_content hsignal price_value
/trigger set item_price_content regex "/usd/ /out /,/ /out /[^[:alnum:]. ]//out /arbitrum/ARB/out /celestia/TIA/out /livepeer/LPT/out /ethereum/⟠/out /bitcoin/₿/out /([^ ]+ [^ ]+) ([^ ]+ [^ ]+) ([^ ]+ [^ ]+) ([^ ]+ [^ ]+) ([^ ]+ [^ ]+)/${re:2} ${re:4} ${re:5} ${re:1} ${re:3}/out"

/trigger set item_price_content command "/mute -core /set plugins.var.price ${out};/item refresh price"

@pascalpoitras
pascalpoitras / config.md
Created November 28, 2025 19:28
r3m's new WeeChat configuration

Come back soon!