10

Sometimes I need to reboot my linode, which includes my IRC client, weechat, running in tmux. When I do this, I prefer to save all the buffers that are running and rejoin them. I was under the impression that:

 /layout save
 /save

Would store the appropriate information and

 /layout apply

Would... well apply it. Unfortunately, while it correctly places new channels, it does not in any way rejoin the ones I was connected to before. I understand that I can manually add a list of channels to autojoin, for each network, but if I have to do that tedious process each time I need to close and reopen weechat... well that would be a drag at the very least.

Any ideas? I am sure I've done this before.

14

Okay, after asking around in the freenode #weechat channel a bit I finally got this:

  • Download the autojoin.py script to ~/.weechat/python/autoload
  • Run /python autoload to load the script
  • Run /autojoin --run to store the channels to join
  • Run /layout store to store the order of the channels
  • Run /save to save your settings to a file

Next time you start weechat and connect to a server the channels you were connected to when you did these steps will be joined for you.

| improve this answer | |
  • what version of weechat are you on, as debian stable is way behind current, and the wording of your question does not mention using an old version of weechat? Not that it a big deal, but just a dated method/harder. – demure Apr 22 '14 at 2:14
  • Is it that much harder though? You install the script with wget instead of another command, and you use /python instead of /script. While I understand that many don't see the benefit of using packaged software, this works for both old and new versions. So why not? – Frew Schmidt Apr 22 '14 at 12:40
  • One of the big things with the /script command, is you can keep your scripts up to date with minimal effort; it will tell you that there are new versions, and you can update right from the interactive buffer. No reason to go back to the days of irssi, and update/install by hand ^_- – demure Apr 23 '14 at 3:28
  • Yeah, that's legit. Although in this case I still think it's overkill, given that the script in question was last updated 5 years ago. – Frew Schmidt Apr 23 '14 at 13:06
  • 1
    I'm on Weechat 1.0.1, and I needed to call /layout store instead – Joost May 4 '16 at 7:51
0

Here is how you can automate the other answer such that your buffer layout is saved to disk every hour:

  1. Get the cron.py user script:

    • Run /script (e.g. in the weechat.core buffer)
    • Type cron, press Enter in the buffer which was just opened
    • Select cron.py via cursors, type i and press Enter for installation.
  2. In the weechat.core buffer, execute the following command:

    /cron add 0 1 * * * * core.weechat commands /autojoin --run;/layout store;/save
    

    This adds an hourly cron job running the commands the other answer suggested. Note that the commands are separated by ; without trailing spaces! Execute /cron help for more information.

  3. Test this by first executing /cron list, remembering the number of the cron job you just added (e.g. 001), and then running /cron exec 001.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.