Skip to content

Instantly share code, notes, and snippets.

@Strykar
Last active August 9, 2020 07:42
Show Gist options
  • Save Strykar/64e6b4bfd147f6be2990e8db0e8b0e31 to your computer and use it in GitHub Desktop.
Save Strykar/64e6b4bfd147f6be2990e8db0e8b0e31 to your computer and use it in GitHub Desktop.
# This will probably be need to run again after setting up weechat and restarting it.
/buffer_autoset add core.weechat notify 3
/buffer_autoset add irc.server.* notify 3
/buffer_autoset add relay.relay.list short_name relay
/buffer_autoset add core.weechat localvar_set_my_control 1
/buffer_autoset add core.highmon localvar_set_my_control 1
/buffer_autoset add core.chanmon localvar_set_my_control 1
/buffer_autoset add irc.freenode.##news localvar_set_my_control 1
/buffer_autoset add irc.freenode.##news short_name news
/buffer_autoset add core.chanmon title Channels Monitor
/trigger add chanmon_like print "*;irc_privmsg"
/trigger set chanmon_like conditions "${buffer.local_variables.type} == channel && ${buffer.full_name} != irc.freenode.##news"
/trigger set chanmon_like command "/print -newbuffer chanmon -tags ${tg_tags} ${cutscr:4,${color:${weechat.color.chat_prefix_more}}${weechat.look.prefix_buffer_align_more},${color:${info:nick_color_name,${server}}}${server}}${color:${info:nick_color_name,${channel}}}${channel}\t${if:${tg_tags} !~ ,irc_action,?${weechat.look.quote_nick_prefix}${tg_prefix}${color:reset}${weechat.look.quote_nick_suffix}:${tg_prefix}${color:reset}} ${tg_message}"
/eval /set weechat.startup.command_after_plugins "${weechat.startup.command_after_plugins};/buffer add highmon"
/buffer_autoset add core.highmon title Highlight Monitor
/trigger add highmon_like print "*;irc_privmsg"
/trigger set highmon_like conditions "${tg_highlight} == 1 && ${tg_displayed} == 1 && ${buffer.local_variables.type} == channel"
/trigger set highmon_like command "/print -newbuffer highmon -tags ${tg_tags} ${cutscr:4,${color:${weechat.color.chat_prefix_more}}${weechat.look.prefix_buffer_align_more},${color:${info:nick_color_name,${server}}}${server}}${color:${info:nick_color_name,${channel}}}${channel}\t${if:${tg_tags} !~ ,irc_action,?${weechat.look.quote_nick_prefix}${tg_prefix}${color:reset}${weechat.look.quote_nick_suffix}:${tg_prefix}${color:reset}} ${tg_message}"
/filter add news irc.freenode.##news !nick_newsly*+!host_yano@unaffiliated/yano/bot/rssly,!irc_privmsg *
/filter add news_interest irc.freenode.##news nick_newsly*+irc_privmsg,host_yano@unaffiliated/yano/bot/rssly+irc_privmsg !^(\s|\[)(Reddit [-] /r/netsec|Wired|XKCD|EFF Updates|Washington Post - National News|NYT - US|NYT - Technology|Reuters - World|Time - WorldGoogle News - Technology|Google News - Science|Times of India - India|Google News - Pakistan|CTV News - Canada|LinuxJournal|techdirt|TorrentFreak|Science Daily|Hacker News|CNET|phoronix|Ars Technica|The Intercept|Canoe|Huffington Post [-] Weird News)( \-| | |\])
/trigger add news_transform line *;irc.freenode.##news;irc_privmsg+nick_newsly*
/trigger set news_transform regex "/.*/${tg_message_nocolor}/site_name /^\[([^]]+)\].*/${re:1}/site_name /.*/${tg_message_nocolor}/title /^\[[^]]+\]//title / - / ${color:-underline} /site_name /.*/${site_name}/site_color /^([^]+).*/${info:nick_color_name,${re:1}}/site_color /.*/${title}/url ==.*(https?://[^ ]+).*==${re:1}==url /\+/%00/url /,/%01/url /\!/%02/url /\*/%03/url /.*/${re:0}url_${url}/tags ==https?://[^ ]+ .*====title /.*/${color:_black,${site_color}} ${site_name} ${color:${site_color},default}${color:reset}${title}/message /.*//prefix"
# This is safe to do, unsure why it needs to be done after instead of working from weechat_conf1 - https://gist.github.com/Strykar/7fd0ab3a82ef1b58768df3c411f46f65 </br>
# Old config below:
/window merge all
/eval /window splith ${calc:8 / ${window[gui_current_window].win_height} * 100 // 1}
/buffer add -switch highmon
/window splitv 40
/buffer ##news
/window splitv 75
/buffer exec.conky
/window 1
/set buflist.format.number ""
/layout store highlight-news-conky
/autosort rules update 4 ${if:${plugin}==irc?${info:autosort_order,${server},bitlbee,lair,freenode,oftc,efnet,dn42,gitter,gimpnet,gamesurge,*}}
# or
/autosort rules update 4 ${if:${plugin}==irc?${info:autosort_order,${server},bitlbee,lair,freenode,oftc,efnet,dn42,gitter,gimpnet,gamesurge,googlecloud-community.slack.com,*}}
# or
/autosort rules update 4 ${if:${plugin}==irc?${info:autosort_order,${server},bitlbee,lair,freenode,oftc,snoonet,efnet,dn42,gitter,gimpnet,gamesurge,irc2p,*}}
/autosort rules update 5 ${script_or_plugin}==slack?${info:autosort_order,${server},googlecloud-community.slack.com,openobservatory.slack.com}
/autosort rules update 6 ${info:autosort_order,${type},server,*,channel,private}
/autosort rules update 7 ${french_channels_pvs_first}
/autosort rules update 8 ${hashless_name}
/autosort rules add 9 ${buffer.full_name}
# Go to #archlinux-bugs buffer and type:
/buffer_autoset add irc.freenode.#archlinux-bugs highlight_tags nick_archlinux-bugbot+irc_privmsg
# Go to ##news and highmon buffers and type:
/eval /buffer_autoset add ${buffer.full_name} time_for_each_line 0
/layout store highlight-news-conky
# Rebind right click instead of middle mouse button
/key bindctxt mouse @*:button2 /cursor go ${_x},${_y}
# Move to full width 3 window layout
/bar del buflist
/bar del buflist_hotlist
/bar add buflist window left 1 1 buflist
/bar add buflist_hotlist window left 1 1 buflist2
/bar set buflist conditions ${window.number} == 1
/bar set buflist_hotlist conditions ${window.number} == 1
/bar set buflist separator off
/set weechat.bar.buflist.size 22
/set weechat.bar.buflist_hotlist.size 5
/set weechat.bar.buflist.priority 1
/set weechat.bar.buflist_hotlist.priority 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment