Compare commits

...

No commits in common. "master" and "master" have entirely different histories.

47 changed files with 2899 additions and 935 deletions

View File

@ -119,8 +119,3 @@ fi
# set EDITOR just in case
export EDITOR=nano
# run welcome script
if [ -f ~/.new_user ]; then
/usr/local/bin/welcome
fi

View File

@ -1,5 +1,5 @@
new -s tilde -n chat 'weechat-curses';
neww -n mail 'mutt';
new -s tilde -n chat 'firejail weechat-curses';
neww -n mail 'firejail mutt';
neww -n shell;
send-keys -t ":2" byobu-info Enter;

View File

@ -1,2 +1,3 @@
[ -r /usr/share/byobu/profiles/bashrc ] && . /usr/share/byobu/profiles/bashrc #byobu-prompt#
byobu-info

View File

@ -29,7 +29,7 @@
# Default: depends on the distro (which is either auto-detected, either set
# via $DISTRO)
LOGO="$(color g w) ~ $(color -) "
#LOGO="\o/"
# Abbreviate the release to N characters
# By default, this is disabled. But if you set RELEASE_ABBREVIATED=1

View File

@ -23,7 +23,7 @@ config_git_push=false
config_autoindent=true
config_file_rss="rss.xml"
config_gopher_name="$USER's gopherhole"
config_gopher_name="ben's gopherhole"
config_gopher_desc="this is my gopherhole"
config_rss_num_entries="10"

91
.kshrc
View File

@ -1,91 +0,0 @@
# This file contains examples of some of the things you may want to
# include in a user startup file.
# skip this setup for non-interactive shells
[[ -o interactive && -t 0 ]] || return
# disable core dumps
ulimit -c 0
# Environment variables. These could go in .profile if you prefer
export VISUAL=vi
export EDITOR=$VISUAL
export PAGER=less
export GZIP=-9
# set some shell options
set -o emacs -o trackall -o globstar
# specify search path for autoloadable functions
FPATH=/usr/share/ksh/functions:~/.func
# avoid certain file types in completion
FIGNORE='@(*.o|~*)'
# save more commands in history
HISTSIZE=500
HISTEDIT=$EDITOR
# aliases for various command shortcuts
alias ll='ls -lFb'
alias la='ls -LaFb'
alias pu='ps -fu $USER'
alias md=mkdir
alias rd=rmdir
# avoid problems with long argument lists for some commands (like xargs)
alias cp='command -x cp' mv='command -x mv' grep='command -x grep'
# some short functions
# empty line
empty() { echo $'\e[3J'; }
# man page viewer
mere() { nroff -man -Tman $1 | ${MANPAGER:-less}; }
# view/manipulate and export environment variables
setenv() {
case $# in
0) export ;;
1) export "$1"= ;;
*) export "$1"="$2" ;;
esac
}
# Use keyboard trap to map keys to other keys
# note that escape sequences vary for different terminals so these
# may not work for you
trap '.sh.edchar=${keymap[${.sh.edchar}]:-${.sh.edchar}}' KEYBD
keymap=(
[$'\eOD']=$'\eb' # Ctrl-Left -> move word left
[$'\eOC']=$'\ef' # Ctrl-Right -> move word right
[$'\e[3~']=$'\cd' # Delete -> delete to right
[$'\e[1~']=$'\ca' # Home -> move to beginning of line
[$'\e[4~']=$'\ce' # End -> move to end of line
)
# keep a shortened version of the current directory for the prompt
function _cd {
typeset -n dir=HOME
"cd" "$@"
if [[ $PWD = $HOME* && $HOME != / ]]; then
_pwd=\~${PWD#$HOME}
return
fi
for dir in JAVA_HOME GNOMEDIR; do
if [[ -n $dir && $PWD = $dir* ]]; then
_pwd="\$${!dir}${PWD#$dir}"
return
fi
done
_pwd="$PWD"
}
alias cd=_cd
_cd .
# put the current directory and history number in the prompt
PS1='$_pwd [!]\$ '

57
.mkshrc
View File

@ -1,57 +0,0 @@
# Debian mksh
# Skeleton ~/.mkshrc file adding a level of indirection
# check if this is really mksh # {((
case ${KSH_VERSION:-} in
*LEGACY\ KSH*|*MIRBSD\ KSH*) ;;
*) \return 0 ;;
esac # }
# customise your favourite editor here; first one found is used
for EDITOR in "${EDITOR:-}" sensible-editor jupp jstar mcedit ed vi editor; do
EDITOR=$(\\builtin whence -p "$EDITOR") || EDITOR=
[[ -n $EDITOR && -x $EDITOR ]] && break
EDITOR=
done
# source the system-wide mkshrc file
[[ -s /etc/mkshrc ]] && \. /etc/mkshrc
# work around #813164
\\builtin alias ls='ls -N'
# prepend $debian_chroot support to PS1
p=$'\001'
if [[ ${PS1:1:1} = $'\r' ]]; then
p=${PS1:0:1}
PS1=${PS1:2}
else
p=$'\001'
fi
[[ -z ${debian_chroot:-} && -r /etc/debian_chroot ]] && \
debian_chroot=$(</etc/debian_chroot)
PS1=$p$'\r${debian_chroot:+'$p$'\e[0;1m'$p'($debian_chroot)'$p$'\e[0m'$p'}'$PS1
\\builtin unset p
\: put your local alias/function definitions, patches, etc. here
# fixup ncurses-term badness
#[[ $TERM = screen.* ]] && TERM=screen
# force sane environment (e.g. for scripting)
#\\builtin unset LC_ADDRESS LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
# LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
# LC_TELEPHONE LC_TIME LANGUAGE LANG LC_ALL
# optionally: switch to a slightly user-friendly and more portable locale
#p=en_GB.utf8
#\\builtin export LANG=C LC_CTYPE=$p LC_MEASUREMENT=$p LC_MESSAGES=$p LC_PAPER=$p
# and/or: Debian-specific libc feature (#609306, eglibc 2.13+)
#\\builtin export LANG=C.UTF-8 LC_CTYPE=C.UTF-8
#\\builtin export LC_ALL=C.UTF-8
# in either case: sync mksh UTF-8 mode to current locale (expected on GNU)
\\builtin set -U; [[ ${LC_ALL:-${LC_CTYPE:-${LANG:-}}} = *[Uu][Tt][Ff]?(-)8* ]] || \\builtin set +U
#\\builtin unset p
\: make sure this is the last line, to ensure a good return code

View File

View File

@ -26,3 +26,6 @@ if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# uncomment following line to add byobu to your shell
# _byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true

View File

@ -1,12 +1,5 @@
#
# weechat -- alias.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# alias.conf -- weechat v1.0.1
#
[cmd]
@ -23,9 +16,9 @@ CL = "buffer clear"
CLOSE = "buffer close"
CS = "quote chanserv"
EXIT = "quit"
HS = "quote hostserv"
IG = "ignore"
J = "join"
HS = "quote hostserv"
K = "kick"
KB = "kickban"
LEAVE = "part"
@ -35,14 +28,11 @@ MSGBUF = "command -buffer $1 * /input send $2-"
MUB = "unban *"
N = "names"
NS = "quote nickserv"
OS = "quote operserv"
Q = "query"
REDRAW = "window refresh"
save_settings = "/autojoin --run;/layout store;/save"
SAY = "msg *"
setup_aspell = "/set weechat.bar.rootinput.items [input_prompt]+(away),[input_search],[input_paste],input_text,aspell_suggest;/set aspell.check.default_dict en_US;/set aspell.check.suggestions 4;/set aspell.check.enabled on;/unalias setup_aspell;/save"
SIGNOFF = "quit"
SLAP = "me slaps $1 around a bit with a large trout"
T = "topic"
UB = "unban"
UMODE = "mode $nick"
@ -52,6 +42,7 @@ WC = "window merge"
WI = "whois"
WII = "whois $1 $1"
WW = "whowas"
setup_aspell = "/set weechat.bar.rootinput.items [input_prompt]+(away),[input_search],[input_paste],input_text,aspell_suggest;/set aspell.check.default_dict en_US;/set aspell.check.suggestions 4;/set aspell.check.enabled on;/unalias setup_aspell;/save"
[completion]
MSGBUF = "%(buffers_plugins_names)"

View File

@ -4,14 +4,12 @@
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
# Use /set or similar command to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[look]
add_newline = on
auto_scroll = 50
display_conditions = "${buffer.hidden}==0"
enabled = on
mouse_jump_visited_buffer = off
@ -21,7 +19,6 @@ nick_prefix = off
nick_prefix_empty = on
signals_refresh = ""
sort = "number,-active"
use_items = 1
[format]
buffer = "${format_number}${indent}${format_nick_prefix}${color_hotlist}${name}"
@ -35,7 +32,6 @@ hotlist_private = "${color:cyan}"
hotlist_separator = "${color:default},"
indent = " "
lag = " ${color:green}[${color:brown}${lag}${color:green}]"
name = "${name}"
nick_prefix = "${color_nick_prefix}${nick_prefix}"
number = "${color:green}${number}${if:${number_displayed}?.: }"
tls_version = " ${color:default}(${if:${tls_version}==TLS1.3?${color:green}:${if:${tls_version}==TLS1.2?${color:yellow}:${color:red}}}${translate:${tls_version}}${color:default})"

View File

@ -1,12 +1,5 @@
#
# weechat -- charset.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# charset.conf -- weechat v1.0.1
#
[default]

View File

@ -1,18 +1,10 @@
#
# weechat -- exec.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# exec.conf -- weechat v1.0.1
#
[command]
default_options = ""
purge_delay = 0
shell = "${env:SHELL}"
[color]
flag_finished = lightred

View File

@ -1,14 +0,0 @@
#
# weechat -- fifo.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[file]
enabled = on
path = "${weechat_runtime_dir}/weechat_fifo_${info:pid}"

View File

