I just discovered the menu.pl script by Nei. It adds a menubar at the top of WeeChat. You can use the mouse and it works very well. Tonight I played with it and that was nice. In this post, I will show you how to create a layout menu to switch between your layouts. Let’s start!
Install the script :
/script install menu.pl
Now you should have a menubar at the top of WeeChat :
Change visual settings
You can change the foreground and background color of the bar as you want :
/set weechat.bar.main_menu.color_bg default /set weechat.bar.main_menu.color_fg 31
And maybe add the separator :
/set weechat.bar.main_menu.separator on
Now, if you click on a menu you should see a submenu appears. Let’s use the same color as the menubar :
/set weechat.bar.sub_menu.color_bg default /set weechat.bar.sub_menu.color_fg 31
Click on File menu and you should see something like this :
If you look closely, you should see that the menu items are side by side. If you want to have them stacked one above the others, type :
/set weechat.bar.sub_menu.filling_top_bottom vertical
It should give something similar to this :
Create the menu and the menu items
Now that we like the way it looks, let’s remove all the menus and then add one called Layout.
/unset menu.var.1.* /unset menu.var.2.* /unset menu.var.3.* /unset menu.var.4.* /unset menu.var.5.* /unset menu.var.6.* /unset menu.var.7.* /unset menu.var.8.* /unset menu.var.9.*
Before we procede, do you have more than one layout? If you don’t know, you probably have only one. The example here is still possible but when you’ll click on a menu item nothing would appears except an error message from WeeChat. I already wrote a tutorial on how to create more than one layout. That beeing said, let’s create the menu and add two menu items, one for layout Normal and one for layout News :
/set menu.var.1.name "&Layout" /set menu.var.1.1.name "Normal" /set menu.var.1.1.command "/layout apply normal" /set menu.var.1.2.name "News" /set menu.var.1.2.command "/layout apply news"
That’s it. Enjoy!