@ -1,96 +0,0 @@
#
# weechat -- fset.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[look]
auto_refresh = "*"
auto_unmark = off
condition_catch_set = "${count} >= 1"
export_help_default = on
format_number = 1
marked_string = "*"
scroll_horizontal = 10
show_plugins_desc = off
sort = "~name"
unmarked_string = " "
use_color_value = off
use_keys = on
use_mute = off
[format]
export_help = "# ${description2}"
export_option = "/set ${name} ${quoted_value}"
export_option_null = "/unset ${name}"
option1 = ""
option2 = "${marked} ${name} ${type} ${value2}${newline} ${empty_name} ${_default_value}${color:darkgray} -- ${min}..${max}${newline} ${empty_name} ${description}"
[color]
default_value = default
default_value_selected = white
description = default
description_selected = white
file = default
file_changed = brown
file_changed_selected = yellow
file_selected = white
help_default_value = white
help_description = default
help_name = white
help_quotes = darkgray
help_values = default
index = cyan
index_selected = lightcyan
line_marked_bg1 = default
line_marked_bg2 = default
line_selected_bg1 = blue
line_selected_bg2 = red
marked = brown
marked_selected = yellow
max = default
max_selected = white
min = default
min_selected = white
name = default
name_changed = brown
name_changed_selected = yellow
name_selected = white
option = default
option_changed = brown
option_changed_selected = yellow
option_selected = white
parent_name = default
parent_name_selected = white
parent_value = cyan
parent_value_selected = lightcyan
quotes = darkgray
quotes_changed = default
quotes_changed_selected = white
quotes_selected = default
section = default
section_changed = brown
section_changed_selected = yellow
section_selected = white
string_values = default
string_values_selected = white
title_count_options = cyan
title_current_option = lightcyan
title_filter = yellow
title_marked_options = lightgreen
title_sort = white
type = green
type_selected = lightgreen
unmarked = default
unmarked_selected = white
value = cyan
value_changed = brown
value_changed_selected = yellow
value_selected = lightcyan
value_undef = magenta
value_undef_selected = lightmagenta

View File

@ -1,17 +1,8 @@
#
# weechat -- irc.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# irc.conf -- weechat v1.0.1
#
[look]
buffer_open_before_autojoin = on
buffer_open_before_join = off
buffer_switch_autojoin = on
buffer_switch_join = on
color_nicks_in_names = off
@ -19,12 +10,10 @@ color_nicks_in_nicklist = on
color_nicks_in_server_messages = on
color_pv_nick_like_channel = on
ctcp_time_format = "%a, %d %b %Y %T %z"
display_account_message = on
display_away = local
display_ctcp_blocked = on
display_ctcp_reply = on
display_ctcp_unknown = on
display_extended_join = on
display_host_join = on
display_host_join_local = on
display_host_quit = on
@ -32,11 +21,11 @@ display_join_message = "329,332,333,366"
display_old_topic = on
display_pv_away_once = on
display_pv_back = on
display_pv_warning_address = off
highlight_channel = "$nick"
highlight_pv = "$nick"
highlight_server = "$nick"
highlight_tags_restrict = "irc_privmsg,irc_notice"
item_away_message = on
item_channel_modes_hide_args = "k"
item_display_server = buffer_plugin
item_nick_modes = on
@ -45,6 +34,9 @@ join_auto_add_chantype = off
msgbuffer_fallback = current
new_channel_position = none
new_pv_position = none
nick_color_force = ""
nick_color_hash = sum
nick_color_stop_chars = "_|["
nick_completion_smart = speakers
nick_mode = prefix
nick_mode_empty = off
@ -60,39 +52,27 @@ pv_tags = "notify_private"
raw_messages = 256
server_buffer = merge_with_core
smart_filter = on
smart_filter_account = on
smart_filter_chghost = on
smart_filter_delay = 5
smart_filter_join = on
smart_filter_join_unmask = 30
smart_filter_mode = "+"
smart_filter_nick = on
smart_filter_quit = on
temporary_servers = off
topic_strip_colors = off
typing_status_nicks = off
typing_status_self = off
[color]
input_nick = lightcyan
item_away = 130
item_channel_modes = lightcyan
item_lag_counting = default
item_lag_finished = 130
item_nick_modes = lightgreen
item_tls_version_deprecated = yellow
item_tls_version_insecure = red
item_tls_version_ok = green
message_account = cyan
message_chghost = brown
message_join = green
message_kick = red
message_quit = red
mirc_remap = "1,-1:darkgray"
nick_prefixes = "q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;v:yellow;*:lightblue"
notice = green
reason_kick = default
reason_quit = default
topic_current = default
topic_new = white
topic_old = default
@ -109,7 +89,6 @@ lag_reconnect = 0
lag_refresh_interval = 1
notify_check_ison = 1
notify_check_whois = 5
sasl_fail_unavailable = on
send_unknown_commands = off
whois_double_nick = off
@ -131,47 +110,37 @@ autorejoin = off
autorejoin_delay = 30
away_check = 0
away_check_max_nicks = 25
capabilities = "*"
charset_message = message
capabilities = ""
command = ""
command_delay = 0
connection_timeout = 60
default_chantypes = "#&"
default_msg_kick = ""
default_msg_part = "WeeChat %v"
default_msg_quit = "WeeChat %v"
ipv6 = on
local_hostname = ""
msg_kick = ""
msg_part = "WeeChat ${info:version}"
msg_quit = "WeeChat ${info:version}"
nicks = "${env:USER},${env:USER}1"
nicks_alternate = on
notify = ""
password = ""
proxy = ""
realname = ""
sasl_fail = reconnect
sasl_key = ""
sasl_mechanism = plain
sasl_password = ""
sasl_timeout = 15
sasl_username = ""
split_msg_max_length = 512
ssl = off
ssl_cert = ""
ssl_dhkey_size = 2048
ssl_fingerprint = ""
ssl_password = ""
ssl_priorities = "NORMAL"
ssl_verify = on
usermode = ""
username = "${env:USER}"
[server]
tilde.addresses = "team.tilde.chat/6697"
tilde.addresses = "localhost"
tilde.proxy
tilde.ipv6
tilde.ssl = on
tilde.ssl
tilde.ssl_cert
tilde.ssl_password
tilde.ssl_priorities
tilde.ssl_dhkey_size
tilde.ssl_fingerprint
@ -181,18 +150,14 @@ tilde.capabilities
tilde.sasl_mechanism
tilde.sasl_username
tilde.sasl_password
tilde.sasl_key
tilde.sasl_timeout
tilde.sasl_fail
tilde.autoconnect = on
tilde.autoreconnect
tilde.autoreconnect_delay
tilde.nicks
tilde.nicks_alternate
tilde.username
tilde.realname
tilde.local_hostname
tilde.usermode
tilde.command
tilde.command_delay
tilde.autojoin = "#meta,#team"
@ -203,10 +168,7 @@ tilde.anti_flood_prio_high
tilde.anti_flood_prio_low
tilde.away_check
tilde.away_check_max_nicks
tilde.msg_kick
tilde.msg_part
tilde.msg_quit
tilde.default_msg_kick
tilde.default_msg_part
tilde.default_msg_quit
tilde.notify
tilde.split_msg_max_length
tilde.charset_message
tilde.default_chantypes

View File

@ -1,12 +1,5 @@
#
# weechat -- iset.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# iset.conf -- weechat v1.0.1
#
[color]

View File

@ -1,27 +1,17 @@
#
# weechat -- logger.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# logger.conf -- weechat v1.0.1
#
[look]
backlog = 20
backlog_conditions = ""
[color]
backlog_end = default
backlog_line = default
[file]
auto_log = on
color_lines = off
auto_log = off
flush_delay = 120
fsync = off
info_lines = off
mask = "$plugin.$name.weechatlog"
name_lower_case = on

View File

@ -1,14 +0,0 @@
#
# weechat -- lua.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[look]
check_license = off
eval_keep_context = on

View File

@ -1,14 +0,0 @@
#
# weechat -- perl.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[look]
check_license = off
eval_keep_context = on

View File

@ -1,5 +1,6 @@
#
# highmon.pl - Highlight Monitoring for weechat 0.3.0
# Version 2.5
#
# Add 'Highlight Monitor' buffer/bar to log all highlights in one spot
#
@ -72,10 +73,6 @@
# Bugs and feature requests at: https://github.com/KenjiE20/highmon
# History:
# 2020-06-21, Sebastien Helleu <flashcode@flashtux.org>:
# v2.7: make call to bar_new compatible with WeeChat >= 2.9
# 2019-05-13, HubbeKing <hubbe128@gmail.com>
# v2.6: -add: send "logger_backlog" signal on buffer open if logging is enabled
# 2014-08-16, KenjiE20 <longbow@longbowslair.co.uk>:
# v2.5: -add: clearbar command to clear bar output
# -add: firstrun output prompt to check the help text for set up hints as they were being missed
@ -267,14 +264,7 @@ sub highmon_bar_open
# Make the bar item
weechat::bar_item_new("highmon", "highmon_bar_build", "");
if (weechat::info_get("version_number", "") >= 0x02090000)
{
$highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "default", "on", "highmon");
}
else
{
$highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "on", "highmon");
}
$highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "on", "highmon");
return weechat::WEECHAT_RC_OK;
}
@ -316,7 +306,7 @@ sub highmon_buffer_open
# Turn off notify, highlights
if ($highmon_buffer ne "")
{
if (weechat::config_get_plugin("hotlist_show") eq "off")
if (weechat::config_get_plugin("hotlist_show" eq "off"))
{
weechat::buffer_set($highmon_buffer, "notify", "0");
}
@ -327,11 +317,6 @@ sub highmon_buffer_open
{
weechat::buffer_set($highmon_buffer, "localvar_set_no_log", "1");
}
# send "logger_backlog" signal if logging is enabled to display backlog
if (weechat::config_get_plugin("logging") eq "on")
{
weechat::hook_signal_send("logger_backlog", weechat::WEECHAT_HOOK_SIGNAL_POINTER, $highmon_buffer)
}
}
return weechat::WEECHAT_RC_OK;
}
@ -725,7 +710,7 @@ sub highmon_new_message
if ($cb_high == "1" || (weechat::config_get_plugin("merge_private") eq "on" && $cb_tags =~ /notify_private/))
{
# Pre bug #29618 (0.3.3) away detect
if (weechat::info_get("version_number", "") <= 0x00030200)
if (weechat::info_get("version_number", "") <= 197120)
{
$away = '';
# Get infolist for this server
@ -1139,7 +1124,7 @@ sub format_buffer_name
}
# Check result of register, and attempt to behave in a sane manner
if (!weechat::register("highmon", "KenjiE20", "2.7", "GPL3", "Highlight Monitor", "", ""))
if (!weechat::register("highmon", "KenjiE20", "2.5", "GPL3", "Highlight Monitor", "", ""))
{
# Double load
weechat::print ("", "\tHighmon is already loaded");

View File

@ -1,12 +1,5 @@
#
# weechat -- plugins.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# plugins.conf -- weechat v1.0.1
#
[var]

View File

@ -1,14 +0,0 @@
#
# weechat -- python.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[look]
check_license = off
eval_keep_context = on

View File

@ -0,0 +1,351 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Chris Johnson <raugturi@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# apply_corrections
#
# A weechat plugin to re-print a user's messages with corrections applied when
# they send a correction string (ex: s/typo/replacement).
#
# The following options are availalble:
#
# check_every: Interval, in seconds, between each check for expired messages.
# If set to 0 no check will be performed and all messages will be
# saved indefinitely.
#
# data_timeout: Time, in seconds, before a message is expired. If set to 0
# messages will never expire.
#
# message_limit: Number of messages to store per nick. If set to 0 all messages
# will be saved until they expire.
#
# print_format: Format string for the printed corrections.
# Default: "[nick]: [corrected]"
#
# Variables allowed:
#
# [nick]: The nick of the person who sent the messages.
# [corrected]: The corrected text of the previous message(s).
# [correction]: The correction (format: s/typo/replacement).
# [original]: The original message before correction.
# [pattern]: The "typo" portion of the correction.
# [replacement]: The "replacement" portion of the correction.
# [timestamp]: The timestamp of the original message.
#
# print_limit: Maximum number of lines to correct and print to the buffer. If
# set to 0 all lines that match the pattern will be printed.
#
# Note: Setting check_every, data_timeout, message_limit, or some combination
# thereof to 0's will eat a lot of memory very quickly as it will drastically
# increase the size of the dictionary holding previous messages. Likewise,
# setting print_limit to 0 with a large number of saved messages will quickly
# fill your screen with a bunch of stuff should someone submit a generic
# enough correction string.
# History:
#
# 2014-05-10, Sébastien Helleu <flashcode@flashtux.org>
# version 1.2: change hook_print callback argument type of
# displayed/highlight (WeeChat >= 1.0)
# 2012-10-09, Chris Johnson <raugturi@gmail.com>:
# version 1.1: change some more variable names for clarity/consistency
# 2012-10-08, Chris Johnson <raugturi@gmail.com>:
# version 1.0: fix get_corrected_messages so that the most recent messages
# are corrected and returned
# 2012-10-08, Chris Johnson <raugturi@gmail.com>:
# version 0.9: use defaultdict to handle missing keys, flatten dict by
# using (buffer, nick) tuple as key, simplify message logging
# logic, rename some stuff for clarity.
# 2012-10-08, Chris Johnson <raugturi@gmail.com>:
# version 0.8: remove empty buffers and nicks during clean-up
# 2012-09-05, Chris Johnson <raugturi@gmail.com>:
# version 0.7: fix bug when restoring defaults for options that require
# integer values
# 2012-09-05, Chris Johnson <raugturi@gmail.com>:
# version 0.6: copy info from README into script and shorten the variable
# descriptions
# 2012-09-01, Chris Johnson <raugturi@gmail.com>:
# version 0.5: don't log the reprinted messages
# 2012-08-31, Chris Johnson <raugturi@gmail.com>:
# version 0.4: use same timestamp as buffer when reprinting, instead
# of epoch
# 2012-08-31, Chris Johnson <raugturi@gmail.com>:
# version 0.3: switch to [var] style variables for print format
# 2012-08-30, Chris Johnson <raugturi@gmail.com>:
# version 0.2: fixed search for typos so if regex fails it falls back
# to string.find
# 2012-08-30, Chris Johnson <raugturi@gmail.com>:
# version 0.1: initial release
import_ok = True
try:
import weechat
except ImportError:
print('This script must be run under WeeChat.')
print('Get WeeChat now at: http://www.weechat.org/')
import_ok = False
try:
import re
import time
from operator import itemgetter
from collections import defaultdict
except ImportError as message:
print('Missing package(s) for %s: %s' % (SCRIPT_NAME, message))
import_ok = False
SCRIPT_NAME = 'apply_corrections'
SCRIPT_AUTHOR = 'Chris Johnson <raugturi@gmail.com>'
SCRIPT_VERSION = '1.2'
SCRIPT_LICENSE = 'GPL3'
SCRIPT_DESC = "When a correction (ex: s/typo/replacement) is sent, print the "\
"user's previous message(s) with the corrected text instead."
# Default settings for the plugin.
settings = {'check_every': '5',
'data_timeout': '60',
'message_limit': '2',
'print_format': '[nick]: [corrected]',
'print_limit': '1'}
# Initialize the dictionary to store most recent messages per buffer per nick.
LASTWORDS = defaultdict(list)
def apply_correction(message, pattern, replacement):
"""
Replaces all occurences of pattern in message with replacment. It tries to
treat the pattern and replacement as regular expressions, but falls back to
string replace if that fails.
"""
try:
message = re.compile(pattern).sub(replacement, message)
except:
message = message.replace(pattern, replacement)
return message
def get_corrected_messages(nick, log, correction):
"""
Return list of messages that match the pattern, with corrections applied.
Limited to print_limit items, sorted by timestamp ascending.
"""
print_limit = get_option_int('print_limit')
corrected_messages = []
pattern, replacement = correction.split('/')[1:3]
for message in log:
if print_limit and len(corrected_messages) >= print_limit:
break
original = message.get('message', '')
if original:
try:
match = re.match(re.compile('.*%s.*' % pattern), original)
except:
match = original.find(pattern) != -1
finally:
if match:
corrected = apply_correction(original,
pattern,
replacement)
timeformat = weechat.config_string(
weechat.config_get('weechat.look.buffer_time_format'))
timestamp = time.strftime(
timeformat,
time.localtime(float(message['timestamp'])))
corrected_messages.append({'nick': nick,
'corrected': corrected,
'correction': correction,
'original': original,
'pattern': pattern,
'replacement': replacement,
'timestamp': timestamp})
return sorted(corrected_messages, key=itemgetter('timestamp'))
def get_option_int(option):
"""
Checks to see if a configuration option is an integer and sets it back to
the default if it isn't. Returns the value when done.
"""
try:
value = int(weechat.config_get_plugin(option))
except ValueError:
weechat.config_set_plugin(option, settings[option])
value = int(weechat.config_get_plugin(option))
return value
def get_valid_messages(log, expiry):
"""
Return only the messages that haven't expired.
"""
valid = []
for message in log:
try:
timestamp = int(message.get('timestamp', 0))
if timestamp > expiry:
valid.append(message)
except ValueError:
continue
return valid
def clear_messages_cb(data, remaining_calls):
"""
Callback that clears old messages from the LASTWORDS dictionary. The time
limit is the number of seconds specified in plugin's data_timeout setting.
If data_timeout is set to 0 then no messages are cleared.
"""
data_timeout = get_option_int('data_timeout')
if data_timeout:
expiry = time.time() - data_timeout
for buff, nick in LASTWORDS.keys():
valid_messages = get_valid_messages(LASTWORDS[(buff,nick)], expiry)
if valid_messages:
LASTWORDS[(buff, nick)] = valid_messages
else:
del LASTWORDS[(buff,nick)]
return weechat.WEECHAT_RC_OK
def handle_message_cb(data, buffer, date, tags, disp, hl, nick, message):
"""
Callback that handles new messages. If the message is in the format of a
regex find/replace (ex. 's/typo/replacement/', 'nick: s/typo/replacement')
then the last print_limit messages for that nick are re-printed to the
current buffer in their oringal order with the change applied. Otherwise
the message is stored in LASTWORDS dictionary for this buffer > nick.
"""
# Don't do anything if the message isn't suppose to be displayed.
if int(disp):
buffer_name = weechat.buffer_get_string(buffer, 'name')
log = LASTWORDS[(buffer_name, nick)]
# Matches on both 's/typo/replacement' and 'nick: s/typo/replacement',
# mainly because of bitlbee since it puts your nick in front of
# incoming messages.
#
# Nick regex nicked from colorize_nicks available here:
# http://www.weechat.org/scripts/source/stable/colorize_nicks.py.html/
valid_nick = r'([@~&!%+])?([-a-zA-Z0-9\[\]\\`_^\{|\}]+)'
valid_correction = r's/[^/]*/[^/]*'
correction_message_pattern = re.compile(
r'(%s:\s*)?(%s)(/)?$' % (valid_nick, valid_correction))
match = re.match(correction_message_pattern, message)
if match:
# If message is a correction and we have previous messages from
# this nick, print up to print_limit of the nick's previous
# messages with corrections applied, in their original order.
correction = match.group(4)
if log and correction:
print_format = weechat.config_get_plugin('print_format')
for cm in get_corrected_messages(nick, log, correction):
corrected_msg = print_format
for k, v in cm.iteritems():
corrected_msg = corrected_msg.replace('[%s]' % k, v)
weechat.prnt_date_tags(buffer, 0, 'no_log', corrected_msg)
else:
# If it's not a correction, store the message in LASTWORDS.
log.insert(0, {'message': message, 'timestamp': date})
# If there's a per-nick limit, shorten the list to match.
message_limit = get_option_int('message_limit')
while message_limit and len(log) > message_limit:
log.pop()
return weechat.WEECHAT_RC_OK
def load_config(data=None, option=None, value=None):
"""
Load configuration options and (re)register hook_timer to clear old
messages based on the current value of check_every. If check_every is 0
then messages are never cleared.
"""
# On initial load set any unset options to the defaults.
if not option:
for option, default in settings.iteritems():
if not weechat.config_is_set_plugin(option):
weechat.config_set_plugin(option, default)
if not option or option.endswith('check_every'):
# If hook_timer for clearing old messages is set already, clear it.
old_hook = globals().get('CLEAR_HOOK', None)
if old_hook is not None:
weechat.unhook(old_hook)
# Register hook_timer to clear old messages.
check_every = get_option_int('check_every') * 1000
if check_every:
globals()['CLEAR_HOOK'] = weechat.hook_timer(
check_every, 0, 0, 'clear_messages_cb', '')
return weechat.WEECHAT_RC_OK
def desc_options():
"""
Load descriptions for all the options.
"""
weechat.config_set_desc_plugin(
'check_every', 'Interval between each check for expired messages.')
weechat.config_set_desc_plugin(
'data_timeout', 'Time before a message is expired.')
weechat.config_set_desc_plugin(
'message_limit', 'Number of messages to store per nick.')
weechat.config_set_desc_plugin(
'print_format', 'Format string for the printed corrections.')
weechat.config_set_desc_plugin(
'print_limit', 'Maximum number of lines to correct.')
return weechat.WEECHAT_RC_OK
if __name__ == '__main__' and import_ok:
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
SCRIPT_LICENSE, SCRIPT_DESC, '', ''):
# Load the configuration options.
load_config()
# Set up the descriptions for each option.
desc_options()
# Register hook to run load_config when options are changed.
weechat.hook_config('plugins.var.python.%s.*' % SCRIPT_NAME,
'load_config', '')
# Register hook_print to process each new message as it comes in.
weechat.hook_print('', '', '', 1, 'handle_message_cb', '')

View File

@ -43,15 +43,6 @@
# 2014-05-22, Nathaniel Wesley Filardo <PADEBR2M2JIQN02N9OO5JM0CTN8K689P@cmx.ietfng.org>
# version 0.2.5: Fix keyed channel support
#
# 2016-01-13, The fox in the shell <KellerFuchs@hashbang.sh>
# version 0.2.6: Support keeping chan list as secured data
#
# 2018-08-09, Julien Palard <julien@palard.fr>
# version 0.3.0: Support for Python 3
#
# 2019-09-28, fructose
# version 0.3.1: Error on invalid arguments
#
# @TODO: add options to ignore certain buffers
# @TODO: maybe add an option to enable autosaving on part/join messages
@ -60,7 +51,7 @@ import re
SCRIPT_NAME = "autojoin"
SCRIPT_AUTHOR = "xt <xt@bash.no>"
SCRIPT_VERSION = "0.3.1"
SCRIPT_VERSION = "0.2.5"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Configure autojoin for all servers according to currently joined channels"
SCRIPT_COMMAND = "autojoin"
@ -80,8 +71,8 @@ if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT
"autojoin_cb",
"")
# w.hook_signal('*,irc_in2_join', 'autosave_channels_on_activity', '')
# w.hook_signal('*,irc_in2_part', 'autosave_channels_on_activity', '')
#w.hook_signal('*,irc_in2_join', 'autosave_channels_on_activity', '')
#w.hook_signal('*,irc_in2_part', 'autosave_channels_on_activity', '')
w.hook_signal('quit', 'autosave_channels_on_quit', '')
# Init everything
@ -89,7 +80,6 @@ for option, default_value in settings.items():
if w.config_get_plugin(option) == "":
w.config_set_plugin(option, default_value)
def autosave_channels_on_quit(signal, callback, callback_data):
''' Autojoin current channels '''
if w.config_get_plugin(option) != "on":
@ -98,8 +88,10 @@ def autosave_channels_on_quit(signal, callback, callback_data):
items = find_channels()
# print/execute commands
for server, channels in items.items():
process_server(server, channels)
for server, channels in items.iteritems():
channels = channels.rstrip(',')
command = "/set irc.server.%s.autojoin '%s'" % (server, channels)
w.command('', command)
return w.WEECHAT_RC_OK
@ -112,66 +104,44 @@ def autosave_channels_on_activity(signal, callback, callback_data):
items = find_channels()
# print/execute commands
for server, channels in items.items():
for server, channels in items.iteritems():
nick = w.info_get('irc_nick', server)
pattern = "^:%s!.*(JOIN|PART) :?(#[^ ]*)( :.*$)?" % nick
match = re.match(pattern, callback_data)
if match: # check if nick is my nick. In that case: save
process_server(server, channels)
else: # someone else: ignore
if match: # check if nick is my nick. In that case: save
channel = match.group(2)
channels = channels.rstrip(',')
command = "/set irc.server.%s.autojoin '%s'" % (server, channels)
w.command('', command)
else: # someone else: ignore
continue
return w.WEECHAT_RC_OK
def autojoin_cb(data, buffer, args):
if args == '--run':
run = True
elif args != '':
w.prnt('', 'Unexpected argument: %s' % args)
return w.WEECHAT_RC_ERROR
else:
run = False
# Old behaviour: doesn't save empty channel list
# In fact should also save open buffers with a /part'ed channel
# But I can't believe somebody would want that behaviour
"""Old behaviour: doesn't save empty channel list"""
"""In fact should also save open buffers with a /part'ed channel"""
"""But I can't believe somebody would want that behaviour"""
items = find_channels()
# print/execute commands
for server, channels in items.items():
process_server(server, channels, run)
for server, channels in items.iteritems():
channels = channels.rstrip(',')
if not channels: # empty channel list
continue
command = '/set irc.server.%s.autojoin %s' % (server, channels)
if args == '--run':
w.command('', command)
else:
w.prnt('', command)
return w.WEECHAT_RC_OK
def process_server(server, channels, run=True):
option = "irc.server.%s.autojoin" % server
channels = channels.rstrip(',')
oldchans = w.config_string(w.config_get(option))
if not channels: # empty channel list
return
# Note: re already caches the result of regexp compilation
sec = re.match('^\${sec\.data\.(.*)}$', oldchans)
if sec:
secvar = sec.group(1)
command = "/secure set %s %s" % (secvar, channels)
else:
command = "/set irc.server.%s.autojoin '%s'" % (server, channels)
if run:
w.command('', command)
else:
w.prnt('', command)
def find_channels():
"""Return list of servers and channels"""
# TODO: make it return a dict with more options like "nicks_count etc."
#@TODO: make it return a dict with more options like "nicks_count etc."
items = {}
infolist = w.infolist_get('irc_server', '', '')
# populate servers
@ -185,18 +155,18 @@ def find_channels():
keys = []
keyed_channels = []
unkeyed_channels = []
items[server] = '' # init if connected but no channels
items[server] = '' #init if connected but no channels
infolist = w.infolist_get('irc_channel', '', server)
while w.infolist_next(infolist):
if w.infolist_integer(infolist, 'nicks_count') == 0:
# parted but still open in a buffer: bit hackish
#parted but still open in a buffer: bit hackish
continue
if w.infolist_integer(infolist, 'type') == 0:
key = w.infolist_string(infolist, "key")
if len(key) > 0:
keys.append(key)
keyed_channels.append(w.infolist_string(infolist, "name"))
else:
else :
unkeyed_channels.append(w.infolist_string(infolist, "name"))
items[server] = ','.join(keyed_channels + unkeyed_channels)
if len(keys) > 0:
@ -204,3 +174,4 @@ def find_channels():
w.infolist_free(infolist)
return items

View File

@ -0,0 +1 @@
../apply_corrections.py

View File

@ -0,0 +1 @@
../screen_away.py

View File

@ -53,9 +53,6 @@
# It can be used for force or disable background process, using '0' forces to always grep in
# background, while using '' (empty string) will disable it.
#
# * plugins.var.python.grep.timeout_secs:
# Timeout (in seconds) for background grepping.
#
# * plugins.var.python.grep.default_tail_head:
# Config option for define default number of lines returned when using --head or --tail options.
# Can be overriden in the command with --number option.
@ -69,37 +66,6 @@
#
# History:
#
# 2021-05-02, Sébastien Helleu <flashcode@flashtux.org>
# version 0.8.5: add compatibility with WeeChat >= 3.2 (XDG directories)
#
# 2020-10-11, Thom Wiggers <thom@thomwiggers.nl>
# version 0.8.4: Python3 compatibility fix
#
# 2020-05-06, Dominique Martinet <asmadeus@codewreck.org> and hexa-
# version 0.8.3: more python3 compatibility fixes...
#
# 2019-06-30, dabbill <dabbill@gmail.com>
# and Sébastien Helleu <flashcode@flashtux.org>
# version 0.8.2: make script compatible with Python 3
#
# 2018-04-10, Sébastien Helleu <flashcode@flashtux.org>
# version 0.8.1: fix infolist_time for WeeChat >= 2.2 (WeeChat returns a long
# integer instead of a string)
#
# 2017-09-20, mickael9
# version 0.8:
# * use weechat 1.5+ api for background processing (old method was unsafe and buggy)
# * add timeout_secs setting (was previously hardcoded to 5 mins)
#
# 2017-07-23, Sébastien Helleu <flashcode@flashtux.org>
# version 0.7.8: fix modulo by zero when nick is empty string
#
# 2016-06-23, mickael9
# version 0.7.7: fix get_home function
#
# 2015-11-26
# version 0.7.6: fix a typo
#
# 2015-01-31, Nicd-
# version 0.7.5:
# '~' is now expaned to the home directory in the log file path so
@ -130,9 +96,9 @@
# * supress highlights when printing in grep buffer
#
# 2010-10-06
# version 0.6.7: by xt <xt@bash.no>
# version 0.6.7: by xt <xt@bash.no>
# * better temporary file:
# use tempfile.mkstemp. to create a temp file in log dir,
# use tempfile.mkstemp. to create a temp file in log dir,
# makes it safer with regards to write permission and multi user
#
# 2010-04-08
@ -223,12 +189,7 @@
###
from os import path
import sys, getopt, time, os, re
try:
import cPickle as pickle
except ImportError:
import pickle
import sys, getopt, time, os, re, tempfile
try:
import weechat
@ -239,21 +200,20 @@ except ImportError:
SCRIPT_NAME = "grep"
SCRIPT_AUTHOR = "Elián Hanisch <lambdae2@gmail.com>"
SCRIPT_VERSION = "0.8.5"
SCRIPT_VERSION = "0.7.5"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Search in buffers and logs"
SCRIPT_COMMAND = "grep"
### Default Settings ###
settings = {
'clear_buffer' : 'off',
'log_filter' : '',
'go_to_buffer' : 'on',
'max_lines' : '4000',
'show_summary' : 'on',
'size_limit' : '2048',
'default_tail_head' : '10',
'timeout_secs' : '300',
'clear_buffer' : 'off',
'log_filter' : '',
'go_to_buffer' : 'on',
'max_lines' : '4000',
'show_summary' : 'on',
'size_limit' : '2048',
'default_tail_head' : '10',
}
### Class definitions ###
@ -272,14 +232,14 @@ class linesDict(dict):
def get_matches_count(self):
"""Return the sum of total matches stored."""
if dict.__len__(self):
return sum(map(lambda L: L.matches_count, self.values()))
return sum(map(lambda L: L.matches_count, self.itervalues()))
else:
return 0
def __len__(self):
"""Return the sum of total lines stored."""
if dict.__len__(self):
return sum(map(len, self.values()))
return sum(map(len, self.itervalues()))
else:
return 0
@ -287,7 +247,7 @@ class linesDict(dict):
"""Returns buffer count or buffer name if there's just one stored."""
n = len(self.keys())
if n == 1:
return list(self.keys())[0]
return self.keys()[0]
elif n > 1:
return '%s logs' %n
else:
@ -295,18 +255,18 @@ class linesDict(dict):
def items(self):
"""Returns a list of items sorted by line count."""
items = list(dict.items(self))
items = dict.items(self)
items.sort(key=lambda i: len(i[1]))
return items
def items_count(self):
"""Returns a list of items sorted by match count."""
items = list(dict.items(self))
items = dict.items(self)
items.sort(key=lambda i: i[1].matches_count)
return items
def strip_separator(self):
for L in self.values():
for L in self.itervalues():
L.strip_separator()
def get_last_lines(self, n):
@ -315,7 +275,7 @@ class linesDict(dict):
if n >= total_lines:
# nothing to do
return
for k, v in reversed(list(self.items())):
for k, v in reversed(self.items()):
l = len(v)
if n > 0:
if l > n:
@ -412,15 +372,13 @@ def color_nick(nick):
else:
mode = mode_color = ''
# nick color
nick_color = ''
if nick:
nick_color = weechat.info_get('irc_nick_color', nick)
if not nick_color:
# probably we're in WeeChat 0.3.0
#debug('no irc_nick_color')
color_nicks_number = config_int('weechat.look.color_nicks_number')
idx = (sum(map(ord, nick))%color_nicks_number) + 1
nick_color = wcolor(config_string('weechat.color.chat_nick_color%02d' %idx))
nick_color = weechat.info_get('irc_nick_color', nick)
if not nick_color:
# probably we're in WeeChat 0.3.0
#debug('no irc_nick_color')
color_nicks_number = config_int('weechat.look.color_nicks_number')
idx = (sum(map(ord, nick))%color_nicks_number) + 1
nick_color = wcolor(config_string('weechat.color.chat_nick_color%02d' %idx))
return ''.join((prefix_c, prefix, mode_color, mode, nick_color, nick, suffix_c, suffix))
### Config and value validation ###
@ -455,14 +413,9 @@ def get_config_log_filter():
return []
def get_home():
options = {
'directory': 'data',
}
home = weechat.string_eval_path_home(
weechat.config_string(weechat.config_get('logger.file.path')),
{}, {}, options,
)
return home
home = weechat.config_string(weechat.config_get('logger.file.path'))
home = path.abspath(path.expanduser(home))
return home.replace('%h', weechat.info_get('weechat_dir', ''))
def strip_home(s, dir=''):
"""Strips home dir from the begging of the log path, this makes them sorter."""
@ -504,7 +457,7 @@ def dir_list(dir, filter_list=(), filter_excludes=True, include_dir=False):
return cache_dir[key]
except KeyError:
pass
filter_list = filter_list or get_config_log_filter()
dir_len = len(dir)
if filter_list:
@ -609,10 +562,7 @@ def get_file_by_name(buffer_name):
if '$server' in mask:
mask = mask.replace('$server', server)
# change the unreplaced vars by '*'
try:
from string import letters
except ImportError:
from string import ascii_letters as letters
from string import letters
if '%' in mask:
# vars for time formatting
mask = mask.replace('%', '$')
@ -677,8 +627,8 @@ def make_regexp(pattern, matchcase=False):
regexp = re.compile(pattern, re.IGNORECASE)
else:
regexp = re.compile(pattern)
except Exception as e:
raise Exception('Bad pattern, %s' % e)
except Exception, e:
raise Exception, 'Bad pattern, %s' %e
return regexp
def check_string(s, regexp, hilight='', exact=False):
@ -736,7 +686,7 @@ def grep_file(file, head, tail, after_context, before_context, count, regexp, hi
return s
else:
check = lambda s: check_string(s, regexp, hilight, exact)
try:
file_object = open(file, 'r')
except IOError:
@ -756,7 +706,7 @@ def grep_file(file, head, tail, after_context, before_context, count, regexp, hi
before_context, after_context = after_context, before_context
if before_context:
before_context_range = list(range(1, before_context + 1))
before_context_range = range(1, before_context + 1)
before_context_range.reverse()
limit = tail or head
@ -820,7 +770,7 @@ def grep_file(file, head, tail, after_context, before_context, count, regexp, hi
while id < after_context + offset:
id += 1
try:
context_line = next(file_object)
context_line = file_object.next()
_context_line = check(context_line)
if _context_line:
offset = id
@ -868,10 +818,6 @@ def grep_buffer(buffer, head, tail, after_context, before_context, count, regexp
prefix = string_remove_color(infolist_string(infolist, 'prefix'), '')
message = string_remove_color(infolist_string(infolist, 'message'), '')
date = infolist_time(infolist, 'date')
# since WeeChat 2.2, infolist_time returns a long integer
# instead of a string
if not isinstance(date, str):
date = time.strftime('%F %T', time.localtime(int(date)))
return '%s\t%s\t%s' %(date, prefix, message)
return function
get_line = make_get_line_funcion()
@ -901,7 +847,8 @@ def grep_buffer(buffer, head, tail, after_context, before_context, count, regexp
check = lambda s: check_string(s, regexp, hilight, exact)
if before_context:
before_context_range = reversed(range(1, before_context + 1))
before_context_range = range(1, before_context + 1)
before_context_range.reverse()
while infolist_next(infolist):
line = get_line(infolist)
@ -984,88 +931,104 @@ def show_matching_lines():
elif size_limit == '':
background = False
regexp = make_regexp(pattern, matchcase)
global grep_options, log_pairs
grep_options = (head, tail, after_context, before_context,
count, regexp, hilight, exact, invert)
log_pairs = [(strip_home(log), log) for log in search_in_files]
if not background:
# run grep normally
for log_name, log in log_pairs:
matched_lines[log_name] = grep_file(log, *grep_options)
regexp = make_regexp(pattern, matchcase)
for log in search_in_files:
log_name = strip_home(log)
matched_lines[log_name] = grep_file(log, head, tail, after_context, before_context,
count, regexp, hilight, exact, invert)
buffer_update()
else:
global hook_file_grep, grep_stdout, grep_stderr, pattern_tmpl
grep_stdout = grep_stderr = b''
hook_file_grep = weechat.hook_process(
'func:grep_process',
get_config_int('timeout_secs') * 1000,
'grep_process_cb',
''
)
# we hook a process so grepping runs in background.
#debug('on background')
global hook_file_grep, script_path, bytecode
timeout = 1000*60*5 # 5 min
quotify = lambda s: '"%s"' %s
files_string = ', '.join(map(quotify, search_in_files))
global tmpFile
# we keep the file descriptor as a global var so it isn't deleted until next grep
tmpFile = tempfile.NamedTemporaryFile(prefix=SCRIPT_NAME,
dir=weechat.info_get('weechat_dir', ''))
cmd = grep_process_cmd %dict(logs=files_string, head=head, pattern=pattern, tail=tail,
hilight=hilight, after_context=after_context, before_context=before_context,
exact=exact, matchcase=matchcase, home_dir=home_dir, script_path=script_path,
count=count, invert=invert, bytecode=bytecode, filename=tmpFile.name,
python=weechat.info_get('python2_bin', '') or 'python')
#debug(cmd)
hook_file_grep = weechat.hook_process(cmd, timeout, 'grep_file_callback', tmpFile.name)
global pattern_tmpl
if hook_file_grep:
buffer_create("Searching for '%s' in %s worth of data..." % (
pattern_tmpl,
human_readable_size(size)
))
buffer_create("Searching for '%s' in %s worth of data..." %(pattern_tmpl,
human_readable_size(size)))
else:
buffer_update()
# defined here for commodity
grep_process_cmd = """%(python)s -%(bytecode)sc '
import sys, cPickle, os
sys.path.append("%(script_path)s") # add WeeChat script dir so we can import grep
from grep import make_regexp, grep_file, strip_home
logs = (%(logs)s, )
try:
regexp = make_regexp("%(pattern)s", %(matchcase)s)
d = {}
for log in logs:
log_name = strip_home(log, "%(home_dir)s")
lines = grep_file(log, %(head)s, %(tail)s, %(after_context)s, %(before_context)s,
%(count)s, regexp, "%(hilight)s", %(exact)s, %(invert)s)
d[log_name] = lines
fd = open("%(filename)s", "wb")
cPickle.dump(d, fd, -1)
fd.close()
except Exception, e:
print >> sys.stderr, e'
"""
def grep_process(*args):
result = {}
try:
global grep_options, log_pairs
for log_name, log in log_pairs:
result[log_name] = grep_file(log, *grep_options)
except Exception as e:
result = e
return pickle.dumps(result, 0)
def grep_process_cb(data, command, return_code, out, err):
global grep_stdout, grep_stderr, matched_lines, hook_file_grep
if isinstance(out, str):
out = out.encode()
grep_stdout += out
if isinstance(err, str):
err = err.encode()
grep_stderr += err
def set_buffer_error(message):
error(message)
grep_buffer = buffer_create()
title = weechat.buffer_get_string(grep_buffer, 'title')
title = title + ' %serror' % color_title
weechat.buffer_set(grep_buffer, 'title', title)
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
set_buffer_error("Background grep timed out")
hook_file_grep = None
return WEECHAT_RC_OK
elif return_code >= 0:
hook_file_grep = None
if grep_stderr:
set_buffer_error(grep_stderr)
return WEECHAT_RC_OK
grep_stdout = grep_stderr = ''
def grep_file_callback(filename, command, rc, stdout, stderr):
global hook_file_grep, grep_stderr, grep_stdout
global matched_lines
#debug("rc: %s\nstderr: %s\nstdout: %s" %(rc, repr(stderr), repr(stdout)))
if stdout:
grep_stdout += stdout
if stderr:
grep_stderr += stderr
if int(rc) >= 0:
def set_buffer_error():
grep_buffer = buffer_create()
title = weechat.buffer_get_string(grep_buffer, 'title')
title = title + ' %serror' %color_title
weechat.buffer_set(grep_buffer, 'title', title)
try:
data = pickle.loads(grep_stdout)
if isinstance(data, Exception):
raise data
matched_lines.update(data)
except Exception as e:
set_buffer_error(repr(e))
return WEECHAT_RC_OK
else:
buffer_update()
if grep_stderr:
error(grep_stderr)
set_buffer_error()
#elif grep_stdout:
#debug(grep_stdout)
elif path.exists(filename):
import cPickle
try:
#debug(file)
fd = open(filename, 'rb')
d = cPickle.load(fd)
matched_lines.update(d)
fd.close()
except Exception, e:
error(e)
set_buffer_error()
else:
buffer_update()
global tmpFile
tmpFile = None
finally:
grep_stdout = grep_stderr = ''
hook_file_grep = None
return WEECHAT_RC_OK
def get_grep_file_status():
@ -1202,7 +1165,7 @@ def buffer_update():
# free matched_lines so it can be removed from memory
del matched_lines
def split_line(s):
"""Splits log's line 's' in 3 parts, date, nick and msg."""
global weechat_format
@ -1302,12 +1265,12 @@ def buffer_input(data, buffer, input_data):
weechat.infolist_free(infolist)
try:
cmd_grep_parsing(input_data)
except Exception as e:
error('Argument error, %s' % e, buffer=buffer)
except Exception, e:
error('Argument error, %s' %e, buffer=buffer)
return WEECHAT_RC_OK
try:
show_matching_lines()
except Exception as e:
except Exception, e:
error(e)
except NameError:
error("There isn't any previous search to repeat.", buffer=buffer)
@ -1364,11 +1327,11 @@ def cmd_grep_parsing(args):
args = ' '.join(args) # join pattern for keep spaces
if args:
pattern_tmpl = args
pattern_tmpl = args
pattern = _tmplRe.sub(tmplReplacer, args)
debug('Using regexp: %s', pattern)
if not pattern:
raise Exception('No pattern for grep the logs.')
raise Exception, 'No pattern for grep the logs.'
def positive_number(opt, val):
try:
@ -1381,7 +1344,7 @@ def cmd_grep_parsing(args):
opt = '-' + opt
else:
opt = '--' + opt
raise Exception("argument for %s must be a positive integer." % opt)
raise Exception, "argument for %s must be a positive integer." %opt
for opt, val in opts:
opt = opt.strip('-')
@ -1440,18 +1403,18 @@ def cmd_grep_parsing(args):
tail = n
def cmd_grep_stop(buffer, args):
global hook_file_grep, pattern, matched_lines
global hook_file_grep, pattern, matched_lines, tmpFile
if hook_file_grep:
if args == 'stop':
weechat.unhook(hook_file_grep)
hook_file_grep = None
s = 'Search for \'%s\' stopped.' % pattern
s = 'Search for \'%s\' stopped.' %pattern
say(s, buffer)
grep_buffer = weechat.buffer_search('python', SCRIPT_NAME)
if grep_buffer:
weechat.buffer_set(grep_buffer, 'title', s)
matched_lines = {}
del matched_lines
tmpFile = None
else:
say(get_grep_file_status(), buffer)
raise Exception
@ -1476,8 +1439,8 @@ def cmd_grep(data, buffer, args):
# parse
try:
cmd_grep_parsing(args)
except Exception as e:
error('Argument error, %s' % e)
except Exception, e:
error('Argument error, %s' %e)
return WEECHAT_RC_OK
# find logs
@ -1523,7 +1486,7 @@ def cmd_grep(data, buffer, args):
# grepping
try:
show_matching_lines()
except Exception as e:
except Exception, e:
error(e)
return WEECHAT_RC_OK
@ -1542,8 +1505,8 @@ def cmd_logs(data, buffer, args):
opt = opt.strip('-')
if opt in ('size', 's'):
sort_by_size = True
except Exception as e:
error('Argument error, %s' % e)
except Exception, e:
error('Argument error, %s' %e)
return WEECHAT_RC_OK
# is there's a filter, filter_excludes should be False
@ -1566,7 +1529,7 @@ def cmd_logs(data, buffer, args):
buffer = buffer_create()
if get_config_boolean('clear_buffer'):
weechat.buffer_clear(buffer)
file_list = list(zip(file_list, file_sizes))
file_list = zip(file_list, file_sizes)
msg = 'Found %s logs.' %len(file_list)
print_line(msg, buffer, display=True)
@ -1676,7 +1639,7 @@ if __name__ == '__main__' and import_ok and \
If used with 'log <file>' search in all logs that matches <file>.
-b --buffer: Search only in buffers, not in file logs.
-c --count: Just count the number of matched lines instead of showing them.
-m --matchcase: Don't do case insensitive search.
-m --matchcase: Don't do case insensible search.
-H --hilight: Colour exact matches in output buffer.
-o --only-match: Print only the matching part of the line (unique matches).
-v -i --invert: Print lines that don't match the regular expression.
@ -1725,7 +1688,7 @@ Examples:
'completion_grep_args', '')
# settings
for opt, val in settings.items():
for opt, val in settings.iteritems():
if not weechat.config_is_set_plugin(opt):
weechat.config_set_plugin(opt, val)
@ -1738,7 +1701,7 @@ Examples:
color_summary = weechat.color('lightcyan')
color_delimiter = weechat.color('chat_delimiters')
color_script_nick = weechat.color('chat_nick')
# pretty [grep]
script_nick = '%s[%s%s%s]%s' %(color_delimiter, color_script_nick, SCRIPT_NAME, color_delimiter,
color_reset)
@ -1756,11 +1719,8 @@ Examples:
debug = pybuffer.debugBuffer(globals(), '%s_debug' % SCRIPT_NAME)
except:
def debug(s, *args):
try:
if not isinstance(s, basestring):
s = str(s)
except NameError:
pass
if not isinstance(s, basestring):
s = str(s)
if args:
s = s %args
prnt('', '%s\t%s' %(script_nick, s))

2062
.weechat/python/otr.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,197 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009 by xt <xt@bash.no>
# Copyright (c) 2009 by penryu <penryu@gmail.com>
# Copyright (c) 2010 by Blake Winton <bwinton@latte.ca>
# Copyright (c) 2010 by Aron Griffis <agriffis@n01se.net>
# Copyright (c) 2010 by Jani Kesänen <jani.kesanen@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# (this script requires WeeChat 0.3.0 or newer)
#
# History:
# 2014-08-02, Nils Görs <weechatter@arcor.de>
# version 0.14: add time to detach message. (idea by Mikaela)
# 2014-06-19, Anders Bergh <anders1@gmail.com>
# version 0.13: Fix a simple typo in an option description.
# 2014-01-12, Phyks (Lucas Verney) <phyks@phyks.me>
# version 0.12: Added an option to check status of relays to set unaway in
# case of a connected relay.
# 2013-08-30, Anders Einar Hilden <hildenae@gmail.com>
# version: 0.11: Fix reading of set_away
# 2013-06-16, Renato Botelho <rbgarga@gmail.com>
# version 0.10: add option to don't set away, only change nick
# allow multiple commands on attach/dettach
# do not add suffix if nick already have it
# 2012-12-29, David Flatz <david@upcs.at>
# version 0.9: add option to ignore servers and don't set away status for them
# add descriptions to config options
# 2010-08-07, Filip H.F. "FiXato" Slagter <fixato@gmail.com>
# version 0.8: add command on attach feature
# 2010-05-07, Jani Kesänen <jani.kesanen@gmail.com>
# version 0.7: add command on detach feature
# 2010-03-07, Aron Griffis <agriffis@n01se.net>
# version 0.6: move socket check to register,
# add hook_config for interval,
# reduce default interval from 60 to 5
# 2010-02-19, Blake Winton <bwinton@latte.ca>
# version 0.5: add option to change nick when away
# 2010-01-18, xt
# version 0.4: only update servers that are connected
# 2009-11-30, xt <xt@bash.no>
# version 0.3: do not touch servers that are manually set away
# 2009-11-27, xt <xt@bash.no>
# version 0.2: code for TMUX from penryu
# 2009-11-27, xt <xt@bash.no>
# version 0.1: initial release
import weechat as w
import re
import os
import datetime, time
SCRIPT_NAME = "screen_away"
SCRIPT_AUTHOR = "xt <xt@bash.no>"
SCRIPT_VERSION = "0.14"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Set away status on screen detach"
settings = {
'message': ('Detached from screen', 'Away message'),
'time_format': ('since %Y-%m-%d %H:%M:%S%z', 'time format append to away message'),
'interval': ('5', 'How often in seconds to check screen status'),
'away_suffix': ('', 'What to append to your nick when you\'re away.'),
'command_on_attach': ('', 'Commands to execute on attach, separated by semicolon'),
'command_on_detach': ('', 'Commands to execute on detach, separated by semicolon'),
'ignore': ('', 'Comma-separated list of servers to ignore.'),
'set_away': ('on', 'Set user as away.'),
'ignore_relays': ('off', 'Only check screen status and ignore relay interfaces'),
}
TIMER = None
SOCK = None
AWAY = False
CONNECTED_RELAY = False
def set_timer():
'''Update timer hook with new interval'''
global TIMER
if TIMER:
w.unhook(TIMER)
TIMER = w.hook_timer(int(w.config_get_plugin('interval')) * 1000,
0, 0, "screen_away_timer_cb", '')
def screen_away_config_cb(data, option, value):
if option.endswith(".interval"):
set_timer()
return w.WEECHAT_RC_OK
def get_servers():
'''Get the servers that are not away, or were set away by this script'''
ignores = w.config_get_plugin('ignore').split(',')
infolist = w.infolist_get('irc_server','','')
buffers = []
while w.infolist_next(infolist):
if not w.infolist_integer(infolist, 'is_connected') == 1 or \
w.infolist_string(infolist, 'name') in ignores:
continue
if not w.config_string_to_boolean(w.config_get_plugin('set_away')) or \
not w.infolist_integer(infolist, 'is_away') or \
w.config_get_plugin('message') in w.infolist_string(infolist, 'away_message'):
# w.infolist_string(infolist, 'away_message') == \
# w.config_get_plugin('message'):
buffers.append((w.infolist_pointer(infolist, 'buffer'),
w.infolist_string(infolist, 'nick')))
w.infolist_free(infolist)
return buffers
def screen_away_timer_cb(buffer, args):
'''Check if screen is attached, update awayness'''
global AWAY, SOCK, CONNECTED_RELAY
set_away = w.config_string_to_boolean(w.config_get_plugin('set_away'))
check_relays = not w.config_string_to_boolean(w.config_get_plugin('ignore_relays'))
suffix = w.config_get_plugin('away_suffix')
attached = os.access(SOCK, os.X_OK) # X bit indicates attached
# Check wether a client is connected on relay or not
CONNECTED_RELAY = False
if check_relays:
infolist = w.infolist_get('relay', '', '')
if infolist:
while w.infolist_next(infolist):
status = w.infolist_string(infolist, 'status_string')
if status == 'connected':
CONNECTED_RELAY = True
break
w.infolist_free(infolist)
if (attached and AWAY) or (check_relays and CONNECTED_RELAY and not attached and AWAY):
w.prnt('', '%s: Screen attached. Clearing away status' % SCRIPT_NAME)
for server, nick in get_servers():
if set_away:
w.command(server, "/away")
if suffix and nick.endswith(suffix):
nick = nick[:-len(suffix)]
w.command(server, "/nick %s" % nick)
AWAY = False
for cmd in w.config_get_plugin("command_on_attach").split(";"):
w.command("", cmd)
elif not attached and not AWAY:
if not CONNECTED_RELAY:
w.prnt('', '%s: Screen detached. Setting away status' % SCRIPT_NAME)
for server, nick in get_servers():
if suffix and not nick.endswith(suffix):
w.command(server, "/nick %s%s" % (nick, suffix));
if set_away:
w.command(server, "/away %s %s" % (w.config_get_plugin('message'), time.strftime(w.config_get_plugin('time_format'))))
AWAY = True
for cmd in w.config_get_plugin("command_on_detach").split(";"):
w.command("", cmd)
return w.WEECHAT_RC_OK
if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
SCRIPT_DESC, "", ""):
version = w.info_get('version_number', '') or 0
for option, default_desc in settings.iteritems():
if not w.config_is_set_plugin(option):
w.config_set_plugin(option, default_desc[0])
if int(version) >= 0x00030500:
w.config_set_desc_plugin(option, default_desc[1])
if 'STY' in os.environ.keys():
# We are running under screen
cmd_output = os.popen('env LC_ALL=C screen -ls').read()
match = re.search(r'Sockets? in (/.+)\.', cmd_output)
if match:
SOCK = os.path.join(match.group(1), os.environ['STY'])
if not SOCK and 'TMUX' in os.environ.keys():
# We are running under tmux
socket_data = os.environ['TMUX']
SOCK = socket_data.rsplit(',',2)[0]
if SOCK:
set_timer()
w.hook_config("plugins.var.python." + SCRIPT_NAME + ".*",
"screen_away_config_cb", "")

View File

@ -0,0 +1,57 @@
# This weechat plugin pipes the current weechat buffer through urlview
#
# Usage:
# /urlview
#
# History:
# 10-04-2015
# Version 1.0.0: initial release
# Version 1.0.1: reverse text passed to urlview
# Version 1.0.2: remove weechat color from messages
import distutils.spawn
import os
import pipes
import weechat
def urlview(data, buf, args):
infolist = weechat.infolist_get("buffer_lines", buf, "")
lines = []
while weechat.infolist_next(infolist) == 1:
lines.append(
weechat.string_remove_color(
weechat.infolist_string(infolist, "message"),
""
)
)
weechat.infolist_free(infolist)
if not lines:
weechat.prnt(buf, "No URLs found")
return weechat.WEECHAT_RC_OK
text = "\n".join(reversed(lines))
response = os.system("echo %s | urlview" % pipes.quote(text))
if response != 0:
weechat.prnt(buf, "No URLs found")
weechat.command(buf, "/window refresh")
return weechat.WEECHAT_RC_OK
def main():
if distutils.spawn.find_executable("urlview") is None:
return weechat.WEECHAT_RC_ERROR
if not weechat.register("urlview", "Keith Smiley", "1.0.2", "MIT",
"Use urlview on the current buffer", "", ""):
return weechat.WEECHAT_RC_ERROR
weechat.hook_command("urlview", "Pass the current buffer to urlview", "",
"", "", "urlview", "")
if __name__ == "__main__":
main()

View File

@ -1,12 +1,5 @@
#
# weechat -- relay.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# relay.conf -- weechat v1.0.1
#
[look]
@ -25,35 +18,21 @@ text_bg = default
text_selected = white
[network]
allow_empty_password = off
allowed_ips = ""
auth_timeout = 60
bind_address = ""
clients_purge_delay = 0
compression_level = 6
ipv6 = on
max_clients = 5
nonce_size = 16
password = ""
password_hash_algo = "*"
password_hash_iterations = 100000
ssl_cert_key = "%h/ssl/relay.pem"
ssl_priorities = "NORMAL:-VERS-SSL3.0"
totp_secret = ""
totp_window = 0
websocket_allowed_origins = ""
[irc]
backlog_max_minutes = 1440
backlog_max_number = 256
backlog_since_last_disconnect = on
backlog_since_last_message = off
backlog_tags = "irc_privmsg"
backlog_time_format = "[%H:%M] "
[weechat]
commands = ""
[port]
[path]

View File

@ -1,14 +0,0 @@
#
# weechat -- ruby.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[look]
check_license = off
eval_keep_context = on

View File

@ -1,12 +1,5 @@
#
# weechat -- script.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# script.conf -- weechat v1.0.1
#
[look]
@ -50,8 +43,8 @@ text_version_selected = lightmagenta
[scripts]
autoload = on
cache_expire = 1440
download_enabled = on
download_timeout = 30
hold = ""
path = "%h/script"
hold = ""
url = "http://weechat.org/files/plugins.xml.gz"
url_force_https = on

Binary file not shown.

View File

@ -1,18 +1,11 @@
#
# weechat -- sec.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# sec.conf -- weechat v1.0.1
#
[crypt]
cipher = aes256
hash_algo = sha256
passphrase_command = ""
passphrase_file = ""
salt = on
[data]

View File

@ -1,33 +0,0 @@
#
# weechat -- spell.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[color]
misspelled = lightred
suggestion = default
suggestion_delimiter_dict = cyan
suggestion_delimiter_word = cyan
[check]
commands = "away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"
default_dict = ""
during_search = off
enabled = off
real_time = off
suggestions = -1
word_min_length = 2
[dict]
[look]
suggestion_delimiter_dict = " / "
suggestion_delimiter_word = ","
[option]

View File

@ -1,12 +1,5 @@
#
# weechat -- trigger.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# trigger.conf -- weechat v1.0.1
#
[look]
@ -16,7 +9,6 @@ monitor_strip_colors = off
[color]
flag_command = lightgreen
flag_conditions = 130
flag_post_action = lightblue
flag_regex = lightcyan
flag_return_code = lightmagenta
regex = white
@ -30,7 +22,6 @@ beep.command = "/print -beep"
beep.conditions = "${tg_highlight} || ${tg_msg_pv}"
beep.enabled = on
beep.hook = print
beep.post_action = none
beep.regex = ""
beep.return_code = ok
cmd_pass.arguments = "5000|input_text_display;5000|history_add;5000|irc_command_auth"
@ -38,7 +29,6 @@ cmd_pass.command = ""
cmd_pass.conditions = ""
cmd_pass.enabled = on
cmd_pass.hook = modifier
cmd_pass.post_action = none
cmd_pass.regex = "==^((/(msg|m|quote) +nickserv +(id|identify|register|ghost +[^ ]+|release +[^ ]+|regain +[^ ]+) +)|/oper +[^ ]+ +|/quote +pass +|/set +[^ ]*password[^ ]* +|/secure +(passphrase|decrypt|set +[^ ]+) +)(.*)==${re:1}${hide:*,${re:+}}"
cmd_pass.return_code = ok
msg_auth.arguments = "5000|irc_message_auth"
@ -46,7 +36,6 @@ msg_auth.command = ""
msg_auth.conditions = ""
msg_auth.enabled = on
msg_auth.hook = modifier
msg_auth.post_action = none
msg_auth.regex = "==^(.*(id|identify|register|ghost +[^ ]+|release +[^ ]+) +)(.*)==${re:1}${hide:*,${re:+}}"
msg_auth.return_code = ok
server_pass.arguments = "5000|input_text_display;5000|history_add"
@ -54,6 +43,5 @@ server_pass.command = ""
server_pass.conditions = ""
server_pass.enabled = on
server_pass.hook = modifier
server_pass.post_action = none
server_pass.regex = "==^(/(server|connect) .*-(sasl_)?password=)([^ ]+)(.*)==${re:1}${hide:*,${re:4}}${re:5}"
server_pass.return_code = ok

View File

@ -1,19 +0,0 @@
#
# weechat -- typing.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
#
[look]
delay_purge_paused = 30
delay_purge_typing = 6
delay_set_paused = 10
enabled_nicks = off
enabled_self = off
input_min_chars = 4
item_max_length = 0

View File

@ -1,12 +1,5 @@
#
# weechat -- weechat.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# weechat.conf -- weechat v1.0.1
#
[debug]
@ -20,7 +13,6 @@ sys_rlimit = ""
[look]
align_end_of_lines = message
align_multiline_words = on
bar_more_down = "++"
bar_more_left = "<<"
bar_more_right = ">>"
@ -35,7 +27,6 @@ buffer_search_force_default = off
buffer_search_regex = off
buffer_search_where = prefix_message
buffer_time_format = "${color:250}%H${color:lightcyan}:${color:245}%M${color:lightcyan}:${color:240}%S"
buffer_time_same = ""
color_basic_force_bold = off
color_inactive_buffer = on
color_inactive_message = on
@ -47,9 +38,7 @@ color_nick_offline = on
color_pairs_auto_reset = 5
color_real_white = off
command_chars = ""
command_incomplete = off
confirm_quit = off
confirm_upgrade = off
day_change = on
day_change_message_1date = "-- %a, %d %b %Y --"
day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --"
@ -72,30 +61,21 @@ hotlist_short_names = on
hotlist_sort = group_time_asc
hotlist_suffix = ""
hotlist_unique_numbers = on
hotlist_update_on_buffer_switch = on
input_cursor_scroll = 20
input_share = none
input_share_overwrite = off
input_undo_max = 32
item_away_message = on
item_buffer_filter = "*"
item_buffer_zoom = "!"
item_mouse_status = "M"
item_time_format = "%H:%M"
jump_current_to_previous_buffer = on
jump_previous_buffer_when_closing = on
jump_smart_back_to_buffer = on
key_bind_safe = on
key_grab_delay = 800
mouse = off
mouse_timer_delay = 100
nick_color_force = ""
nick_color_hash = djb2
nick_color_hash_salt = ""
nick_color_stop_chars = "_|["
nick_prefix = ""
nick_suffix = ""
paste_auto_add_newline = on
paste_bracketed = on
paste_bracketed_timer_delay = 10
paste_max_lines = 1
@ -114,17 +94,11 @@ prefix_join = "-->"
prefix_network = "--"
prefix_quit = "<--"
prefix_same_nick = ""
prefix_same_nick_middle = ""
prefix_suffix = "│"
quote_nick_prefix = "<"
quote_nick_suffix = ">"
quote_time_format = "%H:%M:%S"
read_marker = line
read_marker_always_show = off
read_marker_string = "- "
read_marker_update_on_buffer_switch = on
save_config_on_exit = on
save_config_with_fsync = off
save_layout_on_exit = none
scroll_amount = 3
scroll_bottom_after_switch = off
@ -138,8 +112,6 @@ window_auto_zoom = off
window_separator_horizontal = on
window_separator_vertical = on
window_title = "WeeChat ${info:version}"
word_chars_highlight = "!\u00A0,-,_,|,alnum"
word_chars_input = "!\u00A0,-,_,|,alnum"
[palette]
@ -183,12 +155,10 @@ chat_text_found_bg = lightmagenta
chat_time = default
chat_time_delimiters = brown
chat_value = cyan
chat_value_null = blue
emphasized = 130
emphasized_bg = magenta
input_actions = lightgreen
input_text_not_found = red
item_away = yellow
nicklist_away = cyan
nicklist_group = green
separator = 235
@ -202,7 +172,6 @@ status_data_other = default
status_data_private = lightgreen
status_filter = green
status_more = 130
status_mouse = green
status_name = white
status_name_ssl = lightgreen
status_nicklist_count = default
@ -211,11 +180,9 @@ status_time = default
[completion]
base_word_until_cursor = on
command_inline = on
default_template = "%(nicks)|%(irc_channels)"
nick_add_space = on
nick_case_sensitive = off
nick_completer = ": "
nick_completer = ":"
nick_first_only = off
nick_ignore_chars = "[]`_-^"
partial_completion_alert = on
@ -223,7 +190,6 @@ partial_completion_command = off
partial_completion_command_arg = off
partial_completion_count = on
partial_completion_other = off
partial_completion_templates = "config_options"
[history]
display_default = 5
@ -236,8 +202,7 @@ max_visited_buffers = 50
[network]
connection_timeout = 60
gnutls_ca_system = on
gnutls_ca_user = ""
gnutls_ca_file = "/etc/ssl/certs/ca-certificates.crt"
gnutls_handshake_timeout = 30
proxy_curl = ""
@ -248,16 +213,8 @@ extension = ".so,.dll"
path = "%h/plugins"
save_config_on_unload = on
[signal]
sighup = "${if:${info:weechat_headless}?/reload:/quit -yes}"
sigquit = "/quit -yes"
sigterm = "/quit -yes"
sigusr1 = ""
sigusr2 = ""
[bar]
buflist.color_bg = default
buflist.color_bg_inactive = default
buflist.color_delim = default
buflist.color_fg = default
buflist.conditions = ""
@ -271,23 +228,7 @@ buflist.separator = on
buflist.size = 0
buflist.size_max = 0
buflist.type = root
fset.color_bg = default
fset.color_bg_inactive = default
fset.color_delim = cyan
fset.color_fg = default
fset.conditions = "${buffer.full_name} == fset.fset"
fset.filling_left_right = vertical
fset.filling_top_bottom = horizontal
fset.hidden = off
fset.items = "fset"
fset.position = top
fset.priority = 0
fset.separator = on
fset.size = 3
fset.size_max = 3
fset.type = window
isetbar.color_bg = default
isetbar.color_bg_inactive = default
isetbar.color_delim = cyan
isetbar.color_fg = default
isetbar.conditions = ""
@ -302,7 +243,6 @@ isetbar.size = 3
isetbar.size_max = 3
isetbar.type = window
nicklist.color_bg = default
nicklist.color_bg_inactive = default
nicklist.color_delim = cyan
nicklist.color_fg = default
nicklist.conditions = "${nicklist}"
@ -317,7 +257,6 @@ nicklist.size = 0
nicklist.size_max = 0
nicklist.type = window
rootinput.color_bg = default
rootinput.color_bg_inactive = default
rootinput.color_delim = cyan
rootinput.color_fg = default
rootinput.conditions = ""
@ -332,14 +271,13 @@ rootinput.size = 1
rootinput.size_max = 0
rootinput.type = root
rootstatus.color_bg = 235
rootstatus.color_bg_inactive = default
rootstatus.color_delim = lightcyan
rootstatus.color_fg = default
rootstatus.conditions = ""
rootstatus.filling_left_right = vertical
rootstatus.filling_top_bottom = horizontal
rootstatus.hidden = off
rootstatus.items = "[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+buffer_zoom+buffer_filter,[lag],[hotlist],(mouse_status),completion,scroll"
rootstatus.items = "[time],[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+buffer_zoom+buffer_filter,[lag],[hotlist],(mouse_status),completion,scroll"
rootstatus.position = bottom
rootstatus.priority = 25
rootstatus.separator = off
@ -347,7 +285,6 @@ rootstatus.size = 1
rootstatus.size_max = 0
rootstatus.type = root
title.color_bg = 235
title.color_bg_inactive = default
title.color_delim = lightcyan
title.color_fg = default
title.conditions = ""
@ -374,7 +311,6 @@ default.window = "3;1;0;0;core;weechat"
default.current = on
[notify]
perl.highmon = none
[filter]
@ -406,11 +342,6 @@ ctrl-U = "/input delete_beginning_of_line"
ctrl-W = "/input delete_previous_word"
ctrl-X = "/input switch_active_buffer"
ctrl-Y = "/input clipboard_paste"
meta-ctrl-M = "/input insert \n"
meta-meta-OP = "/bar scroll buflist * b"
meta-meta-OQ = "/bar scroll buflist * e"
meta-meta2-11~ = "/bar scroll buflist * b"
meta-meta2-12~ = "/bar scroll buflist * e"
meta-meta2-1~ = "/window scroll_top"
meta-meta2-23~ = "/bar scroll nicklist * b"
meta-meta2-24~ = "/bar scroll nicklist * e"
@ -438,24 +369,16 @@ meta-9 = "/buffer *9"
meta-< = "/input jump_previously_visited_buffer"
meta-= = "/filter toggle"
meta-> = "/input jump_next_visited_buffer"
meta-B = "/buflist toggle"
meta-N = "/bar toggle nicklist"
meta-OA = "/input history_global_previous"
meta-OB = "/input history_global_next"
meta-OC = "/input move_next_word"
meta-OD = "/input move_previous_word"
meta-OF = "/input move_end_of_line"
meta-OH = "/input move_beginning_of_line"
meta-OP = "/bar scroll buflist * -100%"
meta-OQ = "/bar scroll buflist * +100%"
meta-Oa = "/input history_global_previous"
meta-Ob = "/input history_global_next"
meta-Oc = "/input move_next_word"
meta-Od = "/input move_previous_word"
meta2-11^ = "/bar scroll buflist * -100%"
meta2-11~ = "/bar scroll buflist * -100%"
meta2-12^ = "/bar scroll buflist * +100%"
meta2-12~ = "/bar scroll buflist * +100%"
meta2-15~ = "/buffer -1"
meta2-17~ = "/buffer +1"
meta2-18~ = "/window -1"
@ -466,26 +389,18 @@ meta2-1;3C = "/buffer +1"
meta2-1;3D = "/buffer -1"
meta2-1;3F = "/window scroll_bottom"
meta2-1;3H = "/window scroll_top"
meta2-1;3P = "/bar scroll buflist * b"
meta2-1;3Q = "/bar scroll buflist * e"
meta2-1;5A = "/input history_global_previous"
meta2-1;5B = "/input history_global_next"
meta2-1;5C = "/input move_next_word"
meta2-1;5D = "/input move_previous_word"
meta2-1;5P = "/bar scroll buflist * -100%"
meta2-1;5Q = "/bar scroll buflist * +100%"
meta2-1~ = "/input move_beginning_of_line"
meta2-200~ = "/input paste_start"
meta2-201~ = "/input paste_stop"
meta2-20~ = "/bar scroll title * -30%"
meta2-21~ = "/bar scroll title * +30%"
meta2-23;3~ = "/bar scroll nicklist * b"
meta2-23;5~ = "/bar scroll nicklist * -100%"
meta2-23^ = "/bar scroll nicklist * -100%"
meta2-23~ = "/bar scroll nicklist * -100%"
meta2-24;3~ = "/bar scroll nicklist * e"
meta2-24;5~ = "/bar scroll nicklist * +100%"
meta2-24^ = "/bar scroll nicklist * +100%"
meta2-24~ = "/bar scroll nicklist * +100%"
meta2-3~ = "/input delete_next_char"
meta2-4~ = "/input move_end_of_line"
@ -510,10 +425,7 @@ meta-a = "/input jump_smart"
meta-b = "/input move_previous_word"
meta-d = "/input delete_next_word"
meta-f = "/input move_next_word"
meta-hmeta-R = "/input hotlist_restore_all"
meta-hmeta-c = "/input hotlist_clear"
meta-hmeta-m = "/input hotlist_remove_buffer"
meta-hmeta-r = "/input hotlist_restore_buffer"
meta-h = "/input hotlist_clear"
meta-jmeta-f = "/buffer -"
meta-jmeta-l = "/buffer +"
meta-jmeta-r = "/server raw"
@ -643,7 +555,6 @@ ctrl-_ = "/input undo"
ctrl-I = "/input search_switch_where"
ctrl-J = "/input search_stop"
ctrl-M = "/input search_stop"
ctrl-Q = "/input search_stop"
ctrl-R = "/input search_switch_regex"
meta2-A = "/input search_previous"
meta2-B = "/input search_next"
@ -681,10 +592,6 @@ meta2-D = "/cursor move left"
@bar(nicklist):button1-gesture-down-long = "/bar scroll nicklist ${_window_number} e"
@bar(nicklist):button1-gesture-up = "/bar scroll nicklist ${_window_number} -100%"
@bar(nicklist):button1-gesture-up-long = "/bar scroll nicklist ${_window_number} b"
@chat(fset.fset):button1 = "/window ${_window_number};/fset -go ${_chat_line_y}"
@chat(fset.fset):button2* = "hsignal:fset_mouse"
@chat(fset.fset):wheeldown = "/fset -down 5"
@chat(fset.fset):wheelup = "/fset -up 5"
@chat(perl.iset):button1 = "hsignal:iset_mouse"
@chat(perl.iset):button2* = "hsignal:iset_mouse"
@chat(perl.iset):wheeldown = "/repeat 5 /iset **down"
@ -698,12 +605,6 @@ meta2-D = "/cursor move left"
@item(buffer_nicklist):button1-gesture-left-long = "/window ${_window_number};/kickban ${nick}"
@item(buffer_nicklist):button2 = "/window ${_window_number};/whois ${nick}"
@item(buffer_nicklist):button2-gesture-left = "/window ${_window_number};/ban ${nick}"
@item(buflist):button1* = "hsignal:buflist_mouse"
@item(buflist):button2* = "hsignal:buflist_mouse"
@item(buflist2):button1* = "hsignal:buflist_mouse"
@item(buflist2):button2* = "hsignal:buflist_mouse"
@item(buflist3):button1* = "hsignal:buflist_mouse"
@item(buflist3):button2* = "hsignal:buflist_mouse"
@bar:wheeldown = "/bar scroll ${_bar_name} ${_window_number} +20%"
@bar:wheelup = "/bar scroll ${_bar_name} ${_window_number} -20%"
@chat:button1 = "/window ${_window_number}"

View File

@ -1,12 +1,5 @@
#
# weechat -- xfer.conf
#
# WARNING: It is NOT recommended to edit this file by hand,
# especially if WeeChat is running.
#
# Use commands like /set or /fset to change settings in WeeChat.
#
# For more info, see: https://weechat.org/doc/quickstart
# xfer.conf -- weechat v1.0.1
#
[look]
@ -30,9 +23,7 @@ blocksize = 65536
fast_send = on
own_ip = ""
port_range = ""
send_ack = on
speed_limit_recv = 0
speed_limit_send = 0
speed_limit = 0
timeout = 300
[file]
@ -44,6 +35,5 @@ auto_rename = on
auto_resume = on
convert_spaces = on
download_path = "%h/xfer"
download_temporary_suffix = ".part"
upload_path = "~"
use_nick_in_filename = on

0
Maildir/new/1535005048.V902Ia2375bM697525.tilde:2, Executable file → Normal file
View File

0
public_html/avatar.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 916 B

After

Width:  |  Height:  |  Size: 916 B

0
public_html/blog/.config Normal file → Executable file
View File

0
public_html/blog/index.html Normal file → Executable file
View File

View File

@ -1,8 +0,0 @@
#!/bin/sh
echo "Content-type: text/plain"
echo ""
echo $REMOTE_ADDR
exit 0

0
public_html/index.php Normal file → Executable file
View File