├── .gitignore ├── .gitmodules ├── LICENSE.md ├── bash ├── .bash_aliases ├── .bash_logout ├── .bash_profile ├── .bashrc └── .profile ├── git ├── .gitconfig └── .local │ └── bin │ └── git-fixup ├── gnupg └── .gnupg │ ├── .gitignore │ └── gpg.conf ├── hashbang ├── .config │ ├── dehydrated │ │ ├── config.template │ │ └── domains.txt.template │ ├── nginx │ │ ├── nginx-http-only.conf.template │ │ └── nginx.conf.template │ └── systemd │ │ └── user │ │ ├── SimpleHTTPServer@.service │ │ ├── dehydrated.service │ │ ├── dehydrated.timer │ │ ├── nginx-http-only.service │ │ └── nginx.service ├── .muttrc └── .tmux_bootstrap ├── ssh └── .ssh │ └── .gitignore ├── tmux └── .tmux.conf ├── weechat └── .weechat │ ├── .gitignore │ ├── alias.conf │ ├── aspell.conf │ ├── buflist.conf │ ├── charset.conf │ ├── exec.conf │ ├── irc.conf │ ├── iset.conf │ ├── logger.conf │ ├── perl │ ├── autoload │ │ ├── highmon.pl │ │ └── iset.pl │ ├── highmon.pl │ └── iset.pl │ ├── plugins.conf │ ├── python │ ├── autojoin.py │ ├── autoload │ │ ├── autojoin.py │ │ ├── grep.py │ │ ├── otr.py │ │ ├── screen_away.py │ │ └── urlview.py │ ├── grep.py │ ├── otr.py │ ├── screen_away.py │ └── urlview.py │ ├── relay.conf │ ├── script.conf │ ├── script │ └── plugins.xml.gz │ ├── sec.conf │ ├── trigger.conf │ ├── weechat.conf │ └── xfer.conf └── zsh ├── .zlogin ├── .zlogout ├── .zprofile ├── .zshenv ├── .zshrc └── .zshrc.pre /.gitignore: -------------------------------------------------------------------------------- 1 | *.log -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".grml-etc-core"] 2 | path = zsh/.grml-etc-core 3 | url = https://github.com/grml/grml-etc-core.git 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hashbang Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bash/.bash_aliases: -------------------------------------------------------------------------------- 1 | alias hashbangctl="sudo /usr/local/bin/hashbangctl" 2 | -------------------------------------------------------------------------------- /bash/.bash_logout: -------------------------------------------------------------------------------- 1 | # ~/.bash_logout: executed by bash(1) when login shell exits. 2 | 3 | # when leaving the console clear the screen to increase privacy 4 | 5 | if [ "$SHLVL" = 1 ]; then 6 | [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q 7 | fi 8 | -------------------------------------------------------------------------------- /bash/.bash_profile: -------------------------------------------------------------------------------- 1 | export EDITOR=nano 2 | export VISUAL=$EDITOR 3 | 4 | # Source the greetings banner 5 | [ ! -d "/etc/hashbang" ] || /etc/hashbang/welcome 6 | 7 | # make sure this is an interactive session, then start tmux 8 | [[ $- != *i* ]] && return 9 | [[ -f "$HOME/.bashrc" ]] && . "$HOME/.bashrc" 10 | [[ -z "$TMUX" ]] && ~/.tmux_bootstrap 11 | -------------------------------------------------------------------------------- /bash/.bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) 3 | # for examples 4 | 5 | # If not running interactively, don't do anything 6 | case $- in 7 | *i*) ;; 8 | *) return;; 9 | esac 10 | 11 | # don't put duplicate lines or lines starting with space in the history. 12 | # See bash(1) for more options 13 | HISTCONTROL=ignoreboth 14 | 15 | # append to the history file, don't overwrite it 16 | shopt -s histappend 17 | 18 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 19 | HISTSIZE=1000 20 | HISTFILESIZE=2000 21 | 22 | # check the window size after each command and, if necessary, 23 | # update the values of LINES and COLUMNS. 24 | shopt -s checkwinsize 25 | 26 | # If set, the pattern "**" used in a pathname expansion context will 27 | # match all files and zero or more directories and subdirectories. 28 | #shopt -s globstar 29 | 30 | function paste() { 31 | cat "$@" | curl -F "d=<-" a.pae.st 2>&- | grep -F -- "-PUBLIC" 32 | } 33 | 34 | 35 | # make less more friendly for non-text input files, see lesspipe(1) 36 | #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 37 | 38 | # set variable identifying the chroot you work in (used in the prompt below) 39 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then 40 | debian_chroot=$(cat /etc/debian_chroot) 41 | fi 42 | 43 | # set a fancy prompt (non-color, unless we know we "want" color) 44 | case "$TERM" in 45 | xterm-color) color_prompt=yes;; 46 | esac 47 | 48 | # uncomment for a colored prompt, if the terminal has the capability; turned 49 | # off by default to not distract the user: the focus in a terminal window 50 | # should be on the output of commands, not on the prompt 51 | #force_color_prompt=yes 52 | 53 | if [ -n "$force_color_prompt" ]; then 54 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 55 | # We have color support; assume it's compliant with Ecma-48 56 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such 57 | # a case would tend to support setf rather than setaf.) 58 | color_prompt=yes 59 | else 60 | color_prompt= 61 | fi 62 | fi 63 | 64 | if [ "$color_prompt" = yes ]; then 65 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 66 | else 67 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 68 | fi 69 | unset color_prompt force_color_prompt 70 | 71 | # If this is an xterm set the title to user@host:dir 72 | case "$TERM" in 73 | xterm*|rxvt*) 74 | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 75 | ;; 76 | *) 77 | ;; 78 | esac 79 | 80 | # enable color support of ls and also add handy aliases 81 | if [ -x /usr/bin/dircolors ]; then 82 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 83 | alias ls='ls --color=auto' 84 | #alias dir='dir --color=auto' 85 | #alias vdir='vdir --color=auto' 86 | 87 | #alias grep='grep --color=auto' 88 | #alias fgrep='fgrep --color=auto' 89 | #alias egrep='egrep --color=auto' 90 | fi 91 | 92 | # colored GCC warnings and errors 93 | #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' 94 | 95 | # some more ls aliases 96 | #alias ll='ls -l' 97 | #alias la='ls -A' 98 | #alias l='ls -CF' 99 | 100 | # Alias definitions. 101 | # You may want to put all your additions into a separate file like 102 | # ~/.bash_aliases, instead of adding them here directly. 103 | # See /usr/share/doc/bash-doc/examples in the bash-doc package. 104 | 105 | if [ -f ~/.bash_aliases ]; then 106 | . ~/.bash_aliases 107 | fi 108 | 109 | # enable programmable completion features (you don't need to enable 110 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 111 | # sources /etc/bash.bashrc). 112 | if ! shopt -oq posix; then 113 | if [ -f /usr/share/bash-completion/bash_completion ]; then 114 | . /usr/share/bash-completion/bash_completion 115 | elif [ -f /etc/bash_completion ]; then 116 | . /etc/bash_completion 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /bash/.profile: -------------------------------------------------------------------------------- 1 | # ~/.profile: executed by the command interpreter for login shells. 2 | # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 3 | # exists. 4 | # see /usr/share/doc/bash/examples/startup-files for examples. 5 | # the files are located in the bash-doc package. 6 | 7 | # the default umask is set in /etc/profile; for setting the umask 8 | # for ssh logins, install and configure the libpam-umask package. 9 | #umask 022 10 | 11 | # if running bash 12 | if [ -n "$BASH_VERSION" ]; then 13 | # include .bashrc if it exists 14 | if [ -f "$HOME/.bashrc" ]; then 15 | . "$HOME/.bashrc" 16 | fi 17 | fi 18 | 19 | # set PATH so it includes user's private bin if it exists 20 | if [ -d "$HOME/bin" ] ; then 21 | PATH="$HOME/bin:$PATH" 22 | fi 23 | -------------------------------------------------------------------------------- /git/.gitconfig: -------------------------------------------------------------------------------- 1 | # Those are #!'s customizations 2 | [push] 3 | default = simple 4 | [hub] 5 | protocol = https 6 | 7 | # Your own customizations come here 8 | -------------------------------------------------------------------------------- /git/.local/bin/git-fixup: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # Inspired by Fillipo Valsorda, but more portable: 3 | # https://blog.filippo.io/git-fixup-amending-an-older-commit/ 4 | 5 | help() { 6 | echo "git fixup [git-commit options...]" 7 | echo "git-fixup introduces new changes in an older commit" 8 | echo " and rewrites (rebase) the git history." 9 | } 10 | 11 | if [ $# -eq 0 ]; then 12 | help 13 | exit 1 14 | elif [ "$1" = "--help" ] || [ "$1" = "-h" ]; then 15 | help 16 | exit 0 17 | fi 18 | 19 | EDITOR=true # Suppress the editor 20 | TARGET=$(git rev-parse "$1") # Commit hash to fixup 21 | shift 22 | 23 | git -c commit.gpgSign=false commit --fixup="$TARGET" "$@" 24 | git rebase -i --autostash --autosquash "$TARGET^" 25 | -------------------------------------------------------------------------------- /gnupg/.gnupg/.gitignore: -------------------------------------------------------------------------------- 1 | pubring.gpg 2 | secring.gpg 3 | trustdb.gpg 4 | -------------------------------------------------------------------------------- /gnupg/.gnupg/gpg.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This is an implementation of the Riseup OpenPGP Best Practices 3 | # https://help.riseup.net/en/security/message-security/openpgp/best-practices 4 | # Shamelessly stolen from Jake Applebaum's duraconf 5 | # 6 | 7 | #----------------------------- 8 | # options for keysigning 9 | #----------------------------- 10 | 11 | ask-cert-level 12 | default-cert-level 2 13 | 14 | #----------------------------- 15 | # default key 16 | #----------------------------- 17 | 18 | # The default key to sign with. If this option is not used, the default key is 19 | # the first key found in the secret keyring 20 | 21 | #default-key 0x700E88FC14B533111AD7A40F1D7C08C6CC263D74 22 | 23 | #----------------------------- 24 | # behavior 25 | #----------------------------- 26 | 27 | # Don't autocheck the trust DB, this is super-slow 28 | # auto-check-trustdb 29 | 30 | # Disable inclusion of the version string in ASCII armored output 31 | no-emit-version 32 | 33 | # Disable comment string in clear text signatures and ASCII armored messages 34 | no-comments 35 | 36 | # Display long key IDs 37 | keyid-format 0xlong 38 | 39 | # List all keys (or the specified ones) along with their fingerprints 40 | with-fingerprint 41 | 42 | # Display the calculated validity of user IDs during key listings 43 | list-options show-uid-validity 44 | verify-options show-uid-validity 45 | 46 | # Try to use the GnuPG-Agent. With this option, GnuPG first tries to connect to 47 | # the agent before it asks for a passphrase. 48 | use-agent 49 | 50 | 51 | #----------------------------- 52 | # keyserver options 53 | #----------------------------- 54 | 55 | # When using --refresh-keys, if the key in question has a preferred keyserver 56 | # URL, then disable use of that preferred keyserver to refresh the key from 57 | keyserver-options no-honor-keyserver-url 58 | 59 | # When searching for a key with --search-keys, include keys that are marked on 60 | # the keyserver as revoked 61 | keyserver-options include-revoked 62 | 63 | # When checking a sig, automatically fetch the key 64 | #keyserver-options auto-key-retrieve 65 | 66 | #----------------------------- 67 | # algorithm and ciphers 68 | #----------------------------- 69 | 70 | # list of personal cipher preferences. When multiple ciphers are supported by 71 | # all recipients, choose the strongest one 72 | personal-cipher-preferences AES AES256 AES192 73 | 74 | # list of personal digest preferences. When multiple digests are supported by 75 | # all recipients, choose the strongest one 76 | personal-digest-preferences SHA512 SHA384 SHA256 SHA224 77 | 78 | # message digest algorithm used when signing a key 79 | cert-digest-algo SHA512 80 | 81 | # This preference list is used for new keys and becomes the default for 82 | # "setpref" in the edit menu 83 | default-preference-list SHA512 SHA384 SHA256 SHA224 AES AES256 AES192 ZLIB BZIP2 ZIP Uncompressed 84 | 85 | 86 | #----------------------------- 87 | # Debian keyrings 88 | #----------------------------- 89 | 90 | # Use read-only, system-wide keyrings for the Debian keys. In order: 91 | # - Debian Developers, uploading and non-uploading 92 | # - Debian Maintainers 93 | # - Debian “role keys” (ftpmaster, archive signing, ...) 94 | keyring /usr/share/keyrings/debian-keyring.gpg 95 | keyring /usr/share/keyrings/debian-nonupload.gpg 96 | keyring /usr/share/keyrings/debian-maintainers.gpg 97 | keyring /usr/share/keyrings/debian-role-keys.gpg 98 | 99 | 100 | #----------------------------- 101 | # Hashbang keyring 102 | #----------------------------- 103 | 104 | # This is convenient for users who want to check signatures 105 | # when updating dotfiles and so on. 106 | keyring /etc/gnupg/hashbang-admins.gpg 107 | -------------------------------------------------------------------------------- /hashbang/.config/dehydrated/config.template: -------------------------------------------------------------------------------- 1 | API=2 2 | CHALLENGETYPE="http-01" 3 | WELLKNOWN="${HOME}/Public/.well-known/acme-challenge" 4 | CONTACT_EMAIL="${USER}@${FULLHOST}" 5 | -------------------------------------------------------------------------------- /hashbang/.config/dehydrated/domains.txt.template: -------------------------------------------------------------------------------- 1 | ${USER}.${FULLHOST} 2 | -------------------------------------------------------------------------------- /hashbang/.config/nginx/nginx-http-only.conf.template: -------------------------------------------------------------------------------- 1 | ### hashbang nginx configuration template 2 | ### This is a simplified configuration, just to serve ~/Public 3 | 4 | worker_processes 1; 5 | error_log stderr; 6 | pid /home/${USER}/.nginx.pid; 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | http { 13 | include /etc/nginx/mime.types; 14 | default_type application/octet-stream; 15 | 16 | sendfile on; 17 | 18 | keepalive_timeout 65; 19 | 20 | access_log stdout; 21 | server { 22 | listen unix:/home/${USER}/.nginx.sock; 23 | server_name ${USER}.${FULLHOST}; 24 | 25 | location / { 26 | root /home/${USER}/Public; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /hashbang/.config/nginx/nginx.conf.template: -------------------------------------------------------------------------------- 1 | ### hashbang nginx configuration template 2 | ### This is a simplified configuration, just to serve ~/Public 3 | 4 | worker_processes 1; 5 | error_log stderr; 6 | pid /home/${USER}/.nginx.pid; 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | http { 13 | include /etc/nginx/mime.types; 14 | default_type application/octet-stream; 15 | 16 | sendfile on; 17 | 18 | keepalive_timeout 65; 19 | 20 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; 21 | ssl_prefer_server_ciphers on; 22 | access_log stdout; 23 | server { 24 | listen unix:/home/${USER}/.nginx.sock; 25 | server_name ${USER}.${FULLHOST}; 26 | 27 | location / { 28 | root /home/${USER}/Public; 29 | } 30 | } 31 | 32 | server { 33 | listen unix:/home/${USER}/.nginx.https.sock ssl; 34 | server_name ${USER}.${FULLHOST}; 35 | ssl_certificate /home/${USER}/.config/dehydrated/certs/${USER}.${FULLHOST}/fullchain.pem; 36 | ssl_certificate_key /home/${USER}/.config/dehydrated/certs/${USER}.${FULLHOST}/privkey.pem; 37 | 38 | location / { 39 | root /home/${USER}/Public; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /hashbang/.config/systemd/user/SimpleHTTPServer@.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=SimpleHTTPServer 3 | After=network-online.target 4 | Wants=network-online.target 5 | 6 | 7 | [Service] 8 | #each user needs to change the port to an unused value above 1024 9 | ExecStart=/usr/bin/python3 -m http.server %I 10 | WorkingDirectory=%h/Public 11 | Restart=always 12 | 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /hashbang/.config/systemd/user/dehydrated.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=letsencrypt/acme client implementation as a shell-script - just add water 3 | 4 | [Service] 5 | WorkingDirectory=%h/.config/dehydrated 6 | ExecStartPre=/bin/sh -c 'FULLHOST=`hostname -f` /usr/bin/envsubst < %h/.config/dehydrated/config.template > %h/.config/dehydrated/config' 7 | ExecStartPre=/bin/sh -c 'FULLHOST=`hostname -f` /usr/bin/envsubst < %h/.config/dehydrated/domains.txt.template > %h/.config/dehydrated/domains.txt' 8 | ExecStartPre=/bin/mkdir -p %h/Public/.well-known/acme-challenge 9 | ExecStartPre=/bin/sh -c 'test -d %h/.config/dehydrated/certs/%u.`hostname -f` || /usr/bin/dehydrated --register --accept-terms --config %h/.config/dehydrated/config' 10 | ExecStart=/usr/bin/dehydrated -c --config %h/.config/dehydrated/config 11 | Type=oneshot 12 | 13 | [Install] 14 | WantedBy=default.target 15 | -------------------------------------------------------------------------------- /hashbang/.config/systemd/user/dehydrated.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Run dehydrated -c periodically 3 | 4 | [Timer] 5 | OnBootSec=15min 6 | OnCalendar=weekly 7 | 8 | [Install] 9 | WantedBy=default.target 10 | -------------------------------------------------------------------------------- /hashbang/.config/systemd/user/nginx-http-only.service: -------------------------------------------------------------------------------- 1 | ### Hashbang nginx user service template 2 | 3 | [Unit] 4 | Description=A high performance web server and a reverse proxy server 5 | Documentation=man:nginx(8) 6 | 7 | [Service] 8 | ExecStartPre=/bin/sh -c 'FULLHOST=`hostname -f` /usr/bin/envsubst < %h/.config/nginx/nginx-http-only.conf.template > %h/.config/nginx/nginx-http-only.conf' 9 | ExecStartPre=-/usr/bin/rm %h/.nginx.sock 10 | ExecStart=/usr/sbin/nginx -g 'daemon off; master_process on;' -p %h/.config/nginx -c nginx-http-only.conf 11 | ExecStopPost=-/usr/bin/rm %h/.nginx.sock 12 | Restart=always 13 | 14 | [Install] 15 | WantedBy=default.target 16 | -------------------------------------------------------------------------------- /hashbang/.config/systemd/user/nginx.service: -------------------------------------------------------------------------------- 1 | ### Hashbang nginx user service template 2 | 3 | [Unit] 4 | Description=A high performance web server and a reverse proxy server 5 | Documentation=man:nginx(8) 6 | 7 | [Service] 8 | ExecStartPre=/bin/sh -c 'FULLHOST=`hostname -f` /usr/bin/envsubst < %h/.config/nginx/nginx.conf.template > %h/.config/nginx/nginx.conf' 9 | ExecStartPre=-/usr/bin/rm %h/.nginx.sock 10 | ExecStartPre=-/usr/bin/rm %h/.nginx.https.sock 11 | ExecStart=/usr/sbin/nginx -g 'daemon off; master_process on;' -p %h/.config/nginx -c nginx.conf 12 | ExecStopPost=-/usr/bin/rm %h/.nginx.sock 13 | ExecStopPost=-/usr/bin/rm %h/.nginx.https.sock 14 | Restart=always 15 | 16 | [Install] 17 | WantedBy=default.target 18 | -------------------------------------------------------------------------------- /hashbang/.muttrc: -------------------------------------------------------------------------------- 1 | # Forcibly remove welcome message 10 seconds after opening it 2 | message-hook '~f"^noreply@hashbang\.sh$"~s"^Press Enter to open this!$"~b"will self-destruct"' \ 3 | 'push ":unset wait_key\n!(sleep 10 && tmux display-message '"'*PFWOOOOSH*: Message deleted: Welcome')"'&\n:set wait_key\n"' 4 | 5 | set mbox_type=Maildir 6 | set folder=$HOME/Mail 7 | set record=+/sent 8 | set postponed=+/postponed 9 | set spoolfile=+/ 10 | set header_cache=~/.cache/mutt 11 | -------------------------------------------------------------------------------- /hashbang/.tmux_bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tmux ls | grep '#!' > /dev/null || ( 4 | tmux new-session -d -s '#!' -n 'chat' "weechat" 5 | tmux new-window -n 'mail' 'firejail mutt' 6 | tmux new-window -n 'shell' -a 7 | ) 8 | exec tmux attach -t '#!' 9 | -------------------------------------------------------------------------------- /ssh/.ssh/.gitignore: -------------------------------------------------------------------------------- 1 | id_* 2 | known_hosts 3 | -------------------------------------------------------------------------------- /tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | # assume 256 colors 2 | set -g default-terminal "tmux-256color" 3 | 4 | # default statusbar colors 5 | set-option -g status-bg colour235 #base02 6 | set-option -g status-fg colour130 #yellow 7 | set-option -g status-attr default 8 | 9 | # default window title colors 10 | set-window-option -g window-status-fg colour33 #base0 11 | set-window-option -g window-status-bg default 12 | 13 | # active window title colors 14 | set-window-option -g window-status-current-fg colour196 #orange 15 | set-window-option -g window-status-current-bg default 16 | 17 | # please give us a bit more history 18 | set-option -g history-limit 5000 19 | 20 | # enable terminal title 21 | set-option -g set-titles on 22 | set -g set-titles-string "#(whoami)@##!(#H) - #{?#{m:*sh,#{pane_current_command}},#{pane_current_path},#{pane_current_command}}" 23 | 24 | # pane border 25 | set-option -g pane-border-fg colour235 #base02 26 | set-option -g pane-active-border-fg colour46 #base01 27 | 28 | # message text 29 | set-option -g message-bg colour235 #base02 30 | set-option -g message-fg colour196 #orange 31 | 32 | # pane number display 33 | set-option -g display-panes-active-colour colour20 #blue 34 | set-option -g display-panes-colour colour196 #orange 35 | 36 | # Zero-based indexing is sure great in programming languages, 37 | # but not so much in terminal multiplexers where that zero is all the way on the other side of the keyboard. 38 | set-option -g base-index 1 39 | 40 | # Enable mouse 41 | set-window-option -qg mode-mouse on 42 | set-option -qg mouse-select-pane on 43 | set-option -qg mouse-resize-pane on 44 | set-option -qg mouse-select-window on 45 | set-option -qg mouse-utf8 on 46 | set-option -qg mouse on 47 | 48 | # Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access. 49 | set -s escape-time 50 50 | 51 | #statusline setup 52 | set -g status on 53 | set -qg status-utf8 on 54 | set -g status-interval 2 55 | set -g status-right-length 70 56 | set -g status-right-style fg=colour130 57 | 58 | # uptime and load average 59 | set -g status-right "[↑ #(uptime | sed -E 's/.+up +//; s/,.+: /][/; s/,//g')]" 60 | 61 | #date/time and timezone 62 | set -ag status-right "[%Y-%m-%d %H:%M:%S %Z]" 63 | 64 | #tmux version 65 | set -ag status-right "[tmux #{version}]" 66 | 67 | # ctrl-Bmeta-Q exit terminal 68 | bind-key M-q kill-session 69 | 70 | -------------------------------------------------------------------------------- /weechat/.weechat/.gitignore: -------------------------------------------------------------------------------- 1 | fifo.conf 2 | otr.conf 3 | -------------------------------------------------------------------------------- /weechat/.weechat/alias.conf: -------------------------------------------------------------------------------- 1 | # 2 | # alias.conf -- weechat v1.0.1 3 | # 4 | 5 | [cmd] 6 | AAWAY = "allserv /away" 7 | AME = "allchan /me" 8 | AMSG = "allchan /msg *" 9 | ANICK = "allserv /nick" 10 | BEEP = "print -beep" 11 | BYE = "quit" 12 | C = "buffer clear" 13 | CHAT = "dcc chat" 14 | CL = "buffer clear" 15 | CLOSE = "buffer close" 16 | EXIT = "quit" 17 | IG = "ignore" 18 | J = "join" 19 | K = "kick" 20 | KB = "kickban" 21 | LEAVE = "part" 22 | M = "msg" 23 | MSGBUF = "command -buffer $1 * /input send $2-" 24 | MUB = "unban *" 25 | N = "names" 26 | Q = "query" 27 | REDRAW = "window refresh" 28 | save_settings = "/autojoin --run;/layout store;/save" 29 | SAY = "msg *" 30 | SIGNOFF = "quit" 31 | T = "topic" 32 | UB = "unban" 33 | UMODE = "mode $nick" 34 | V = "command core version" 35 | W = "who" 36 | WC = "window merge" 37 | WI = "whois" 38 | WII = "whois $1 $1" 39 | WW = "whowas" 40 | 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" 41 | 42 | [completion] 43 | MSGBUF = "%(buffers_plugins_names)" 44 | -------------------------------------------------------------------------------- /weechat/.weechat/aspell.conf: -------------------------------------------------------------------------------- 1 | # 2 | # aspell.conf -- weechat v1.0.1 3 | # 4 | 5 | [color] 6 | misspelled = lightred 7 | suggestions = default 8 | 9 | [check] 10 | commands = "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic" 11 | default_dict = "" 12 | during_search = off 13 | enabled = off 14 | real_time = off 15 | suggestions = -1 16 | word_min_length = 2 17 | 18 | [dict] 19 | 20 | [option] 21 | -------------------------------------------------------------------------------- /weechat/.weechat/buflist.conf: -------------------------------------------------------------------------------- 1 | # 2 | # weechat -- buflist.conf 3 | # 4 | # WARNING: It is NOT recommended to edit this file by hand, 5 | # especially if WeeChat is running. 6 | # 7 | # Use /set or similar command to change settings in WeeChat. 8 | # 9 | # For more info, see: https://weechat.org/doc/quickstart 10 | # 11 | 12 | [look] 13 | display_conditions = "${buffer.hidden}==0" 14 | enabled = on 15 | mouse_jump_visited_buffer = off 16 | mouse_move_buffer = on 17 | mouse_wheel = on 18 | nick_prefix = off 19 | nick_prefix_empty = on 20 | signals_refresh = "" 21 | sort = "number,-active" 22 | 23 | [format] 24 | buffer = "${format_number}${indent}${format_nick_prefix}${color_hotlist}${name}" 25 | buffer_current = "${color:,233}${format_number}${indent}${format_nick_prefix}${color:lightcyan}${name}" 26 | hotlist = " ${color:green}(${hotlist}${color:green})" 27 | hotlist_highlight = "${color:magenta}" 28 | hotlist_low = "${color:default}" 29 | hotlist_message = "${color:130}" 30 | hotlist_none = "${color:white}" 31 | hotlist_private = "${color:cyan}" 32 | hotlist_separator = "${color:default}," 33 | indent = " " 34 | lag = " ${color:green}[${color:brown}${lag}${color:green}]" 35 | nick_prefix = "${color_nick_prefix}${nick_prefix}" 36 | number = "${color:green}${number}${if:${number_displayed}?.: }" 37 | 38 | -------------------------------------------------------------------------------- /weechat/.weechat/charset.conf: -------------------------------------------------------------------------------- 1 | # 2 | # charset.conf -- weechat v1.0.1 3 | # 4 | 5 | [default] 6 | decode = "iso-8859-1" 7 | encode = "" 8 | 9 | [decode] 10 | 11 | [encode] 12 | -------------------------------------------------------------------------------- /weechat/.weechat/exec.conf: -------------------------------------------------------------------------------- 1 | # 2 | # exec.conf -- weechat v1.0.1 3 | # 4 | 5 | [command] 6 | default_options = "" 7 | purge_delay = 0 8 | 9 | [color] 10 | flag_finished = lightred 11 | flag_running = lightgreen 12 | -------------------------------------------------------------------------------- /weechat/.weechat/irc.conf: -------------------------------------------------------------------------------- 1 | # 2 | # irc.conf -- weechat v1.0.1 3 | # 4 | 5 | [look] 6 | buffer_switch_autojoin = on 7 | buffer_switch_join = on 8 | color_nicks_in_names = off 9 | color_nicks_in_nicklist = on 10 | color_nicks_in_server_messages = on 11 | color_pv_nick_like_channel = on 12 | ctcp_time_format = "%a, %d %b %Y %T %z" 13 | display_away = local 14 | display_ctcp_blocked = on 15 | display_ctcp_reply = on 16 | display_ctcp_unknown = on 17 | display_host_join = on 18 | display_host_join_local = on 19 | display_host_quit = on 20 | display_join_message = "329,332,333,366" 21 | display_old_topic = on 22 | display_pv_away_once = on 23 | display_pv_back = on 24 | highlight_channel = "$nick" 25 | highlight_pv = "$nick" 26 | highlight_server = "$nick" 27 | highlight_tags_restrict = "irc_privmsg,irc_notice" 28 | item_away_message = on 29 | item_channel_modes_hide_args = "k" 30 | item_display_server = buffer_plugin 31 | item_nick_modes = on 32 | item_nick_prefix = on 33 | join_auto_add_chantype = off 34 | msgbuffer_fallback = current 35 | new_channel_position = none 36 | new_pv_position = none 37 | nick_color_force = "" 38 | nick_color_hash = sum 39 | nick_color_stop_chars = "_|[" 40 | nick_completion_smart = speakers 41 | nick_mode = prefix 42 | nick_mode_empty = off 43 | nicks_hide_password = "nickserv" 44 | notice_as_pv = auto 45 | notice_welcome_redirect = on 46 | notice_welcome_tags = "" 47 | notify_tags_ison = "notify_message" 48 | notify_tags_whois = "notify_message" 49 | part_closes_buffer = off 50 | pv_buffer = independent 51 | pv_tags = "notify_private" 52 | raw_messages = 256 53 | server_buffer = merge_with_core 54 | smart_filter = on 55 | smart_filter_delay = 5 56 | smart_filter_join = on 57 | smart_filter_join_unmask = 30 58 | smart_filter_mode = "+" 59 | smart_filter_nick = on 60 | smart_filter_quit = on 61 | topic_strip_colors = off 62 | 63 | [color] 64 | input_nick = lightcyan 65 | item_away = 130 66 | item_channel_modes = lightcyan 67 | item_lag_counting = default 68 | item_lag_finished = 130 69 | item_nick_modes = lightgreen 70 | message_join = green 71 | message_quit = red 72 | mirc_remap = "1,-1:darkgray" 73 | nick_prefixes = "q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;v:yellow;*:lightblue" 74 | notice = green 75 | reason_quit = default 76 | topic_new = white 77 | topic_old = default 78 | 79 | [network] 80 | autoreconnect_delay_growing = 2 81 | autoreconnect_delay_max = 600 82 | ban_mask_default = "*!$ident@$host" 83 | colors_receive = on 84 | colors_send = on 85 | lag_check = 60 86 | lag_max = 1800 87 | lag_min_show = 500 88 | lag_reconnect = 0 89 | lag_refresh_interval = 1 90 | notify_check_ison = 1 91 | notify_check_whois = 5 92 | send_unknown_commands = off 93 | whois_double_nick = off 94 | 95 | [msgbuffer] 96 | 97 | [ctcp] 98 | 99 | [ignore] 100 | 101 | [server_default] 102 | addresses = "" 103 | anti_flood_prio_high = 2 104 | anti_flood_prio_low = 2 105 | autoconnect = off 106 | autojoin = "" 107 | autoreconnect = on 108 | autoreconnect_delay = 10 109 | autorejoin = off 110 | autorejoin_delay = 30 111 | away_check = 0 112 | away_check_max_nicks = 25 113 | capabilities = "" 114 | command = "" 115 | command_delay = 0 116 | connection_timeout = 60 117 | default_msg_kick = "" 118 | default_msg_part = "WeeChat %v" 119 | default_msg_quit = "WeeChat %v" 120 | ipv6 = on 121 | local_hostname = "" 122 | notify = "" 123 | password = "" 124 | proxy = "" 125 | realname = "" 126 | sasl_mechanism = plain 127 | sasl_password = "" 128 | sasl_timeout = 15 129 | sasl_username = "" 130 | ssl = off 131 | ssl_cert = "" 132 | ssl_dhkey_size = 2048 133 | ssl_fingerprint = "" 134 | ssl_priorities = "NORMAL" 135 | ssl_verify = on 136 | username = "${env:USER}" 137 | 138 | [server] 139 | hashbang.addresses = "irc.hashbang.sh/6697" 140 | hashbang.proxy 141 | hashbang.ipv6 142 | hashbang.ssl = on 143 | hashbang.ssl_cert 144 | hashbang.ssl_priorities 145 | hashbang.ssl_dhkey_size 146 | hashbang.ssl_fingerprint 147 | hashbang.ssl_verify 148 | hashbang.password 149 | hashbang.capabilities 150 | hashbang.sasl_mechanism 151 | hashbang.sasl_username 152 | hashbang.sasl_password 153 | hashbang.sasl_timeout 154 | hashbang.autoconnect = on 155 | hashbang.autoreconnect 156 | hashbang.autoreconnect_delay 157 | hashbang.nicks 158 | hashbang.nicks_alternate 159 | hashbang.realname 160 | hashbang.local_hostname 161 | hashbang.command 162 | hashbang.command_delay 163 | hashbang.autojoin = "#!" 164 | hashbang.autorejoin 165 | hashbang.autorejoin_delay 166 | hashbang.connection_timeout 167 | hashbang.anti_flood_prio_high 168 | hashbang.anti_flood_prio_low 169 | hashbang.away_check 170 | hashbang.away_check_max_nicks 171 | hashbang.default_msg_kick 172 | hashbang.default_msg_part 173 | hashbang.default_msg_quit 174 | hashbang.notify 175 | -------------------------------------------------------------------------------- /weechat/.weechat/iset.conf: -------------------------------------------------------------------------------- 1 | # 2 | # iset.conf -- weechat v1.0.1 3 | # 4 | 5 | [color] 6 | bg_selected = 235 7 | help_default_value = green 8 | help_option_name = white 9 | help_text = lightcyan 10 | option = default 11 | option_selected = white 12 | type = brown 13 | type_selected = 130 14 | value = cyan 15 | value_diff = magenta 16 | value_diff_selected = lightmagenta 17 | value_selected = lightcyan 18 | value_undef = green 19 | value_undef_selected = lightgreen 20 | 21 | [help] 22 | show_help_bar = on 23 | show_help_extra_info = on 24 | show_plugin_description = off 25 | 26 | [look] 27 | scroll_horiz = 10 28 | show_current_line = on 29 | use_mute = off 30 | value_search_char = "=" 31 | -------------------------------------------------------------------------------- /weechat/.weechat/logger.conf: -------------------------------------------------------------------------------- 1 | # 2 | # logger.conf -- weechat v1.0.1 3 | # 4 | 5 | [look] 6 | backlog = 20 7 | 8 | [color] 9 | backlog_end = default 10 | backlog_line = default 11 | 12 | [file] 13 | auto_log = off 14 | flush_delay = 120 15 | info_lines = off 16 | mask = "$plugin.$name.weechatlog" 17 | name_lower_case = on 18 | nick_prefix = "" 19 | nick_suffix = "" 20 | path = "%h/logs/" 21 | replacement_char = "_" 22 | time_format = "%Y-%m-%d %H:%M:%S" 23 | 24 | [level] 25 | 26 | [mask] 27 | -------------------------------------------------------------------------------- /weechat/.weechat/perl/autoload/highmon.pl: -------------------------------------------------------------------------------- 1 | ../highmon.pl -------------------------------------------------------------------------------- /weechat/.weechat/perl/autoload/iset.pl: -------------------------------------------------------------------------------- 1 | ../iset.pl -------------------------------------------------------------------------------- /weechat/.weechat/perl/highmon.pl: -------------------------------------------------------------------------------- 1 | # 2 | # highmon.pl - Highlight Monitoring for weechat 0.3.0 3 | # Version 2.5 4 | # 5 | # Add 'Highlight Monitor' buffer/bar to log all highlights in one spot 6 | # 7 | # Usage: 8 | # /highmon [help] | [monitor [channel [server]]] | [clean default|orphan|all] | clearbar 9 | # Command wrapper for highmon commands 10 | # 11 | # /highmon clean default|orphan|all will clean the config section of default 'on' entries, 12 | # channels you are no longer joined, or both 13 | # 14 | # /highmon clearbar will clear the contents of highmon's bar output 15 | # 16 | # /highmon monitor [channel] [server] is used to toggle a highlight monitoring on and off, this 17 | # can be used in the channel buffer for the channel you wish to toggle, or be given 18 | # with arguments e.g. /highmon monitor #weechat freenode 19 | # 20 | # /set plugins.var.perl.highmon.alignment 21 | # The config setting "alignment" can be changed to; 22 | # "channel", "schannel", "nchannel", "channel,nick", "schannel,nick", "nchannel,nick" 23 | # to change how the monitor appears 24 | # The 'channel' value will show: "#weechat" 25 | # The 'schannel' value will show: "6" 26 | # The 'nchannel' value will show: "6:#weechat" 27 | # 28 | # /set plugins.var.perl.highmon.short_names 29 | # Setting this to 'on' will trim the network name from highmon, ala buffers.pl 30 | # 31 | # /set plugins.var.perl.highmon.merge_private 32 | # Setting this to 'on' will merge private messages to highmon's display 33 | # 34 | # /set plugins.var.perl.highmon.color_buf 35 | # This turns colored buffer names on or off, you can also set a single fixed color by using a weechat color name. 36 | # This *must* be a valid color name, or weechat will likely do unexpected things :) 37 | # 38 | # /set plugins.var.perl.highmon.hotlist_show 39 | # Setting this to 'on' will let the highmon buffer appear in hotlists 40 | # (status bar/buffer.pl) 41 | # 42 | # /set plugins.var.perl.highmon.away_only 43 | # Setting this to 'on' will only put messages in the highmon buffer when 44 | # you set your status to away 45 | # 46 | # /set plugins.var.perl.highmon.logging 47 | # Toggles logging status for highmon buffer (default: off) 48 | # 49 | # /set plugins.var.perl.highmon.output 50 | # Changes where output method of highmon; takes either "bar" or "buffer" (default; buffer) 51 | # /set plugins.var.perl.highmon.bar_lines 52 | # Changes the amount of lines the output bar will hold. 53 | # (Only appears once output has been set to bar, defaults to 10) 54 | # /set plugins.var.perl.highmon.bar_scrolldown 55 | # Toggles the bar scrolling at the bottom when new highlights are received 56 | # (Only appears once output has been set to bar, defaults to off) 57 | # 58 | # /set plugins.var.perl.highmon.nick_prefix 59 | # /set plugins.var.perl.highmon.nick_suffix 60 | # Sets the prefix and suffix chars in the highmon buffer 61 | # (Defaults to <> if nothing set, and blank if there is) 62 | # 63 | # servername.#channel 64 | # servername is the internal name for the server (set when you use /server add) 65 | # #channel is the channel name, (where # is whatever channel type that channel happens to be) 66 | # 67 | # Optional, set up tweaks; Hide the status and input lines on highmon 68 | # 69 | # /set weechat.bar.status.conditions "${window.buffer.full_name} != perl.highmon" 70 | # /set weechat.bar.input.conditions "${window.buffer.full_name} != perl.highmon" 71 | # 72 | 73 | # Bugs and feature requests at: https://github.com/KenjiE20/highmon 74 | 75 | # History: 76 | # 2014-08-16, KenjiE20 : 77 | # v2.5: -add: clearbar command to clear bar output 78 | # -add: firstrun output prompt to check the help text for set up hints as they were being missed 79 | # and update hint for conditions to use eval 80 | # -change: Make all outputs use the date callback for more accurate timestamps (thanks Germainz) 81 | # 2013-12-04, KenjiE20 : 82 | # v2.4: -add: Support for eval style colour codes in time format used for bar output 83 | # 2013-10-22, KenjiE20 : 84 | # v2.3.3.2: -fix: Typo in fix command 85 | # 2013-10-10, KenjiE20 : 86 | # v2.3.3.1: -fix: Typo in closed buffer warning 87 | # 2013-10-07, KenjiE20 : 88 | # v2.3.3: -add: Warning and fixer for accidental buffer closes 89 | # 2013-01-15, KenjiE20 : 90 | # v2.3.2: -fix: Let bar output use the string set in weechat's config option 91 | # -add: github info 92 | # 2012-04-15, KenjiE20 : 93 | # v2.3.1: -fix: Colour tags in bar timestamp string 94 | # 2012-02-28, KenjiE20 : 95 | # v2.3: -feature: Added merge_private option to display private messages (default: off) 96 | # -fix: Channel name colours now show correctly when set to on 97 | # 2011-08-07, Sitaktif : 98 | # v2.2.1: -feature: Add "bar_scrolldown" option to have the bar display the latest hl at anytime 99 | # -fix: Set up bar-specific config at startup if 'output' is already configured as 'bar' 100 | # 2010-12-22, KenjiE20 : 101 | # v2.2: -change: Use API instead of config to find channel colours, ready for 0.3.4 and 256 colours 102 | # 2010-12-13, idl0r & KenjiE20 : 103 | # v2.1.3: -fix: perl errors caused by bar line counter 104 | # -fix: Add command list to inbuilt help 105 | # 2010-09-30, KenjiE20 : 106 | # v2.1.2: -fix: logging config was not correctly toggling back on (thanks to sleo for noticing) 107 | # -version sync w/ chanmon 108 | # 2010-08-27, KenjiE20 : 109 | # v2.1: -feature: Add 'nchannel' option to alignment to display buffer and name 110 | # 2010-04-25, KenjiE20 : 111 | # v2.0: Release as version 2.0 112 | # 2010-04-24, KenjiE20 : 113 | # v1.9: Rewrite for v2.0 114 | # Bring feature set in line with chanmon 2.0 115 | # -code change: Made more subs to shrink the code down in places 116 | # -fix: Stop highmon attempting to double load/hook 117 | # -fix: Add version dependant check for away status 118 | # 2010-01-25, KenjiE20 : 119 | # v1.7: -fixture: Let highmon be aware of nick_prefix/suffix 120 | # and allow custom prefix/suffix for chanmon buffer 121 | # (Defaults to <> if nothing set, and blank if there is) 122 | # (Thanks to m4v for these) 123 | # 2009-09-07, KenjiE20 : 124 | # v1.6: -feature: colored buffer names 125 | # -change: version sync with chanmon 126 | # 2009-09-05, KenjiE20 : 127 | # v1.2: -fix: disable buffer highlight 128 | # 2009-09-02, KenjiE20 : 129 | # v.1.1.1 -change: Stop unsightly text block on '/help' 130 | # 2009-08-10, KenjiE20 : 131 | # v1.1: In-client help added 132 | # 2009-08-02, KenjiE20 : 133 | # v1.0: Initial Public Release 134 | 135 | # Copyright (c) 2009 by KenjiE20 136 | # 137 | # This program is free software; you can redistribute it and/or modify 138 | # it under the terms of the GNU General Public License as published by 139 | # the Free Software Foundation; either version 3 of the License, or 140 | # (at your option) any later version. 141 | # 142 | # This program is distributed in the hope that it will be useful, 143 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 144 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 145 | # GNU General Public License for more details. 146 | # 147 | # You should have received a copy of the GNU General Public License 148 | # along with this program. If not, see . 149 | # 150 | 151 | @bar_lines = (); 152 | @bar_lines_time = (); 153 | # Replicate info earlier for in-client help 154 | 155 | $highmonhelp = weechat::color("bold")."/highmon [help] | [monitor [channel [server]]] | [clean default|orphan|all] | clearbar".weechat::color("-bold")." 156 | Command wrapper for highmon commands 157 | 158 | ".weechat::color("bold")."/highmon clean default|orphan|all".weechat::color("-bold")." will clean the config section of default 'on' entries, channels you are no longer joined, or both 159 | 160 | ".weechat::color("bold")."/highmon clearbar".weechat::color("-bold")." will clear the contents of highmon's bar output 161 | 162 | ".weechat::color("bold")."/highmon monitor [channel] [server]".weechat::color("-bold")." is used to toggle a highlight monitoring on and off, this can be used in the channel buffer for the channel you wish to toggle, or be given with arguments e.g. /highmon monitor #weechat freenode 163 | 164 | ".weechat::color("bold")."/set plugins.var.perl.highmon.alignment".weechat::color("-bold")." 165 | The config setting \"alignment\" can be changed to; 166 | \"channel\", \"schannel\", \"nchannel\", \"channel,nick\", \"schannel,nick\", \"nchannel,nick\" 167 | to change how the monitor appears 168 | The 'channel' value will show: \"#weechat\" 169 | The 'schannel' value will show: \"6\" 170 | The 'nchannel' value will show: \"6:#weechat\" 171 | 172 | ".weechat::color("bold")."/set plugins.var.perl.highmon.short_names".weechat::color("-bold")." 173 | Setting this to 'on' will trim the network name from highmon, ala buffers.pl 174 | 175 | ".weechat::color("bold")."/set plugins.var.perl.highmon.merge_private".weechat::color("-bold")." 176 | Setting this to 'on' will merge private messages to highmon's display 177 | 178 | ".weechat::color("bold")."/set plugins.var.perl.highmon.color_buf".weechat::color("-bold")." 179 | This turns colored buffer names on or off, you can also set a single fixed color by using a weechat color name. 180 | This ".weechat::color("bold")."must".weechat::color("-bold")." be a valid color name, or weechat will likely do unexpected things :) 181 | 182 | ".weechat::color("bold")."/set plugins.var.perl.highmon.hotlist_show".weechat::color("-bold")." 183 | Setting this to 'on' will let the highmon buffer appear in hotlists (status bar/buffer.pl) 184 | 185 | ".weechat::color("bold")."/set plugins.var.perl.highmon.away_only".weechat::color("-bold")." 186 | Setting this to 'on' will only put messages in the highmon buffer when you set your status to away 187 | 188 | ".weechat::color("bold")."/set plugins.var.perl.highmon.logging".weechat::color("-bold")." 189 | Toggles logging status for highmon buffer (default: off) 190 | 191 | ".weechat::color("bold")."/set plugins.var.perl.highmon.output".weechat::color("-bold")." 192 | Changes where output method of highmon; takes either \"bar\" or \"buffer\" (default; buffer) 193 | ".weechat::color("bold")."/set plugins.var.perl.highmon.bar_lines".weechat::color("-bold")." 194 | Changes the amount of lines the output bar will hold. 195 | (Only appears once output has been set to bar, defaults to 10) 196 | ".weechat::color("bold")."/set plugins.var.perl.highmon.bar_scrolldown".weechat::color("-bold")." 197 | Toggles the bar scrolling at the bottom when new highlights are received 198 | (Only appears once output has been set to bar, defaults to off) 199 | 200 | ".weechat::color("bold")."/set plugins.var.perl.highmon.nick_prefix".weechat::color("-bold")." 201 | ".weechat::color("bold")."/set plugins.var.perl.highmon.nick_suffix".weechat::color("-bold")." 202 | Sets the prefix and suffix chars in the highmon buffer 203 | (Defaults to <> if nothing set, and blank if there is) 204 | 205 | ".weechat::color("bold")."servername.#channel".weechat::color("-bold")." 206 | servername is the internal name for the server (set when you use /server add) 207 | #channel is the channel name, (where # is whatever channel type that channel happens to be) 208 | 209 | ".weechat::color("bold")."Optional, set up tweaks;".weechat::color("-bold")." Hide the status and input lines on highmon 210 | 211 | ".weechat::color("bold")."/set weechat.bar.status.conditions \"\${window.buffer.full_name} != perl.highmon\"".weechat::color("-bold")." 212 | ".weechat::color("bold")."/set weechat.bar.input.conditions \"\${window.buffer.full_name} != perl.highmon\"".weechat::color("-bold"); 213 | # Print verbose help 214 | sub print_help 215 | { 216 | weechat::print("", "\t".weechat::color("bold")."Highmon Help".weechat::color("-bold")."\n\n"); 217 | weechat::print("", "\t".$highmonhelp); 218 | return weechat::WEECHAT_RC_OK; 219 | } 220 | 221 | # Bar item build 222 | sub highmon_bar_build 223 | { 224 | # Get max lines 225 | $max_lines = weechat::config_get_plugin("bar_lines"); 226 | $max_lines = $max_lines ? $max_lines : 10; 227 | $str = ''; 228 | $align_num = 0; 229 | $count = 0; 230 | # Keep lines within max 231 | while ($#bar_lines > $max_lines) 232 | { 233 | shift(@bar_lines); 234 | shift(@bar_lines_time); 235 | } 236 | # So long as we have some lines, build a string 237 | if (@bar_lines) 238 | { 239 | # Build loop 240 | $sep = " ".weechat::config_string(weechat::config_get("weechat.look.prefix_suffix"))." "; 241 | foreach(@bar_lines) 242 | { 243 | # Find max align needed 244 | $prefix_num = (index(weechat::string_remove_color($_, ""), $sep)); 245 | $align_num = $prefix_num if ($prefix_num > $align_num); 246 | } 247 | foreach(@bar_lines) 248 | { 249 | # Get align for this line 250 | $prefix_num = (index(weechat::string_remove_color($_, ""), $sep)); 251 | 252 | # Make string 253 | $str = $str.$bar_lines_time[$count]." ".(" " x ($align_num - $prefix_num)).$_."\n"; 254 | # Increment count for sync with time list 255 | $count++; 256 | } 257 | } 258 | return $str; 259 | } 260 | 261 | # Make a new bar 262 | sub highmon_bar_open 263 | { 264 | # Make the bar item 265 | weechat::bar_item_new("highmon", "highmon_bar_build", ""); 266 | 267 | $highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "on", "highmon"); 268 | 269 | return weechat::WEECHAT_RC_OK; 270 | } 271 | # Close bar 272 | sub highmon_bar_close 273 | { 274 | # Find if bar exists 275 | $highmon_bar = weechat::bar_search("highmon"); 276 | # If is does, close it 277 | if ($highmon_bar ne "") 278 | { 279 | weechat::bar_remove($highmon_bar); 280 | } 281 | 282 | # Find if bar item exists 283 | $highmon_bar_item = weechat::bar_item_search("highmon_bar"); 284 | # If is does, close it 285 | if ($highmon_bar_item ne "") 286 | { 287 | weechat::bar_remove($highmon_bar_item); 288 | } 289 | 290 | @bar_lines = (); 291 | return weechat::WEECHAT_RC_OK; 292 | } 293 | 294 | # Make a new buffer 295 | sub highmon_buffer_open 296 | { 297 | # Search for pre-existing buffer 298 | $highmon_buffer = weechat::buffer_search("perl", "highmon"); 299 | 300 | # Make a new buffer 301 | if ($highmon_buffer eq "") 302 | { 303 | $highmon_buffer = weechat::buffer_new("highmon", "highmon_buffer_input", "", "highmon_buffer_close", ""); 304 | } 305 | 306 | # Turn off notify, highlights 307 | if ($highmon_buffer ne "") 308 | { 309 | if (weechat::config_get_plugin("hotlist_show" eq "off")) 310 | { 311 | weechat::buffer_set($highmon_buffer, "notify", "0"); 312 | } 313 | weechat::buffer_set($highmon_buffer, "highlight_words", "-"); 314 | weechat::buffer_set($highmon_buffer, "title", "Highlight Monitor"); 315 | # Set no_log 316 | if (weechat::config_get_plugin("logging") eq "off") 317 | { 318 | weechat::buffer_set($highmon_buffer, "localvar_set_no_log", "1"); 319 | } 320 | } 321 | return weechat::WEECHAT_RC_OK; 322 | } 323 | # Buffer input has no action 324 | sub highmon_buffer_input 325 | { 326 | return weechat::WEECHAT_RC_OK; 327 | } 328 | # Close up 329 | sub highmon_buffer_close 330 | { 331 | $highmon_buffer = ""; 332 | # If user hasn't changed output style warn user 333 | if (weechat::config_get_plugin("output") eq "buffer") 334 | { 335 | weechat::print("", "\tHighmon buffer has been closed but output is still set to buffer, unusual results may occur. To recreate the buffer use ".weechat::color("bold")."/highmon fix".weechat::color("-bold")); 336 | } 337 | return weechat::WEECHAT_RC_OK; 338 | } 339 | 340 | # Highmon command wrapper 341 | sub highmon_command_cb 342 | { 343 | $data = $_[0]; 344 | $buffer = $_[1]; 345 | $args = $_[2]; 346 | my $cmd = ''; 347 | my $arg = ''; 348 | 349 | if ($args ne "") 350 | { 351 | # Split argument up 352 | @arg_array = split(/ /,$args); 353 | # Take first as command 354 | $cmd = shift(@arg_array); 355 | # Rebuild string to pass to subs 356 | if (@arg_array) 357 | { 358 | $arg = join(" ", @arg_array); 359 | } 360 | } 361 | 362 | # Help command 363 | if ($cmd eq "" || $cmd eq "help") 364 | { 365 | print_help(); 366 | } 367 | # /monitor command 368 | elsif ($cmd eq "monitor") 369 | { 370 | highmon_toggle($data, $buffer, $arg); 371 | } 372 | # /highclean command 373 | elsif ($cmd eq "clean") 374 | { 375 | highmon_config_clean($data, $buffer, $arg); 376 | } 377 | # clearbar command 378 | elsif ($cmd eq "clearbar") 379 | { 380 | if (weechat::config_get_plugin("output") eq "bar") 381 | { 382 | @bar_lines = (); 383 | weechat::bar_item_update("highmon"); 384 | } 385 | } 386 | # Fix closed buffer 387 | elsif ($cmd eq "fix") 388 | { 389 | if (weechat::config_get_plugin("output") eq "buffer" && $highmon_buffer eq "") 390 | { 391 | highmon_buffer_open(); 392 | } 393 | } 394 | return weechat::WEECHAT_RC_OK; 395 | } 396 | 397 | # Clean up config entries 398 | sub highmon_config_clean 399 | { 400 | $data = $_[0]; 401 | $buffer = $_[1]; 402 | $args = $_[2]; 403 | 404 | # Don't do anything if bad option given 405 | if ($args ne "default" && $args ne "orphan" && $args ne "all") 406 | { 407 | weechat::print("", "\thighmon.pl: Unknown option"); 408 | return weechat::WEECHAT_RC_OK; 409 | } 410 | 411 | @chans = (); 412 | # Load an infolist of highmon options 413 | $infolist = weechat::infolist_get("option", "", "*highmon*"); 414 | while (weechat::infolist_next($infolist)) 415 | { 416 | $name = weechat::infolist_string($infolist, "option_name"); 417 | $name =~ s/perl\.highmon\.(\w*)\.([#&\+!])(.*)/$1.$2$3/; 418 | if ($name =~ /^(.*)\.([#&\+!])(.*)$/) 419 | { 420 | $action = 0; 421 | # Clean up all 'on's 422 | if ($args eq "default" || $args eq "all") 423 | { 424 | # If value in config is "on" 425 | if (weechat::config_get_plugin($name) eq "on") 426 | { 427 | # Unset and if successful flag as changed 428 | $rc = weechat::config_unset_plugin($name); 429 | if ($rc eq weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED) 430 | { 431 | $action = 1; 432 | } 433 | } 434 | } 435 | # Clean non joined 436 | if ($args eq "orphan" || $args eq "all") 437 | { 438 | # If we can't find the buffer for this entry 439 | if (weechat::buffer_search("irc", $name) eq "") 440 | { 441 | # Unset and if successful flag as changed 442 | $rc = weechat::config_unset_plugin($name); 443 | if ($rc eq weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED) 444 | { 445 | $action = 1; 446 | } 447 | } 448 | } 449 | # Add changed entry names to list 450 | push (@chans, $name) if ($action); 451 | } 452 | } 453 | weechat::infolist_free($infolist); 454 | # If channels were cleaned from config 455 | if (@chans) 456 | { 457 | # If only one entry 458 | if (@chans == 1) 459 | { 460 | $str = "\thighmon.pl: Cleaned ".@chans." entry from the config:"; 461 | } 462 | else 463 | { 464 | $str = "\thighmon.pl: Cleaned ".@chans." entries from the config:"; 465 | } 466 | # Build a list of channels 467 | foreach(@chans) 468 | { 469 | $str = $str." ".$_; 470 | } 471 | # Print what happened 472 | weechat::print("",$str); 473 | } 474 | # Config seemed to be clean 475 | else 476 | { 477 | weechat::print("", "\thighmon.pl: No entries removed"); 478 | } 479 | return weechat::WEECHAT_RC_OK; 480 | } 481 | 482 | # Check config elements 483 | sub highmon_config_init 484 | { 485 | # First run default 486 | if (!(weechat::config_is_set_plugin ("first_run"))) 487 | { 488 | if (weechat::config_get_plugin("first_run") ne "true") 489 | { 490 | weechat::print("", "\tThis appears to be the first time highmon has been run. For help and common set up hints see /highmon help"); 491 | weechat::config_set_plugin("first_run", "true"); 492 | } 493 | } 494 | # Alignment default 495 | if (!(weechat::config_is_set_plugin ("alignment"))) 496 | { 497 | weechat::config_set_plugin("alignment", "channel"); 498 | } 499 | if (weechat::config_get_plugin("alignment") eq "") 500 | { 501 | weechat::config_set_plugin("alignment", "none"); 502 | } 503 | 504 | # Short name default 505 | if (!(weechat::config_is_set_plugin ("short_names"))) 506 | { 507 | weechat::config_set_plugin("short_names", "off"); 508 | } 509 | 510 | # Coloured names default 511 | if (!(weechat::config_is_set_plugin ("color_buf"))) 512 | { 513 | weechat::config_set_plugin("color_buf", "on"); 514 | } 515 | 516 | # Hotlist show default 517 | if (!(weechat::config_is_set_plugin ("hotlist_show"))) 518 | { 519 | weechat::config_set_plugin("hotlist_show", "off"); 520 | } 521 | 522 | # Away only default 523 | if (!(weechat::config_is_set_plugin ("away_only"))) 524 | { 525 | weechat::config_set_plugin("away_only", "off"); 526 | } 527 | 528 | # highmon log default 529 | if (!(weechat::config_is_set_plugin ("logging"))) 530 | { 531 | weechat::config_set_plugin("logging", "off"); 532 | } 533 | 534 | # Output default 535 | if (!(weechat::config_is_set_plugin ("output"))) 536 | { 537 | weechat::config_set_plugin("output", "buffer"); 538 | } 539 | 540 | # Private message merging 541 | if (!(weechat::config_is_set_plugin ("merge_private"))) 542 | { 543 | weechat::config_set_plugin("merge_private", "off"); 544 | } 545 | 546 | # Set bar config in case output was set to "bar" before even changing the setting 547 | if (weechat::config_get_plugin("output") eq "bar") 548 | { 549 | # Output bar lines default 550 | if (!(weechat::config_is_set_plugin ("bar_lines"))) 551 | { 552 | weechat::config_set_plugin("bar_lines", "10"); 553 | } 554 | if (!(weechat::config_is_set_plugin ("bar_scrolldown"))) 555 | { 556 | weechat::config_set_plugin("bar_scrolldown", "off"); 557 | } 558 | } 559 | 560 | # Check for exisiting prefix/suffix chars, and setup accordingly 561 | $prefix = weechat::config_get("irc.look.nick_prefix"); 562 | $prefix = weechat::config_string($prefix); 563 | $suffix = weechat::config_get("irc.look.nick_suffix"); 564 | $suffix = weechat::config_string($suffix); 565 | 566 | if (!(weechat::config_is_set_plugin("nick_prefix"))) 567 | { 568 | if ($prefix eq "" && $suffix eq "") 569 | { 570 | weechat::config_set_plugin("nick_prefix", "<"); 571 | } 572 | else 573 | { 574 | weechat::config_set_plugin("nick_prefix", ""); 575 | } 576 | } 577 | 578 | if (!(weechat::config_is_set_plugin("nick_suffix"))) 579 | { 580 | if ($prefix eq "" && $suffix eq "") 581 | { 582 | weechat::config_set_plugin("nick_suffix", ">"); 583 | } 584 | else 585 | { 586 | weechat::config_set_plugin("nick_suffix", ""); 587 | } 588 | } 589 | } 590 | 591 | # Get config updates 592 | sub highmon_config_cb 593 | { 594 | $point = $_[0]; 595 | $name = $_[1]; 596 | $value = $_[2]; 597 | 598 | $name =~ s/^plugins\.var\.perl\.highmon\.//; 599 | 600 | # Set logging on buffer 601 | if ($name eq "logging") 602 | { 603 | # Search for pre-existing buffer 604 | $highmon_buffer = weechat::buffer_search("perl", "highmon"); 605 | if ($value eq "off") 606 | { 607 | weechat::buffer_set($highmon_buffer, "localvar_set_no_log", "1"); 608 | } 609 | else 610 | { 611 | weechat::buffer_set($highmon_buffer, "localvar_del_no_log", ""); 612 | } 613 | } 614 | # Output changer 615 | elsif ($name eq "output") 616 | { 617 | if ($value eq "bar") 618 | { 619 | # Search for pre-existing buffer 620 | $highmon_buffer = weechat::buffer_search("perl", "highmon"); 621 | # Close if it exists 622 | if ($highmon_buffer ne "") 623 | { 624 | weechat::buffer_close($highmon_buffer) 625 | } 626 | 627 | # Output bar lines default 628 | if (!(weechat::config_is_set_plugin ("bar_lines"))) 629 | { 630 | weechat::config_set_plugin("bar_lines", "10"); 631 | } 632 | if (!(weechat::config_is_set_plugin ("bar_scrolldown"))) 633 | { 634 | weechat::config_set_plugin("bar_scrolldown", "off"); 635 | } 636 | # Make a bar if doesn't exist 637 | highmon_bar_open(); 638 | } 639 | elsif ($value eq "buffer") 640 | { 641 | # If a bar exists, close it 642 | highmon_bar_close(); 643 | # Open buffer 644 | highmon_buffer_open(); 645 | } 646 | 647 | } 648 | # Change if hotlist config changes 649 | elsif ($name eq "hotlist_show") 650 | { 651 | # Search for pre-existing buffer 652 | $highmon_buffer = weechat::buffer_search("perl", "highmon"); 653 | if ($value eq "off" && $highmon_buffer) 654 | { 655 | weechat::buffer_set($highmon_buffer, "notify", "0"); 656 | } 657 | elsif ($value ne "off" && $highmon_buffer) 658 | { 659 | weechat::buffer_set($highmon_buffer, "notify", "3"); 660 | } 661 | } 662 | elsif ($name eq "weechat.look.prefix_suffix") 663 | { 664 | if (weechat::config_get_plugin("output") eq "bar") 665 | { 666 | @bar_lines = (); 667 | weechat::print("", "\thighmon: weechat.look.prefix_suffix changed, clearing highmon bar"); 668 | weechat::bar_item_update("highmon"); 669 | } 670 | } 671 | return weechat::WEECHAT_RC_OK; 672 | } 673 | 674 | # Set up weechat hooks / commands 675 | sub highmon_hook 676 | { 677 | weechat::hook_print("", "", "", 0, "highmon_new_message", ""); 678 | weechat::hook_command("highclean", "Highmon config clean up", "default|orphan|all", " default: Cleans all config entries with the default \"on\" value\n orphan: Cleans all config entries for channels you aren't currently joined\n all: Does both defaults and orphan", "default|orphan|all", "highmon_config_clean", ""); 679 | 680 | weechat::hook_command("highmon", "Highmon help", "[help] | [monitor [channel [server]]] | [clean default|orphan|all] | clearbar", " help: Print help on config options for highmon\n monitor: Toggles monitoring for a channel\n clean: Highmon config clean up (/highclean)\nclearbar: Clear Highmon bar", "help || monitor %(irc_channels) %(irc_servers) || clean default|orphan|all || clearbar", "highmon_command_cb", ""); 681 | 682 | weechat::hook_config("plugins.var.perl.highmon.*", "highmon_config_cb", ""); 683 | weechat::hook_config("weechat.look.prefix_suffix", "highmon_config_cb", ""); 684 | } 685 | 686 | # Main body, Callback for hook_print 687 | sub highmon_new_message 688 | { 689 | my $net = ""; 690 | my $chan = ""; 691 | my $nick = ""; 692 | my $outstr = ""; 693 | my $window_displayed = ""; 694 | my $dyncheck = "0"; 695 | 696 | # DEBUG point 697 | # $string = "\t"."0: ".$_[0]." 1: ".$_[1]." 2: ".$_[2]." 3: ".$_[3]." 4: ".$_[4]." 5: ".$_[5]." 6: ".$_[6]." 7: ".$_[7]; 698 | # weechat::print("", "\t".$string); 699 | 700 | $cb_datap = $_[0]; 701 | $cb_bufferp = $_[1]; 702 | $cb_date = $_[2]; 703 | $cb_tags = $_[3]; 704 | $cb_disp = $_[4]; 705 | $cb_high = $_[5]; 706 | $cb_prefix = $_[6]; 707 | $cb_msg = $_[7]; 708 | 709 | # Only work on highlighted messages or private message when enabled 710 | if ($cb_high == "1" || (weechat::config_get_plugin("merge_private") eq "on" && $cb_tags =~ /notify_private/)) 711 | { 712 | # Pre bug #29618 (0.3.3) away detect 713 | if (weechat::info_get("version_number", "") <= 197120) 714 | { 715 | $away = ''; 716 | # Get infolist for this server 717 | $infolist = weechat::infolist_get("irc_server", "", weechat::buffer_get_string($cb_bufferp, "localvar_server")); 718 | while (weechat::infolist_next($infolist)) 719 | { 720 | # Get away message is is_away is on 721 | $away = weechat::infolist_string($infolist, "away_message") if (weechat::infolist_integer($infolist, "is_away")); 722 | } 723 | weechat::infolist_free($infolist); 724 | } 725 | # Post bug #29618 fix 726 | else 727 | { 728 | $away = weechat::buffer_get_string($cb_bufferp, "localvar_away"); 729 | } 730 | if (weechat::config_get_plugin("away_only") ne "on" || ($away ne "")) 731 | { 732 | # Check buffer name is an IRC channel 733 | $bufname = weechat::buffer_get_string($cb_bufferp, 'name'); 734 | if ($bufname =~ /(.*)\.([#&\+!])(.*)/) 735 | { 736 | # Are we running on this channel 737 | if (weechat::config_get_plugin($bufname) ne "off" && $cb_disp eq "1") 738 | { 739 | # Format nick 740 | # Line isn't action or topic notify 741 | if (!($cb_tags =~ /irc_action/) && !($cb_tags =~ /irc_topic/)) 742 | { 743 | # Strip nick colour 744 | $uncolnick = weechat::string_remove_color($cb_prefix, ""); 745 | # Format nick 746 | $nick = " ".weechat::config_get_plugin("nick_prefix").weechat::color("chat_highlight").$uncolnick.weechat::color("reset").weechat::config_get_plugin("nick_suffix"); 747 | } 748 | # Topic line 749 | elsif ($cb_tags =~ /irc_topic/) 750 | { 751 | $nick = " ".$cb_prefix.weechat::color("reset"); 752 | } 753 | # Action line 754 | else 755 | { 756 | $uncolnick = weechat::string_remove_color($cb_prefix, ""); 757 | $nick = weechat::color("chat_highlight").$uncolnick.weechat::color("reset"); 758 | } 759 | # Send to output 760 | highmon_print ($cb_msg, $cb_bufferp, $nick, $cb_date, $cb_tags); 761 | } 762 | } 763 | # Or is private message 764 | elsif (weechat::config_get_plugin("merge_private") eq "on" && $cb_tags =~ /notify_private/) 765 | { 766 | # Strip nick colour 767 | $uncolnick = weechat::buffer_get_string($cb_bufferp, 'short_name'); 768 | # Format nick 769 | $nick = " ".weechat::config_get_plugin("nick_prefix").weechat::color("chat_highlight").$uncolnick.weechat::color("reset").weechat::config_get_plugin("nick_suffix"); 770 | #Send to output 771 | highmon_print ($cb_msg, $cb_bufferp, $nick, $cb_date, $cb_tags); 772 | } 773 | } 774 | } 775 | return weechat::WEECHAT_RC_OK; 776 | } 777 | 778 | # Output formatter and printer takes (msg bufpointer nick) 779 | sub highmon_print 780 | { 781 | $cb_msg = $_[0]; 782 | my $cb_bufferp = $_[1] if ($_[1]); 783 | my $nick = $_[2] if ($_[2]); 784 | my $cb_date = $_[3] if ($_[3]); 785 | my $cb_tags = $_[4] if ($_[4]); 786 | 787 | #Normal channel message 788 | if ($cb_bufferp && $nick) 789 | { 790 | # Format buffer name 791 | $bufname = format_buffer_name($cb_bufferp); 792 | 793 | # If alignment is #channel | nick msg 794 | if (weechat::config_get_plugin("alignment") eq "channel") 795 | { 796 | $nick =~ s/\s(.*)/$1/; 797 | # Build string 798 | $outstr = $bufname."\t".$nick." ".$cb_msg; 799 | } 800 | # or if it is channel number | nick msg 801 | elsif (weechat::config_get_plugin("alignment") eq "schannel") 802 | { 803 | $nick =~ s/\s(.*)/$1/; 804 | # Use channel number instead 805 | $bufname = weechat::color("chat_prefix_buffer").weechat::buffer_get_integer($cb_bufferp, 'number').weechat::color("reset"); 806 | # Build string 807 | $outstr = $bufname."\t".$nick." ".$cb_msg; 808 | } 809 | # or if it is number:#channel | nick msg 810 | elsif (weechat::config_get_plugin("alignment") eq "nchannel") 811 | { 812 | $nick =~ s/\s(.*)/$1/; 813 | # Place channel number in front of formatted name 814 | $bufname = weechat::color("chat_prefix_buffer").weechat::buffer_get_integer($cb_bufferp, 'number').":".weechat::color("reset").$bufname; 815 | # Build string 816 | $outstr = $bufname."\t".$nick." ".$cb_msg; 817 | } 818 | # or if it is #channel nick | msg 819 | elsif (weechat::config_get_plugin("alignment") eq "channel,nick") 820 | { 821 | # Build string 822 | $outstr = $bufname.":".$nick."\t".$cb_msg; 823 | } 824 | # or if it is channel number nick | msg 825 | elsif (weechat::config_get_plugin("alignment") eq "schannel,nick") 826 | { 827 | # Use channel number instead 828 | $bufname = weechat::color("chat_prefix_buffer").weechat::buffer_get_integer($cb_bufferp, 'number').weechat::color("reset"); 829 | # Build string 830 | $outstr = $bufname.":".$nick."\t".$cb_msg; 831 | } 832 | # or if it is number:#channel nick | msg 833 | elsif (weechat::config_get_plugin("alignment") eq "nchannel,nick") 834 | { 835 | # Place channel number in front of formatted name 836 | $bufname = weechat::color("chat_prefix_buffer").weechat::buffer_get_integer($cb_bufferp, 'number').":".weechat::color("reset").$bufname; 837 | # Build string 838 | $outstr = $bufname.":".$nick."\t".$cb_msg; 839 | } 840 | # or finally | #channel nick msg 841 | else 842 | { 843 | # Build string 844 | $outstr = "\t".$bufname.":".$nick." ".$cb_msg; 845 | } 846 | } 847 | # highmon channel toggle message 848 | elsif ($cb_bufferp && !$nick) 849 | { 850 | # Format buffer name 851 | $bufname = format_buffer_name($cb_bufferp); 852 | 853 | # If alignment is #channel * | * 854 | if (weechat::config_get_plugin("alignment") =~ /channel/) 855 | { 856 | # If it's actually channel number * | * 857 | if (weechat::config_get_plugin("alignment") =~ /schannel/) 858 | { 859 | # Use channel number instead 860 | $bufname = weechat::color("chat_prefix_buffer").weechat::buffer_get_integer($cb_bufferp, 'number').weechat::color("reset"); 861 | } 862 | # Or if it's actually number:#channel * | * 863 | if (weechat::config_get_plugin("alignment") =~ /nchannel/) 864 | { 865 | # Place channel number in front of formatted name 866 | $bufname = weechat::color("chat_prefix_buffer").weechat::buffer_get_integer($cb_bufferp, 'number').":".weechat::color("reset").$bufname; 867 | } 868 | $outstr = $bufname."\t".$cb_msg; 869 | } 870 | # or if alignment is | * 871 | else 872 | { 873 | $outstr = $bufname.": ".$cb_msg; 874 | } 875 | } 876 | # highmon dynmon 877 | elsif (!$cb_bufferp && !$nick) 878 | { 879 | $outstr = "\t".$cb_msg; 880 | } 881 | 882 | # Send string to buffer 883 | if (weechat::config_get_plugin("output") eq "buffer") 884 | { 885 | # Search for and confirm buffer 886 | $highmon_buffer = weechat::buffer_search("perl", "highmon"); 887 | # Print 888 | if ($cb_date) 889 | { 890 | weechat::print_date_tags($highmon_buffer, $cb_date, $cb_tags, $outstr); 891 | } 892 | else 893 | { 894 | weechat::print($highmon_buffer, $outstr); 895 | } 896 | } 897 | elsif (weechat::config_get_plugin("output") eq "bar") 898 | { 899 | # Add time string 900 | use POSIX qw(strftime); 901 | if ($cb_date) 902 | { 903 | $time = strftime(weechat::config_string(weechat::config_get("weechat.look.buffer_time_format")), localtime($cb_date)); 904 | } 905 | else 906 | { 907 | $time = strftime(weechat::config_string(weechat::config_get("weechat.look.buffer_time_format")), localtime); 908 | } 909 | # Colourise 910 | if ($time =~ /\$\{(?:color:)?[\w,]+\}/) # Coloured string 911 | { 912 | while ($time =~ /\$\{(?:color:)?([\w,]+)\}/) 913 | { 914 | $color = weechat::color($1); 915 | $time =~ s/\$\{(?:color:)?[\w,]+\}/$color/; 916 | } 917 | $time .= weechat::color("reset"); 918 | } 919 | else # Default string 920 | { 921 | $colour = weechat::color(weechat::config_string(weechat::config_get("weechat.color.chat_time_delimiters"))); 922 | $reset = weechat::color("reset"); 923 | $time =~ s/(\d*)(.)(\d*)/$1$colour$2$reset$3/g; 924 | } 925 | # Push updates to bar lists 926 | push (@bar_lines_time, $time); 927 | 928 | # Change tab char 929 | $delim = " ".weechat::color(weechat::config_string(weechat::config_get("weechat.color.chat_delimiters"))).weechat::config_string(weechat::config_get("weechat.look.prefix_suffix")).weechat::color("reset")." "; 930 | $outstr =~ s/\t/$delim/; 931 | 932 | push (@bar_lines, $outstr); 933 | # Trigger update 934 | weechat::bar_item_update("highmon"); 935 | 936 | if (weechat::config_get_plugin("bar_scrolldown") eq "on") 937 | { 938 | weechat::command("", "/bar scroll highmon * ye") 939 | } 940 | } 941 | } 942 | 943 | # Start the output display 944 | sub highmon_start 945 | { 946 | if (weechat::config_get_plugin("output") eq "buffer") 947 | { 948 | highmon_buffer_open(); 949 | } 950 | elsif (weechat::config_get_plugin("output") eq "bar") 951 | { 952 | highmon_bar_open(); 953 | } 954 | } 955 | 956 | # Takes two optional args (channel server), toggles monitoring on/off 957 | sub highmon_toggle 958 | { 959 | $data = $_[0]; 960 | $buffer = $_[1]; 961 | $args = $_[2]; 962 | 963 | # Check if we've been told what channel to act on 964 | if ($args ne "") 965 | { 966 | # Split argument up 967 | @arg_array = split(/ /,$args); 968 | # Check if a server was given 969 | if ($arg_array[1]) 970 | { 971 | # Find matching 972 | $bufp = weechat::buffer_search("irc", $arg_array[1].".".$arg_array[0]); 973 | } 974 | else 975 | { 976 | $found_chans = 0; 977 | # Loop through defined servers 978 | $infolist = weechat::infolist_get("buffer", "", ""); 979 | while (weechat::infolist_next($infolist)) 980 | { 981 | # Only interesting in IRC buffers 982 | if (weechat::infolist_string($infolist, "plugin_name") eq "irc") 983 | { 984 | # Find buffers that maych 985 | $sname = weechat::infolist_string($infolist, "short_name"); 986 | if ($sname eq $arg_array[0]) 987 | { 988 | $found_chans++; 989 | $bufp = weechat::infolist_pointer($infolist, "pointer"); 990 | } 991 | } 992 | } 993 | weechat::infolist_free($infolist); 994 | # If the infolist found more than one channel, halt as we need to know which one 995 | if ($found_chans > 1) 996 | { 997 | weechat::print("", "Channel name is not unique, please define server"); 998 | return weechat::WEECHAT_RC_OK; 999 | } 1000 | } 1001 | # Something didn't return right 1002 | if ($bufp eq "") 1003 | { 1004 | weechat::print("", "Could not find buffer"); 1005 | return weechat::WEECHAT_RC_OK; 1006 | } 1007 | } 1008 | else 1009 | { 1010 | # Get pointer from where we are 1011 | $bufp = weechat::current_buffer(); 1012 | } 1013 | # Get buffer name 1014 | $bufname = weechat::buffer_get_string($bufp, 'name'); 1015 | # Test if buffer is an IRC channel 1016 | if ($bufname =~ /(.*)\.([#&\+!])(.*)/) 1017 | { 1018 | if (weechat::config_get_plugin($bufname) eq "off") 1019 | { 1020 | # If currently off, set on 1021 | weechat::config_set_plugin($bufname, "on"); 1022 | 1023 | # Send to output formatter 1024 | highmon_print("Highlight Monitoring Enabled", $bufp); 1025 | return weechat::WEECHAT_RC_OK; 1026 | } 1027 | elsif (weechat::config_get_plugin($bufname) eq "on" || weechat::config_get_plugin($bufname) eq "") 1028 | { 1029 | # If currently on, set off 1030 | weechat::config_set_plugin($bufname, "off"); 1031 | 1032 | # Send to output formatter 1033 | highmon_print("Highlight Monitoring Disabled", $bufp); 1034 | return weechat::WEECHAT_RC_OK; 1035 | } 1036 | } 1037 | } 1038 | 1039 | # Takes a buffer pointer and returns a formatted name 1040 | sub format_buffer_name 1041 | { 1042 | $cb_bufferp = $_[0]; 1043 | $bufname = weechat::buffer_get_string($cb_bufferp, 'name'); 1044 | 1045 | # Set colour from buffer name 1046 | if (weechat::config_get_plugin("color_buf") eq "on") 1047 | { 1048 | # Determine what colour to use 1049 | $color = weechat::info_get("irc_nick_color", $bufname); 1050 | if (!$color) 1051 | { 1052 | $color = 0; 1053 | @char_array = split(//,$bufname); 1054 | foreach $char (@char_array) 1055 | { 1056 | $color += ord($char); 1057 | } 1058 | $color %= 10; 1059 | $color = sprintf "weechat.color.chat_nick_color%02d", $color+1; 1060 | $color = weechat::config_get($color); 1061 | $color = weechat::config_string($color); 1062 | $color = weechat::color($color); 1063 | } 1064 | 1065 | # Private message just show network 1066 | if (weechat::config_get_plugin("merge_private") eq "on" && weechat::buffer_get_string($cb_bufferp, "localvar_type") eq "private") 1067 | { 1068 | $bufname = weechat::buffer_get_string($cb_bufferp, "localvar_server"); 1069 | } 1070 | # Format name to short or 'nicename' 1071 | elsif (weechat::config_get_plugin("short_names") eq "on") 1072 | { 1073 | $bufname = weechat::buffer_get_string($cb_bufferp, 'short_name'); 1074 | } 1075 | else 1076 | { 1077 | $bufname =~ s/(.*)\.([#&\+!])(.*)/$1$2$3/; 1078 | } 1079 | 1080 | # Build a coloured string 1081 | $bufname = $color.$bufname.weechat::color("reset"); 1082 | } 1083 | # User set colour name 1084 | elsif (weechat::config_get_plugin("color_buf") ne "off") 1085 | { 1086 | # Private message just show network 1087 | if (weechat::config_get_plugin("merge_private") eq "on" && weechat::buffer_get_string($cb_bufferp, "localvar_type") eq "private") 1088 | { 1089 | $bufname = weechat::buffer_get_string($cb_bufferp, "localvar_server"); 1090 | } 1091 | # Format name to short or 'nicename' 1092 | elsif (weechat::config_get_plugin("short_names") eq "on") 1093 | { 1094 | $bufname = weechat::buffer_get_string($cb_bufferp, 'short_name'); 1095 | } 1096 | else 1097 | { 1098 | $bufname =~ s/(.*)\.([#&\+!])(.*)/$1$2$3/; 1099 | } 1100 | 1101 | $color = weechat::config_get_plugin("color_buf"); 1102 | $bufname = weechat::color($color).$bufname.weechat::color("reset"); 1103 | } 1104 | # Stick with default colour 1105 | else 1106 | { 1107 | # Private message just show network 1108 | if (weechat::config_get_plugin("merge_private") eq "on" && weechat::buffer_get_string($cb_bufferp, "localvar_type") eq "private") 1109 | { 1110 | $bufname = weechat::buffer_get_string($cb_bufferp, "localvar_server"); 1111 | } 1112 | # Format name to short or 'nicename' 1113 | elsif (weechat::config_get_plugin("short_names") eq "on") 1114 | { 1115 | $bufname = weechat::buffer_get_string($cb_bufferp, 'short_name'); 1116 | } 1117 | else 1118 | { 1119 | $bufname =~ s/(.*)\.([#&\+!])(.*)/$1$2$3/; 1120 | } 1121 | } 1122 | 1123 | return $bufname; 1124 | } 1125 | 1126 | # Check result of register, and attempt to behave in a sane manner 1127 | if (!weechat::register("highmon", "KenjiE20", "2.5", "GPL3", "Highlight Monitor", "", "")) 1128 | { 1129 | # Double load 1130 | weechat::print ("", "\tHighmon is already loaded"); 1131 | return weechat::WEECHAT_RC_OK; 1132 | } 1133 | else 1134 | { 1135 | # Start everything 1136 | highmon_hook(); 1137 | highmon_config_init(); 1138 | highmon_start(); 1139 | } 1140 | -------------------------------------------------------------------------------- /weechat/.weechat/perl/iset.pl: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2008-2014 Sebastien Helleu 3 | # Copyright (C) 2010-2014 Nils Görs 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Set WeeChat and plugins options interactively. 19 | # 20 | # History: 21 | # 22 | # 2014-09-30, arza : 23 | # version 3.6: fix current line counter when options aren't found 24 | # 2014-06-03, nils_2 : 25 | # version 3.5: add new option "use_mute" 26 | # 2014-01-30, stfn : 27 | # version 3.4: add new options "color_value_diff" and "color_value_diff_selected" 28 | # 2014-01-16, luz : 29 | # version 3.3: fix bug with column alignment in iset buffer when option 30 | # name contains unicode characters 31 | # 2013-08-03, Sebastien Helleu : 32 | # version 3.2: allow "q" as input in iset buffer to close it 33 | # 2013-07-14, Sebastien Helleu : 34 | # version 3.1: remove unneeded calls to iset_refresh() in mouse callback 35 | # (faster mouse actions when lot of options are displayed), 36 | # fix bug when clicking on a line after the last option displayed 37 | # 2013-04-30, arza : 38 | # version 3.0: simpler title, fix refresh on unset 39 | # 2012-12-16, nils_2 : 40 | # version 2.9: fix focus window with iset buffer on mouse click 41 | # 2012-08-25, nils_2 : 42 | # version 2.8: most important key and mouse bindings for iset buffer added to title-bar (idea The-Compiler) 43 | # 2012-07-31, nils_2 : 44 | # version 2.7: add combined option and value search (see /help iset) 45 | # : add exact value search (see /help iset) 46 | # : fix problem with metacharacter in value search 47 | # : fix use of uninitialized value for unset option and reset value of option 48 | # 2012-07-25, nils_2 : 49 | # version 2.6: switch to iset buffer (if existing) when command /iset is called with arguments 50 | # 2012-03-17, Sebastien Helleu : 51 | # version 2.5: fix check of sections when creating config file 52 | # 2012-03-09, Sebastien Helleu : 53 | # version 2.4: fix reload of config file 54 | # 2012-02-02, nils_2 : 55 | # version 2.3: fixed: refresh problem with new search results and cursor was outside window. 56 | # : add: new option "current_line" in title bar 57 | # version 2.2: fixed: refresh error when toggling plugins description 58 | # 2011-11-05, nils_2 : 59 | # version 2.1: use own config file (iset.conf), fix own help color (used immediately) 60 | # 2011-10-16, nils_2 : 61 | # version 2.0: add support for left-mouse-button and more sensitive mouse gesture (for integer/color options) 62 | # add help text for mouse support 63 | # 2011-09-20, Sebastien Helleu : 64 | # version 1.9: add mouse support, fix iset buffer, fix errors on first load under FreeBSD 65 | # 2011-07-21, nils_2 : 66 | # version 1.8: added: option "show_plugin_description" (alt+p) 67 | # fixed: typos in /help iset (lower case for alt+'x' keys) 68 | # 2011-05-29, nils_2 : 69 | # version 1.7: added: version check for future needs 70 | # added: new option (scroll_horiz) and usage of scroll_horiz function (weechat >= 0.3.6 required) 71 | # fixed: help_bar did not pop up immediately using key-shortcut 72 | # 2011-02-19, nils_2 : 73 | # version 1.6: added: display of all possible values in help bar (show_help_extra_info) 74 | # fixed: external user options never loaded when starting iset first time 75 | # 2011-02-13, Sebastien Helleu : 76 | # version 1.5: use new help format for command arguments 77 | # 2011-02-03, nils_2 : 78 | # version 1.4: fixed: restore value filter after /upgrade using buffer local variable. 79 | # 2011-01-14, nils_2 : 80 | # version 1.3: added function to search for values (option value_search_char). 81 | # code optimization. 82 | # 2010-12-26, Sebastien Helleu : 83 | # version 1.2: improve speed of /upgrade when iset buffer is open, 84 | # restore filter used after /upgrade using buffer local variable, 85 | # use /iset filter argument if buffer is open. 86 | # 2010-11-21, drubin : 87 | # version 1.1.1: fix bugs with cursor position 88 | # 2010-11-20, nils_2 : 89 | # version 1.1: cursor position set to value 90 | # 2010-08-03, Sebastien Helleu : 91 | # version 1.0: move misplaced call to infolist_free() 92 | # 2010-02-02, rettub : 93 | # version 0.9: turn all the help stuff off if option 'show_help_bar' is 'off', 94 | # new key binding - to toggle help_bar and help stuff on/off 95 | # 2010-01-30, nils_2 : 96 | # version 0.8: fix error when option does not exist 97 | # 2010-01-24, Sebastien Helleu : 98 | # version 0.7: display iset bar only on iset buffer 99 | # 2010-01-22, nils_2 and drubin: 100 | # version 0.6: add description in a bar, fix singular/plural bug in title bar, 101 | # fix selected line when switching buffer 102 | # 2009-06-21, Sebastien Helleu : 103 | # version 0.5: fix bug with iset buffer after /upgrade 104 | # 2009-05-02, Sebastien Helleu : 105 | # version 0.4: sync with last API changes 106 | # 2009-01-04, Sebastien Helleu : 107 | # version 0.3: open iset buffer when /iset command is executed 108 | # 2009-01-04, Sebastien Helleu : 109 | # version 0.2: use null values for options, add colors, fix refresh bugs, 110 | # use new keys to reset/unset options, sort options by name, 111 | # display number of options in buffer's title 112 | # 2008-11-05, Sebastien Helleu : 113 | # version 0.1: first official version 114 | # 2008-04-19, Sebastien Helleu : 115 | # script creation 116 | 117 | use strict; 118 | 119 | my $PRGNAME = "iset"; 120 | my $VERSION = "3.6"; 121 | my $DESCR = "Interactive Set for configuration options"; 122 | my $AUTHOR = "Sebastien Helleu "; 123 | my $LICENSE = "GPL3"; 124 | my $LANG = "perl"; 125 | my $ISET_CONFIG_FILE_NAME = "iset"; 126 | 127 | my $iset_config_file; 128 | my $iset_buffer = ""; 129 | my $wee_version_number = 0; 130 | my @iset_focus = (); 131 | my @options_names = (); 132 | my @options_types = (); 133 | my @options_values = (); 134 | my @options_default_values = (); 135 | my @options_is_null = (); 136 | my $option_max_length = 0; 137 | my $current_line = 0; 138 | my $filter = "*"; 139 | my $description = ""; 140 | my $options_name_copy = ""; 141 | my $iset_filter_title = ""; 142 | # search modes: 0 = index() on value, 1 = grep() on value, 2 = grep() on option, 3 = grep on option & value 143 | my $search_mode = 2; 144 | my $search_value = ""; 145 | my $help_text_keys = "alt + space: toggle, +/-: increase/decrease, enter: change, ir: reset, iu: unset, v: toggle help bar"; 146 | my $help_text_mouse = "Mouse: left: select, right: toggle/set, right + drag left/right: increase/decrease"; 147 | my %options_iset; 148 | 149 | my %mouse_keys = ("\@chat(perl.$PRGNAME):button1" => "hsignal:iset_mouse", 150 | "\@chat(perl.$PRGNAME):button2*" => "hsignal:iset_mouse", 151 | "\@chat(perl.$PRGNAME):wheelup" => "/repeat 5 /iset **up", 152 | "\@chat(perl.$PRGNAME):wheeldown" => "/repeat 5 /iset **down"); 153 | 154 | 155 | sub iset_title 156 | { 157 | if ($iset_buffer ne "") 158 | { 159 | my $current_line_counter = ""; 160 | if (weechat::config_boolean($options_iset{"show_current_line"}) == 1) 161 | { 162 | if (@options_names eq 0) 163 | { 164 | $current_line_counter = "0/"; 165 | } 166 | else 167 | { 168 | $current_line_counter = ($current_line + 1) . "/"; 169 | } 170 | } 171 | my $show_filter = ""; 172 | if ($search_mode eq 0) 173 | { 174 | $iset_filter_title = "(value) "; 175 | $show_filter = $search_value; 176 | if ( substr($show_filter,0,1) eq weechat::config_string($options_iset{"value_search_char"}) ) 177 | { 178 | $show_filter = substr($show_filter,1,length($show_filter)); 179 | } 180 | } 181 | elsif ($search_mode eq 1) 182 | { 183 | $iset_filter_title = "(value) "; 184 | $show_filter = "*".$search_value."*"; 185 | } 186 | elsif ($search_mode eq 2) 187 | { 188 | $iset_filter_title = ""; 189 | $filter = "*" if ($filter eq ""); 190 | $show_filter = $filter; 191 | } 192 | elsif ($search_mode eq 3) 193 | { 194 | $iset_filter_title = "(option) "; 195 | $show_filter = $filter 196 | .weechat::color("default") 197 | ." / (value) " 198 | .weechat::color("yellow") 199 | ."*".$search_value."*"; 200 | } 201 | weechat::buffer_set($iset_buffer, "title", 202 | $iset_filter_title 203 | .weechat::color("yellow") 204 | .$show_filter 205 | .weechat::color("default")." | " 206 | .$current_line_counter 207 | .@options_names 208 | ." | " 209 | .$help_text_keys 210 | ." | " 211 | .$help_text_mouse); 212 | } 213 | } 214 | 215 | sub iset_create_filter 216 | { 217 | $filter = $_[0]; 218 | if ( $search_mode == 3 ) 219 | { 220 | my @cmd_array = split(/ /,$filter); 221 | my $array_count = @cmd_array; 222 | $filter = $cmd_array[0]; 223 | $filter = $cmd_array[0] . " " . $cmd_array[1] if ( $array_count >2 ); 224 | } 225 | $filter = "$1.*" if ($filter =~ /f (.*)/); # search file 226 | $filter = "*.$1.*" if ($filter =~ /s (.*)/); # search section 227 | if ((substr($filter, 0, 1) ne "*") && (substr($filter, -1, 1) ne "*")) 228 | { 229 | $filter = "*".$filter."*"; 230 | } 231 | if ($iset_buffer ne "") 232 | { 233 | weechat::buffer_set($iset_buffer, "localvar_set_iset_filter", $filter); 234 | } 235 | } 236 | 237 | sub iset_buffer_input 238 | { 239 | my ($data, $buffer, $string) = ($_[0], $_[1], $_[2]); 240 | if ($string eq "q") 241 | { 242 | weechat::buffer_close($buffer); 243 | return weechat::WEECHAT_RC_OK; 244 | } 245 | $search_value = ""; 246 | my @cmd_array = split(/ /,$string); 247 | my $array_count = @cmd_array; 248 | my $string2 = substr($string, 0, 1); 249 | if ($string2 eq weechat::config_string($options_iset{"value_search_char"}) 250 | or (defined $cmd_array[0] and $cmd_array[0] eq weechat::config_string($options_iset{"value_search_char"}).weechat::config_string($options_iset{"value_search_char"})) ) 251 | { 252 | $search_mode = 1; 253 | $search_value = substr($string, 1); 254 | iset_get_values($search_value); 255 | if ($iset_buffer ne "") 256 | { 257 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $search_value); 258 | } 259 | } 260 | else 261 | { 262 | $search_mode = 2; 263 | if ( $array_count >= 2 and $cmd_array[0] ne "f" or $cmd_array[0] ne "s") 264 | { 265 | if ( defined $cmd_array[1] and substr($cmd_array[1], 0, 1) eq weechat::config_string($options_iset{"value_search_char"}) 266 | or defined $cmd_array[2] and substr($cmd_array[2], 0, 1) eq weechat::config_string($options_iset{"value_search_char"}) ) 267 | { 268 | $search_mode = 3; 269 | $search_value = substr($cmd_array[1], 1); # cut value_search_char 270 | $search_value = substr($cmd_array[2], 1) if ( $array_count > 2); # cut value_search_char 271 | } 272 | } 273 | if ( $search_mode == 3) 274 | { 275 | iset_create_filter($string); 276 | iset_get_options($search_value); 277 | }else 278 | { 279 | iset_create_filter($string); 280 | iset_get_options(""); 281 | } 282 | } 283 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_mode", $search_mode); 284 | weechat::buffer_clear($buffer); 285 | $current_line = 0; 286 | iset_refresh(); 287 | return weechat::WEECHAT_RC_OK; 288 | } 289 | 290 | sub iset_buffer_close 291 | { 292 | $iset_buffer = ""; 293 | 294 | return weechat::WEECHAT_RC_OK; 295 | } 296 | 297 | sub iset_init 298 | { 299 | $current_line = 0; 300 | $iset_buffer = weechat::buffer_search($LANG, $PRGNAME); 301 | if ($iset_buffer eq "") 302 | { 303 | $iset_buffer = weechat::buffer_new($PRGNAME, "iset_buffer_input", "", "iset_buffer_close", ""); 304 | } 305 | else 306 | { 307 | my $new_filter = weechat::buffer_get_string($iset_buffer, "localvar_iset_filter"); 308 | $search_mode = weechat::buffer_get_string($iset_buffer, "localvar_iset_search_mode"); 309 | $search_value = weechat::buffer_get_string($iset_buffer, "localvar_iset_search_value"); 310 | $filter = $new_filter if ($new_filter ne ""); 311 | } 312 | if ($iset_buffer ne "") 313 | { 314 | weechat::buffer_set($iset_buffer, "type", "free"); 315 | iset_title(); 316 | weechat::buffer_set($iset_buffer, "key_bind_ctrl-L", "/iset **refresh"); 317 | weechat::buffer_set($iset_buffer, "key_bind_meta2-A", "/iset **up"); 318 | weechat::buffer_set($iset_buffer, "key_bind_meta2-B", "/iset **down"); 319 | weechat::buffer_set($iset_buffer, "key_bind_meta2-23~", "/iset **left"); 320 | weechat::buffer_set($iset_buffer, "key_bind_meta2-24~" , "/iset **right"); 321 | weechat::buffer_set($iset_buffer, "key_bind_meta- ", "/iset **toggle"); 322 | weechat::buffer_set($iset_buffer, "key_bind_meta-+", "/iset **incr"); 323 | weechat::buffer_set($iset_buffer, "key_bind_meta--", "/iset **decr"); 324 | weechat::buffer_set($iset_buffer, "key_bind_meta-imeta-r", "/iset **reset"); 325 | weechat::buffer_set($iset_buffer, "key_bind_meta-imeta-u", "/iset **unset"); 326 | weechat::buffer_set($iset_buffer, "key_bind_meta-ctrl-J", "/iset **set"); 327 | weechat::buffer_set($iset_buffer, "key_bind_meta-ctrl-M", "/iset **set"); 328 | weechat::buffer_set($iset_buffer, "key_bind_meta-meta2-1~", "/iset **scroll_top"); 329 | weechat::buffer_set($iset_buffer, "key_bind_meta-meta2-4~", "/iset **scroll_bottom"); 330 | weechat::buffer_set($iset_buffer, "key_bind_meta-v", "/iset **toggle_help"); 331 | weechat::buffer_set($iset_buffer, "key_bind_meta-p", "/iset **toggle_show_plugin_desc"); 332 | weechat::buffer_set($iset_buffer, "localvar_set_iset_filter", $filter); 333 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_mode", $search_mode); 334 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $search_value); 335 | } 336 | } 337 | 338 | sub iset_get_options 339 | { 340 | my $var_value = $_[0]; 341 | $var_value = "" if (not defined $var_value); 342 | $var_value = lc($var_value); 343 | $search_value = $var_value; 344 | @iset_focus = (); 345 | @options_names = (); 346 | @options_types = (); 347 | @options_values = (); 348 | @options_default_values = (); 349 | @options_is_null = (); 350 | $option_max_length = 0; 351 | my %options_internal = (); 352 | my $i = 0; 353 | my $key; 354 | my $iset_struct; 355 | my %iset_struct; 356 | 357 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $var_value) if ($search_mode == 3); 358 | 359 | my $infolist = weechat::infolist_get("option", "", $filter); 360 | while (weechat::infolist_next($infolist)) 361 | { 362 | $key = sprintf("%08d", $i); 363 | my $name = weechat::infolist_string($infolist, "full_name"); 364 | next if (weechat::config_boolean($options_iset{"show_plugin_description"}) == 0 and index ($name, "plugins.desc.") != -1); 365 | my $type = weechat::infolist_string($infolist, "type"); 366 | my $value = weechat::infolist_string($infolist, "value"); 367 | my $default_value = weechat::infolist_string($infolist, "default_value"); 368 | my $is_null = weechat::infolist_integer($infolist, "value_is_null"); 369 | if ($search_mode == 3) 370 | { 371 | my $value = weechat::infolist_string($infolist, "value"); 372 | if ( grep /\Q$var_value/,lc($value) ) 373 | { 374 | $options_internal{$name}{"type"} = $type; 375 | $options_internal{$name}{"value"} = $value; 376 | $options_internal{$name}{"default_value"} = $default_value; 377 | $options_internal{$name}{"is_null"} = $is_null; 378 | $option_max_length = length($name) if (length($name) > $option_max_length); 379 | $iset_struct{$key} = $options_internal{$name}; 380 | push(@iset_focus, $iset_struct{$key}); 381 | } 382 | } 383 | else 384 | { 385 | $options_internal{$name}{"type"} = $type; 386 | $options_internal{$name}{"value"} = $value; 387 | $options_internal{$name}{"default_value"} = $default_value; 388 | $options_internal{$name}{"is_null"} = $is_null; 389 | $option_max_length = length($name) if (length($name) > $option_max_length); 390 | $iset_struct{$key} = $options_internal{$name}; 391 | push(@iset_focus, $iset_struct{$key}); 392 | } 393 | $i++; 394 | } 395 | weechat::infolist_free($infolist); 396 | 397 | foreach my $name (sort keys %options_internal) 398 | { 399 | push(@options_names, $name); 400 | push(@options_types, $options_internal{$name}{"type"}); 401 | push(@options_values, $options_internal{$name}{"value"}); 402 | push(@options_default_values, $options_internal{$name}{"default_value"}); 403 | push(@options_is_null, $options_internal{$name}{"is_null"}); 404 | } 405 | } 406 | 407 | sub iset_get_values 408 | { 409 | my $var_value = $_[0]; 410 | $var_value = lc($var_value); 411 | if (substr($var_value,0,1) eq weechat::config_string($options_iset{"value_search_char"}) and $var_value ne weechat::config_string($options_iset{"value_search_char"})) 412 | { 413 | $var_value = substr($var_value,1,length($var_value)); 414 | $search_mode = 0; 415 | } 416 | iset_search_values($var_value,$search_mode); 417 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_mode", $search_mode); 418 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $var_value); 419 | $search_value = $var_value; 420 | } 421 | sub iset_search_values 422 | { 423 | my ($var_value,$search_mode) = ($_[0],$_[1]); 424 | @options_names = (); 425 | @options_types = (); 426 | @options_values = (); 427 | @options_default_values = (); 428 | @options_is_null = (); 429 | $option_max_length = 0; 430 | my %options_internal = (); 431 | my $i = 0; 432 | my $infolist = weechat::infolist_get("option", "", "*"); 433 | while (weechat::infolist_next($infolist)) 434 | { 435 | my $name = weechat::infolist_string($infolist, "full_name"); 436 | next if (weechat::config_boolean($options_iset{"show_plugin_description"}) == 0 and index ($name, "plugins.desc.") != -1); 437 | my $type = weechat::infolist_string($infolist, "type"); 438 | my $is_null = weechat::infolist_integer($infolist, "value_is_null"); 439 | my $value = weechat::infolist_string($infolist, "value"); 440 | my $default_value = weechat::infolist_string($infolist, "default_value"); 441 | if ($search_mode) 442 | { 443 | if ( grep /\Q$var_value/,lc($value) ) 444 | { 445 | $options_internal{$name}{"type"} = $type; 446 | $options_internal{$name}{"value"} = $value; 447 | $options_internal{$name}{"default_value"} = $default_value; 448 | $options_internal{$name}{"is_null"} = $is_null; 449 | $option_max_length = length($name) if (length($name) > $option_max_length); 450 | } 451 | } 452 | else 453 | { 454 | # if ($value =~ /\Q$var_value/si) 455 | if (lc($value) eq $var_value) 456 | { 457 | $options_internal{$name}{"type"} = $type; 458 | $options_internal{$name}{"value"} = $value; 459 | $options_internal{$name}{"default_value"} = $default_value; 460 | $options_internal{$name}{"is_null"} = $is_null; 461 | $option_max_length = length($name) if (length($name) > $option_max_length); 462 | } 463 | } 464 | $i++; 465 | } 466 | weechat::infolist_free($infolist); 467 | foreach my $name (sort keys %options_internal) 468 | { 469 | push(@options_names, $name); 470 | push(@options_types, $options_internal{$name}{"type"}); 471 | push(@options_values, $options_internal{$name}{"value"}); 472 | push(@options_default_values, $options_internal{$name}{"default_value"}); 473 | push(@options_is_null, $options_internal{$name}{"is_null"}); 474 | } 475 | } 476 | 477 | sub iset_refresh_line 478 | { 479 | if ($iset_buffer ne "") 480 | { 481 | my $y = $_[0]; 482 | if ($y <= $#options_names) 483 | { 484 | return if (! defined($options_types[$y])); 485 | my $format = sprintf("%%s%%s%%s %%s %%-7s %%s %%s%%s%%s"); 486 | my $padding; 487 | if ($wee_version_number >= 0x00040200) 488 | { 489 | $padding = " " x ($option_max_length - weechat::strlen_screen($options_names[$y])); 490 | } 491 | else 492 | { 493 | $padding = " " x ($option_max_length - length($options_names[$y])); 494 | } 495 | my $around = ""; 496 | $around = "\"" if ((!$options_is_null[$y]) && ($options_types[$y] eq "string")); 497 | 498 | my $color1 = weechat::color(weechat::config_color($options_iset{"color_option"})); 499 | my $color2 = weechat::color(weechat::config_color($options_iset{"color_type"})); 500 | my $color3 = ""; 501 | if ($options_is_null[$y]) 502 | { 503 | $color3 = weechat::color(weechat::config_color($options_iset{"color_value_undef"})); 504 | } 505 | elsif ($options_values[$y] ne $options_default_values[$y]) 506 | { 507 | $color3 = weechat::color(weechat::config_color($options_iset{"color_value_diff"})); 508 | } 509 | else 510 | { 511 | $color3 = weechat::color(weechat::config_color($options_iset{"color_value"})); 512 | } 513 | if ($y == $current_line) 514 | { 515 | $color1 = weechat::color(weechat::config_color($options_iset{"color_option_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"})); 516 | $color2 = weechat::color(weechat::config_color($options_iset{"color_type_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"})); 517 | if ($options_is_null[$y]) 518 | { 519 | $color3 = weechat::color(weechat::config_color($options_iset{"color_value_undef_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"})); 520 | } 521 | elsif ($options_values[$y] ne $options_default_values[$y]) 522 | { 523 | $color3 = weechat::color(weechat::config_color($options_iset{"color_value_diff_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"})); 524 | } 525 | else 526 | { 527 | $color3 = weechat::color(weechat::config_color($options_iset{"color_value_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"})); 528 | } 529 | } 530 | my $value = $options_values[$y]; 531 | $value = "(undef)" if ($options_is_null[$y]); 532 | my $strline = sprintf($format, 533 | $color1, $options_names[$y], $padding, 534 | $color2, $options_types[$y], 535 | $color3, $around, $value, $around); 536 | weechat::print_y($iset_buffer, $y, $strline); 537 | } 538 | } 539 | } 540 | 541 | sub iset_refresh 542 | { 543 | iset_title(); 544 | if (($iset_buffer ne "") && ($#options_names >= 0)) 545 | { 546 | foreach my $y (0 .. $#options_names) 547 | { 548 | iset_refresh_line($y); 549 | } 550 | } 551 | 552 | weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1); 553 | } 554 | 555 | sub iset_full_refresh 556 | { 557 | $iset_buffer = weechat::buffer_search($LANG, $PRGNAME); 558 | if ($iset_buffer ne "") 559 | { 560 | weechat::buffer_clear($iset_buffer) unless defined $_[0]; # iset_full_refresh(1) does a full refresh without clearing buffer 561 | # search for "*" in $filter. 562 | if ($filter =~ m/\*/ and $search_mode == 2) 563 | { 564 | iset_get_options(""); 565 | } 566 | else 567 | { 568 | if ($search_mode == 0) 569 | { 570 | $search_value = "=" . $search_value; 571 | iset_get_values($search_value); 572 | } 573 | elsif ($search_mode == 1) 574 | { 575 | iset_get_values($search_value); 576 | } 577 | elsif ($search_mode == 3) 578 | { 579 | iset_create_filter($filter); 580 | iset_get_options($search_value); 581 | } 582 | } 583 | if (weechat::config_boolean($options_iset{"show_plugin_description"}) == 1) 584 | { 585 | iset_set_current_line($current_line); 586 | }else 587 | { 588 | $current_line = $#options_names if ($current_line > $#options_names); 589 | } 590 | iset_refresh(); 591 | weechat::command($iset_buffer, "/window refresh"); 592 | } 593 | } 594 | 595 | sub iset_set_current_line 596 | { 597 | my $new_current_line = $_[0]; 598 | if ($new_current_line >= 0) 599 | { 600 | my $old_current_line = $current_line; 601 | $current_line = $new_current_line; 602 | $current_line = $#options_names if ($current_line > $#options_names); 603 | if ($old_current_line != $current_line) 604 | { 605 | iset_refresh_line($old_current_line); 606 | iset_refresh_line($current_line); 607 | weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1); 608 | } 609 | } 610 | } 611 | 612 | sub iset_signal_window_scrolled_cb 613 | { 614 | my ($data, $signal, $signal_data) = ($_[0], $_[1], $_[2]); 615 | if ($iset_buffer ne "") 616 | { 617 | my $infolist = weechat::infolist_get("window", $signal_data, ""); 618 | if (weechat::infolist_next($infolist)) 619 | { 620 | if (weechat::infolist_pointer($infolist, "buffer") eq $iset_buffer) 621 | { 622 | my $old_current_line = $current_line; 623 | my $new_current_line = $current_line; 624 | my $start_line_y = weechat::infolist_integer($infolist, "start_line_y"); 625 | my $chat_height = weechat::infolist_integer($infolist, "chat_height"); 626 | $new_current_line += $chat_height if ($new_current_line < $start_line_y); 627 | $new_current_line -= $chat_height if ($new_current_line >= $start_line_y + $chat_height); 628 | $new_current_line = $start_line_y if ($new_current_line < $start_line_y); 629 | $new_current_line = $start_line_y + $chat_height - 1 if ($new_current_line >= $start_line_y + $chat_height); 630 | iset_set_current_line($new_current_line); 631 | } 632 | } 633 | weechat::infolist_free($infolist); 634 | } 635 | 636 | return weechat::WEECHAT_RC_OK; 637 | } 638 | 639 | sub iset_get_window_number 640 | { 641 | if ($iset_buffer ne "") 642 | { 643 | my $window = weechat::window_search_with_buffer($iset_buffer); 644 | return "-window ".weechat::window_get_integer ($window, "number")." " if ($window ne ""); 645 | } 646 | return ""; 647 | } 648 | 649 | sub iset_check_line_outside_window 650 | { 651 | if ($iset_buffer ne "") 652 | { 653 | undef my $infolist; 654 | if ($wee_version_number >= 0x00030500) 655 | { 656 | my $window = weechat::window_search_with_buffer($iset_buffer); 657 | $infolist = weechat::infolist_get("window", $window, "") if $window; 658 | } 659 | else 660 | { 661 | $infolist = weechat::infolist_get("window", "", "current"); 662 | } 663 | if ($infolist) 664 | { 665 | if (weechat::infolist_next($infolist)) 666 | { 667 | my $start_line_y = weechat::infolist_integer($infolist, "start_line_y"); 668 | my $chat_height = weechat::infolist_integer($infolist, "chat_height"); 669 | my $window_number = ""; 670 | if ($wee_version_number >= 0x00030500) 671 | { 672 | $window_number = "-window ".weechat::infolist_integer($infolist, "number")." "; 673 | } 674 | if ($start_line_y > $current_line) 675 | { 676 | weechat::command($iset_buffer, "/window scroll ".$window_number."-".($start_line_y - $current_line)); 677 | } 678 | else 679 | { 680 | if ($start_line_y <= $current_line - $chat_height) 681 | { 682 | weechat::command($iset_buffer, "/window scroll ".$window_number."+".($current_line - $start_line_y - $chat_height + 1)); 683 | 684 | } 685 | } 686 | } 687 | weechat::infolist_free($infolist); 688 | } 689 | } 690 | } 691 | 692 | sub iset_get_option_name_index 693 | { 694 | my $option_name = $_[0]; 695 | my $index = 0; 696 | while ($index <= $#options_names) 697 | { 698 | return -1 if ($options_names[$index] gt $option_name); 699 | return $index if ($options_names[$index] eq $option_name); 700 | $index++; 701 | } 702 | return -1; 703 | } 704 | 705 | sub iset_config_cb 706 | { 707 | my ($data, $option_name, $value) = ($_[0], $_[1], $_[2]); 708 | 709 | if ($iset_buffer ne "") 710 | { 711 | return weechat::WEECHAT_RC_OK if (weechat::info_get("weechat_upgrading", "") eq "1"); 712 | 713 | my $index = iset_get_option_name_index($option_name); 714 | if ($index >= 0) 715 | { 716 | # refresh info about changed option 717 | my $infolist = weechat::infolist_get("option", "", $option_name); 718 | if ($infolist) 719 | { 720 | weechat::infolist_next($infolist); 721 | if (weechat::infolist_fields($infolist)) 722 | { 723 | $options_types[$index] = weechat::infolist_string($infolist, "type"); 724 | $options_values[$index] = weechat::infolist_string($infolist, "value"); 725 | $options_default_values[$index] = weechat::infolist_string($infolist, "default_value"); 726 | $options_is_null[$index] = weechat::infolist_integer($infolist, "value_is_null"); 727 | iset_refresh_line($index); 728 | iset_title() if ($option_name eq "iset.look.show_current_line"); 729 | } 730 | else 731 | { 732 | iset_full_refresh(1); # if not found, refresh fully without clearing buffer 733 | weechat::print_y($iset_buffer, $#options_names + 1, ""); 734 | } 735 | weechat::infolist_free($infolist); 736 | } 737 | } 738 | else 739 | { 740 | iset_full_refresh() if ($option_name ne "weechat.bar.isetbar.hidden"); 741 | } 742 | } 743 | 744 | return weechat::WEECHAT_RC_OK; 745 | } 746 | 747 | sub iset_set_option 748 | { 749 | my ($option, $value) = ($_[0],$_[1]); 750 | if (defined $option and defined $value) 751 | { 752 | $option = weechat::config_get($option); 753 | weechat::config_option_set($option, $value, 1) if ($option ne ""); 754 | } 755 | } 756 | 757 | sub iset_reset_option 758 | { 759 | my $option = $_[0]; 760 | if (defined $option) 761 | { 762 | $option = weechat::config_get($option); 763 | weechat::config_option_reset($option, 1) if ($option ne ""); 764 | } 765 | } 766 | 767 | sub iset_unset_option 768 | { 769 | my $option = $_[0]; 770 | if (defined $option) 771 | { 772 | $option = weechat::config_get($option); 773 | weechat::config_option_unset($option) if ($option ne ""); 774 | } 775 | } 776 | 777 | 778 | sub iset_cmd_cb 779 | { 780 | my ($data, $buffer, $args) = ($_[0], $_[1], $_[2]); 781 | my $filter_set = 0; 782 | # $search_value = ""; 783 | if (($args ne "") && (substr($args, 0, 2) ne "**")) 784 | { 785 | my @cmd_array = split(/ /,$args); 786 | my $array_count = @cmd_array; 787 | if (substr($args, 0, 1) eq weechat::config_string($options_iset{"value_search_char"}) 788 | or (defined $cmd_array[0] and $cmd_array[0] eq weechat::config_string($options_iset{"value_search_char"}).weechat::config_string($options_iset{"value_search_char"})) ) 789 | { 790 | $search_mode = 1; 791 | my $search_value = substr($args, 1); # cut value_search_char 792 | if ($iset_buffer ne "") 793 | { 794 | weechat::buffer_clear($iset_buffer); 795 | weechat::command($iset_buffer, "/window refresh"); 796 | } 797 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_mode", $search_mode); 798 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $search_value); 799 | iset_init(); 800 | iset_get_values($search_value); 801 | iset_refresh(); 802 | weechat::buffer_set($iset_buffer, "display", "1"); 803 | # $filter = $var_value; 804 | return weechat::WEECHAT_RC_OK; 805 | } 806 | else 807 | { 808 | # f/s option =value 809 | # option =value 810 | $search_mode = 2; 811 | if ( $array_count >= 2 and $cmd_array[0] ne "f" or $cmd_array[0] ne "s") 812 | { 813 | if ( defined $cmd_array[1] and substr($cmd_array[1], 0, 1) eq weechat::config_string($options_iset{"value_search_char"}) 814 | or defined $cmd_array[2] and substr($cmd_array[2], 0, 1) eq weechat::config_string($options_iset{"value_search_char"}) ) 815 | { 816 | $search_mode = 3; 817 | $search_value = substr($cmd_array[1], 1); # cut value_search_char 818 | $search_value = substr($cmd_array[2], 1) if ( $array_count > 2); # cut value_search_char 819 | } 820 | } 821 | iset_create_filter($args); 822 | $filter_set = 1; 823 | my $ptrbuf = weechat::buffer_search($LANG, $PRGNAME); 824 | if ($ptrbuf eq "") 825 | { 826 | iset_init(); 827 | iset_get_options($search_value); 828 | iset_full_refresh(); 829 | weechat::buffer_set(weechat::buffer_search($LANG, $PRGNAME), "display", "1"); 830 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $search_value); 831 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_mode", $search_mode); 832 | return weechat::WEECHAT_RC_OK; 833 | } 834 | else 835 | { 836 | iset_get_options($search_value); 837 | iset_full_refresh(); 838 | weechat::buffer_set($ptrbuf, "display", "1"); 839 | } 840 | } 841 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_mode", $search_mode); 842 | weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $search_value); 843 | } 844 | if ($iset_buffer eq "") 845 | { 846 | iset_init(); 847 | iset_get_options(""); 848 | iset_refresh(); 849 | } 850 | else 851 | { 852 | # iset_get_options($search_value); 853 | iset_full_refresh() if ($filter_set); 854 | } 855 | 856 | if ($args eq "") 857 | { 858 | weechat::buffer_set($iset_buffer, "display", "1"); 859 | } 860 | else 861 | { 862 | if ($args eq "**refresh") 863 | { 864 | iset_full_refresh(); 865 | } 866 | if ($args eq "**up") 867 | { 868 | if ($current_line > 0) 869 | { 870 | $current_line--; 871 | iset_refresh_line($current_line + 1); 872 | iset_refresh_line($current_line); 873 | iset_check_line_outside_window(); 874 | } 875 | } 876 | if ($args eq "**down") 877 | { 878 | if ($current_line < $#options_names) 879 | { 880 | $current_line++; 881 | iset_refresh_line($current_line - 1); 882 | iset_refresh_line($current_line); 883 | iset_check_line_outside_window(); 884 | } 885 | } 886 | if ($args eq "**left" && $wee_version_number >= 0x00030600) 887 | { 888 | weechat::command($iset_buffer, "/window scroll_horiz ".iset_get_window_number()."-".weechat::config_integer($options_iset{"scroll_horiz"})."%"); 889 | } 890 | if ($args eq "**right" && $wee_version_number >= 0x00030600) 891 | { 892 | weechat::command($iset_buffer, "/window scroll_horiz ".iset_get_window_number().weechat::config_integer($options_iset{"scroll_horiz"})."%"); 893 | } 894 | if ($args eq "**scroll_top") 895 | { 896 | my $old_current_line = $current_line; 897 | $current_line = 0; 898 | iset_refresh_line ($old_current_line); 899 | iset_refresh_line ($current_line); 900 | iset_title(); 901 | weechat::command($iset_buffer, "/window scroll_top ".iset_get_window_number()); 902 | } 903 | if ($args eq "**scroll_bottom") 904 | { 905 | my $old_current_line = $current_line; 906 | $current_line = $#options_names; 907 | iset_refresh_line ($old_current_line); 908 | iset_refresh_line ($current_line); 909 | iset_title(); 910 | weechat::command($iset_buffer, "/window scroll_bottom ".iset_get_window_number()); 911 | } 912 | if ($args eq "**toggle") 913 | { 914 | if ($options_types[$current_line] eq "boolean") 915 | { 916 | iset_set_option($options_names[$current_line], "toggle"); 917 | } 918 | } 919 | if ($args eq "**incr") 920 | { 921 | if (($options_types[$current_line] eq "integer") 922 | || ($options_types[$current_line] eq "color")) 923 | { 924 | iset_set_option($options_names[$current_line], "++1"); 925 | } 926 | } 927 | if ($args eq "**decr") 928 | { 929 | if (($options_types[$current_line] eq "integer") 930 | || ($options_types[$current_line] eq "color")) 931 | { 932 | iset_set_option($options_names[$current_line], "--1"); 933 | } 934 | } 935 | if ($args eq "**reset") 936 | { 937 | iset_reset_option($options_names[$current_line]); 938 | } 939 | if ($args eq "**unset") 940 | { 941 | iset_unset_option($options_names[$current_line]); 942 | } 943 | if ($args eq "**toggle_help") 944 | { 945 | if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1) 946 | { 947 | weechat::config_option_set($options_iset{"show_help_bar"},0,1); 948 | iset_show_bar(0); 949 | } 950 | else 951 | { 952 | weechat::config_option_set($options_iset{"show_help_bar"},1,1); 953 | iset_show_bar(1); 954 | } 955 | } 956 | if ($args eq "**toggle_show_plugin_desc") 957 | { 958 | if (weechat::config_boolean($options_iset{"show_plugin_description"}) == 1) 959 | { 960 | weechat::config_option_set($options_iset{"show_plugin_description"},0,1); 961 | iset_full_refresh(); 962 | iset_check_line_outside_window(); 963 | iset_title(); 964 | } 965 | else 966 | { 967 | weechat::config_option_set($options_iset{"show_plugin_description"},1,1); 968 | iset_full_refresh(); 969 | iset_check_line_outside_window(); 970 | iset_title(); 971 | } 972 | } 973 | if ($args eq "**set") 974 | { 975 | my $quote = ""; 976 | my $value = $options_values[$current_line]; 977 | if ($options_is_null[$current_line]) 978 | { 979 | $value = "null"; 980 | } 981 | else 982 | { 983 | $quote = "\"" if ($options_types[$current_line] eq "string"); 984 | } 985 | my $set_command = "/set"; 986 | $set_command = "/mute " . $set_command if (weechat::config_boolean($options_iset{"use_mute"}) == 1); 987 | 988 | weechat::buffer_set($iset_buffer, "input", $set_command." ".$options_names[$current_line]." ".$quote.$value.$quote); 989 | weechat::command($iset_buffer, "/input move_beginning_of_line"); 990 | weechat::command($iset_buffer, "/input move_next_word"); 991 | weechat::command($iset_buffer, "/input move_next_word"); 992 | weechat::command($iset_buffer, "/input move_next_word") if (weechat::config_boolean($options_iset{"use_mute"}) == 1); 993 | weechat::command($iset_buffer, "/input move_next_char"); 994 | weechat::command($iset_buffer, "/input move_next_char") if ($quote ne ""); 995 | } 996 | } 997 | weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1); 998 | return weechat::WEECHAT_RC_OK; 999 | } 1000 | 1001 | sub iset_get_help 1002 | { 1003 | my ($redraw) = ($_[0]); 1004 | 1005 | return '' if (weechat::config_boolean($options_iset{"show_help_bar"}) == 0); 1006 | 1007 | if (not defined $options_names[$current_line]) 1008 | { 1009 | return "No option selected. Set a new filter using command line (use '*' to see all options)"; 1010 | } 1011 | if ($options_name_copy eq $options_names[$current_line] and not defined $redraw) 1012 | { 1013 | return $description; 1014 | } 1015 | $options_name_copy = $options_names[$current_line]; 1016 | my $optionlist =""; 1017 | $optionlist = weechat::infolist_get("option", "", $options_names[$current_line]); 1018 | weechat::infolist_next($optionlist); 1019 | my $full_name = weechat::infolist_string($optionlist,"full_name"); 1020 | my $option_desc = ""; 1021 | my $option_default_value = ""; 1022 | my $option_range = ""; 1023 | my $possible_values = ""; 1024 | my $re = qq(\Q$full_name); 1025 | if (grep (/^$re$/,$options_names[$current_line])) 1026 | { 1027 | $option_desc = weechat::infolist_string($optionlist, "description_nls"); 1028 | $option_desc = weechat::infolist_string($optionlist, "description") if ($option_desc eq ""); 1029 | $option_desc = "No help found" if ($option_desc eq ""); 1030 | $option_default_value = weechat::infolist_string($optionlist, "default_value"); 1031 | $possible_values = weechat::infolist_string($optionlist, "string_values") if (weechat::infolist_string($optionlist, "string_values") ne ""); 1032 | if ((weechat::infolist_string($optionlist, "type") eq "integer") && ($possible_values eq "")) 1033 | { 1034 | $option_range = weechat::infolist_integer($optionlist, "min") 1035 | ." .. ".weechat::infolist_integer($optionlist, "max"); 1036 | } 1037 | } 1038 | weechat::infolist_free($optionlist); 1039 | iset_title(); 1040 | 1041 | $description = weechat::color(weechat::config_color($options_iset{"color_help_option_name"})).$options_names[$current_line] 1042 | .weechat::color("bar_fg").": " 1043 | .weechat::color(weechat::config_color($options_iset{"color_help_text"})).$option_desc; 1044 | 1045 | # show additional infos like default value and possible values 1046 | 1047 | if (weechat::config_boolean($options_iset{"show_help_extra_info"}) == 1) 1048 | { 1049 | $description .= 1050 | weechat::color("bar_delim")." [" 1051 | .weechat::color("bar_fg")."default: " 1052 | .weechat::color("bar_delim")."\"" 1053 | .weechat::color(weechat::config_color($options_iset{"color_help_default_value"})).$option_default_value 1054 | .weechat::color("bar_delim")."\""; 1055 | if ($option_range ne "") 1056 | { 1057 | $description .= weechat::color("bar_fg").", values: ".$option_range; 1058 | } 1059 | if ($possible_values ne "") 1060 | { 1061 | $possible_values =~ s/\|/", "/g; # replace '|' to '", "' 1062 | $description .= weechat::color("bar_fg").", values: ". "\"" . $possible_values . "\""; 1063 | 1064 | } 1065 | $description .= weechat::color("bar_delim")."]"; 1066 | } 1067 | return $description; 1068 | } 1069 | 1070 | sub iset_check_condition_isetbar_cb 1071 | { 1072 | my ($data, $modifier, $modifier_data, $string) = ($_[0], $_[1], $_[2], $_[3]); 1073 | my $buffer = weechat::window_get_pointer($modifier_data, "buffer"); 1074 | if ($buffer ne "") 1075 | { 1076 | if ((weechat::buffer_get_string($buffer, "plugin") eq $LANG) 1077 | && (weechat::buffer_get_string($buffer, "name") eq $PRGNAME)) 1078 | { 1079 | return "1"; 1080 | } 1081 | } 1082 | return "0"; 1083 | } 1084 | 1085 | sub iset_show_bar 1086 | { 1087 | my $show = $_[0]; 1088 | my $barhidden = weechat::config_get("weechat.bar.isetbar.hidden"); 1089 | if ($barhidden) 1090 | { 1091 | if ($show) 1092 | { 1093 | if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1) 1094 | { 1095 | if (weechat::config_boolean($barhidden)) 1096 | { 1097 | weechat::config_option_set($barhidden, 0, 1); 1098 | } 1099 | } 1100 | } 1101 | else 1102 | { 1103 | if (!weechat::config_boolean($barhidden)) 1104 | { 1105 | weechat::config_option_set($barhidden, 1, 1); 1106 | } 1107 | } 1108 | } 1109 | } 1110 | 1111 | sub iset_signal_buffer_switch_cb 1112 | { 1113 | my $buffer_pointer = $_[2]; 1114 | my $show_bar = 0; 1115 | $show_bar = 1 if (weechat::buffer_get_integer($iset_buffer, "num_displayed") > 0); 1116 | iset_show_bar($show_bar); 1117 | iset_check_line_outside_window() if ($buffer_pointer eq $iset_buffer); 1118 | return weechat::WEECHAT_RC_OK; 1119 | } 1120 | 1121 | sub iset_item_cb 1122 | { 1123 | return iset_get_help(); 1124 | } 1125 | 1126 | sub iset_upgrade_ended 1127 | { 1128 | iset_full_refresh(); 1129 | } 1130 | 1131 | sub iset_end 1132 | { 1133 | # when script is unloaded, we hide bar 1134 | iset_show_bar(0); 1135 | } 1136 | 1137 | # -------------------------------[ mouse support ]------------------------------------- 1138 | 1139 | sub hook_focus_iset_cb 1140 | { 1141 | my %info = %{$_[1]}; 1142 | my $bar_item_line = int($info{"_bar_item_line"}); 1143 | undef my $hash; 1144 | if (($info{"_buffer_name"} eq $PRGNAME) && $info{"_buffer_plugin"} eq $LANG && ($bar_item_line >= 0) && ($bar_item_line <= $#iset_focus)) 1145 | { 1146 | $hash = $iset_focus[$bar_item_line]; 1147 | } 1148 | else 1149 | { 1150 | $hash = {}; 1151 | my $hash_focus = $iset_focus[0]; 1152 | foreach my $key (keys %$hash_focus) 1153 | { 1154 | $hash->{$key} = "?"; 1155 | } 1156 | } 1157 | return $hash; 1158 | } 1159 | 1160 | # _chat_line_y contains selected line 1161 | sub iset_hsignal_mouse_cb 1162 | { 1163 | my ($data, $signal, %hash) = ($_[0], $_[1], %{$_[2]}); 1164 | 1165 | if ($hash{"_buffer_name"} eq $PRGNAME && ($hash{"_buffer_plugin"} eq $LANG)) 1166 | { 1167 | if ($hash{"_key"} eq "button1") 1168 | { 1169 | iset_set_current_line($hash{"_chat_line_y"}); 1170 | } 1171 | elsif ($hash{"_key"} eq "button2") 1172 | { 1173 | if ($options_types[$hash{"_chat_line_y"}] eq "boolean") 1174 | { 1175 | iset_set_option($options_names[$hash{"_chat_line_y"}], "toggle"); 1176 | iset_set_current_line($hash{"_chat_line_y"}); 1177 | } 1178 | elsif ($options_types[$hash{"_chat_line_y"}] eq "string") 1179 | { 1180 | iset_set_current_line($hash{"_chat_line_y"}); 1181 | weechat::command("", "/$PRGNAME **set"); 1182 | } 1183 | } 1184 | elsif ($hash{"_key"} eq "button2-gesture-left" or $hash{"_key"} eq "button2-gesture-left-long") 1185 | { 1186 | if ($options_types[$hash{"_chat_line_y"}] eq "integer" or ($options_types[$hash{"_chat_line_y"}] eq "color")) 1187 | { 1188 | iset_set_current_line($hash{"_chat_line_y"}); 1189 | my $distance = distance($hash{"_chat_line_x"},$hash{"_chat_line_x2"}); 1190 | weechat::command("", "/repeat $distance /$PRGNAME **decr"); 1191 | } 1192 | } 1193 | elsif ($hash{"_key"} eq "button2-gesture-right" or $hash{"_key"} eq "button2-gesture-right-long") 1194 | { 1195 | if ($options_types[$hash{"_chat_line_y"}] eq "integer" or ($options_types[$hash{"_chat_line_y"}] eq "color")) 1196 | { 1197 | iset_set_current_line($hash{"_chat_line_y"}); 1198 | my $distance = distance($hash{"_chat_line_x"},$hash{"_chat_line_x2"}); 1199 | weechat::command("", "/repeat $distance /$PRGNAME **incr"); 1200 | } 1201 | } 1202 | } 1203 | window_switch(); 1204 | } 1205 | 1206 | sub window_switch 1207 | { 1208 | my $current_window = weechat::current_window(); 1209 | my $dest_window = weechat::window_search_with_buffer(weechat::buffer_search("perl","iset")); 1210 | return 0 if ($dest_window eq "" or $current_window eq $dest_window); 1211 | 1212 | my $infolist = weechat::infolist_get("window", $dest_window, ""); 1213 | weechat::infolist_next($infolist); 1214 | my $number = weechat::infolist_integer($infolist, "number"); 1215 | weechat::infolist_free($infolist); 1216 | weechat::command("","/window " . $number); 1217 | } 1218 | 1219 | sub distance 1220 | { 1221 | my ($x1,$x2) = ($_[0], $_[1]); 1222 | my $distance; 1223 | $distance = $x1 - $x2; 1224 | $distance = abs($distance); 1225 | if ($distance > 0) 1226 | { 1227 | use integer; 1228 | $distance = $distance / 3; 1229 | $distance = 1 if ($distance == 0); 1230 | } 1231 | elsif ($distance == 0) 1232 | { 1233 | $distance = 1; 1234 | } 1235 | return $distance; 1236 | } 1237 | 1238 | # -----------------------------------[ config ]--------------------------------------- 1239 | 1240 | sub iset_config_init 1241 | { 1242 | $iset_config_file = weechat::config_new($ISET_CONFIG_FILE_NAME,"iset_config_reload_cb",""); 1243 | return if ($iset_config_file eq ""); 1244 | 1245 | # section "color" 1246 | my $section_color = weechat::config_new_section($iset_config_file,"color", 0, 0, "", "", "", "", "", "", "", "", "", ""); 1247 | if ($section_color eq "") 1248 | { 1249 | weechat::config_free($iset_config_file); 1250 | return; 1251 | } 1252 | $options_iset{"color_option"} = weechat::config_new_option( 1253 | $iset_config_file, $section_color, 1254 | "option", "color", "Color for option name in iset buffer", "", 0, 0, 1255 | "default", "default", 0, "", "", "full_refresh_cb", "", "", ""); 1256 | $options_iset{"color_option_selected"} = weechat::config_new_option( 1257 | $iset_config_file, $section_color, 1258 | "option_selected", "color", "Color for selected option name in iset buffer", "", 0, 0, 1259 | "white", "white", 0, "", "", "full_refresh_cb", "", "", ""); 1260 | $options_iset{"color_type"} = weechat::config_new_option( 1261 | $iset_config_file, $section_color, 1262 | "type", "color", "Color for option type (integer, boolean, string)", "", 0, 0, 1263 | "brown", "brown", 0, "", "", "full_refresh_cb", "", "", ""); 1264 | $options_iset{"color_type_selected"} = weechat::config_new_option( 1265 | $iset_config_file, $section_color, 1266 | "type_selected", "color", "Color for selected option type (integer, boolean, string)", "", 0, 0, 1267 | "yellow", "yellow", 0, "", "", "full_refresh_cb", "", "", ""); 1268 | $options_iset{"color_value"} = weechat::config_new_option( 1269 | $iset_config_file, $section_color, 1270 | "value", "color", "Color for option value", "", 0, 0, 1271 | "cyan", "cyan", 0, "", "", "full_refresh_cb", "", "", ""); 1272 | $options_iset{"color_value_selected"} = weechat::config_new_option( 1273 | $iset_config_file, $section_color, 1274 | "value_selected", "color", "Color for selected option value", "", 0, 0, 1275 | "lightcyan", "lightcyan", 0, "", "", "full_refresh_cb", "", "", ""); 1276 | $options_iset{"color_value_diff"} = weechat::config_new_option( 1277 | $iset_config_file, $section_color, 1278 | "value_diff", "color", "Color for option value different from default", "", 0, 0, 1279 | "magenta", "magenta", 0, "", "", "full_refresh_cb", "", "", ""); 1280 | $options_iset{"color_value_diff_selected"} = weechat::config_new_option( 1281 | $iset_config_file, $section_color, 1282 | "value_diff_selected", "color", "Color for selected option value different from default", "", 0, 0, 1283 | "lightmagenta", "lightmagenta", 0, "", "", "full_refresh_cb", "", "", ""); 1284 | $options_iset{"color_value_undef"} = weechat::config_new_option( 1285 | $iset_config_file, $section_color, 1286 | "value_undef", "color", "Color for option value undef", "", 0, 0, 1287 | "green", "green", 0, "", "", "full_refresh_cb", "", "", ""); 1288 | $options_iset{"color_value_undef_selected"} = weechat::config_new_option( 1289 | $iset_config_file, $section_color, 1290 | "value_undef_selected", "color", "Color for selected option value undef", "", 0, 0, 1291 | "lightgreen", "lightgreen", 0, "", "", "full_refresh_cb", "", "", ""); 1292 | $options_iset{"color_bg_selected"} = weechat::config_new_option( 1293 | $iset_config_file, $section_color, 1294 | "bg_selected", "color", "Background color for current selected option", "", 0, 0, 1295 | "red", "red", 0, "", "", "full_refresh_cb", "", "", ""); 1296 | $options_iset{"color_help_option_name"} = weechat::config_new_option( 1297 | $iset_config_file, $section_color, 1298 | "help_option_name", "color", "Color for option name in help-bar", "", 0, 0, 1299 | "white", "white", 0, "", "", "bar_refresh", "", "", ""); 1300 | $options_iset{"color_help_text"} = weechat::config_new_option( 1301 | $iset_config_file, $section_color, 1302 | "help_text", "color", "Color for option description in help-bar", "", 0, 0, 1303 | "default", "default", 0, "", "", "bar_refresh", "", "", ""); 1304 | $options_iset{"color_help_default_value"} = weechat::config_new_option( 1305 | $iset_config_file, $section_color, 1306 | "help_default_value", "color", "Color for default option value in help-bar", "", 0, 0, 1307 | "green", "green", 0, "", "", "bar_refresh", "", "", ""); 1308 | 1309 | # section "help" 1310 | my $section_help = weechat::config_new_section($iset_config_file,"help", 0, 0, "", "", "", "", "", "", "", "", "", ""); 1311 | if ($section_help eq "") 1312 | { 1313 | weechat::config_free($iset_config_file); 1314 | return; 1315 | } 1316 | $options_iset{"show_help_bar"} = weechat::config_new_option( 1317 | $iset_config_file, $section_help, 1318 | "show_help_bar", "boolean", "Show help bar", "", 0, 0, 1319 | "on", "on", 0, "", "", "toggle_help_cb", "", "", ""); 1320 | $options_iset{"show_help_extra_info"} = weechat::config_new_option( 1321 | $iset_config_file, $section_help, 1322 | "show_help_extra_info", "boolean", "Show additional information in help bar (default value, max./min. value) ", "", 0, 0, 1323 | "on", "on", 0, "", "", "", "", "", ""); 1324 | $options_iset{"show_plugin_description"} = weechat::config_new_option( 1325 | $iset_config_file, $section_help, 1326 | "show_plugin_description", "boolean", "Show plugin description in iset buffer", "", 0, 0, 1327 | "off", "off", 0, "", "", "full_refresh_cb", "", "", ""); 1328 | 1329 | # section "look" 1330 | my $section_look = weechat::config_new_section($iset_config_file, "look", 0, 0, "", "", "", "", "", "", "", "", "", ""); 1331 | if ($section_look eq "") 1332 | { 1333 | weechat::config_free($iset_config_file); 1334 | return; 1335 | } 1336 | $options_iset{"value_search_char"} = weechat::config_new_option( 1337 | $iset_config_file, $section_look, 1338 | "value_search_char", "string", "Trigger char to tell iset to search for value instead of option (for example: =red)", "", 0, 0, 1339 | "=", "=", 0, "", "", "", "", "", ""); 1340 | $options_iset{"scroll_horiz"} = weechat::config_new_option( 1341 | $iset_config_file, $section_look, 1342 | "scroll_horiz", "integer", "scroll content of iset buffer n%", "", 1, 100, 1343 | "10", "10", 0, "", "", "", "", "", ""); 1344 | $options_iset{"show_current_line"} = weechat::config_new_option( 1345 | $iset_config_file, $section_look, 1346 | "show_current_line", "boolean", "show current line in title bar.", "", 0, 0, 1347 | "on", "on", 0, "", "", "", "", "", ""); 1348 | $options_iset{"use_mute"} = weechat::config_new_option( 1349 | $iset_config_file, $section_look, 1350 | "use_mute", "boolean", "/mute command will be used in input bar", "", 0, 0, 1351 | "off", "off", 0, "", "", "", "", "", ""); 1352 | } 1353 | 1354 | sub iset_config_reload_cb 1355 | { 1356 | my ($data,$config_file) = ($_[0], $_[1]); 1357 | return weechat::config_reload($config_file) 1358 | } 1359 | 1360 | sub iset_config_read 1361 | { 1362 | return weechat::config_read($iset_config_file) if ($iset_config_file ne ""); 1363 | } 1364 | 1365 | sub iset_config_write 1366 | { 1367 | return weechat::config_write($iset_config_file) if ($iset_config_file ne ""); 1368 | } 1369 | 1370 | sub full_refresh_cb 1371 | { 1372 | iset_full_refresh(); 1373 | return weechat::WEECHAT_RC_OK; 1374 | } 1375 | 1376 | sub bar_refresh 1377 | { 1378 | iset_get_help(1); 1379 | weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1); 1380 | return weechat::WEECHAT_RC_OK; 1381 | } 1382 | 1383 | sub toggle_help_cb 1384 | { 1385 | my $value = weechat::config_boolean($options_iset{"show_help_bar"}); 1386 | iset_show_bar($value); 1387 | return weechat::WEECHAT_RC_OK; 1388 | } 1389 | 1390 | # -----------------------------------[ main ]----------------------------------------- 1391 | 1392 | weechat::register($PRGNAME, $AUTHOR, $VERSION, $LICENSE, 1393 | $DESCR, "iset_end", ""); 1394 | 1395 | $wee_version_number = weechat::info_get("version_number", "") || 0; 1396 | 1397 | iset_config_init(); 1398 | iset_config_read(); 1399 | 1400 | weechat::hook_command($PRGNAME, "Interactive set", "f || s
|| [=][=]", 1401 | "f file : show options for a file\n". 1402 | "s section: show options for a section\n". 1403 | "text : show options with 'text' in name\n". 1404 | weechat::config_string($options_iset{"value_search_char"})."text : show options with 'text' in value\n". 1405 | weechat::config_string($options_iset{"value_search_char"}).weechat::config_string($options_iset{"value_search_char"})."text : show options with exact 'text' in value\n\n". 1406 | "Keys for iset buffer:\n". 1407 | "f11,f12 : move iset content left/right\n". 1408 | "up,down : move one option up/down\n". 1409 | "pgup,pdwn : move one page up/down\n". 1410 | "home,end : move to first/last option\n". 1411 | "ctrl+'L' : refresh options and screen\n". 1412 | "alt+space : toggle boolean on/off\n". 1413 | "alt+'+' : increase value (for integer or color)\n". 1414 | "alt+'-' : decrease value (for integer or color)\n". 1415 | "alt+'i',alt+'r': reset value of option\n". 1416 | "alt+'i',alt+'u': unset option\n". 1417 | "alt+enter : set new value for option (edit it with command line)\n". 1418 | "text,enter : set a new filter using command line (use '*' to see all options)\n". 1419 | "alt+'v' : toggle help bar on/off\n". 1420 | "alt+'p' : toggle option \"show_plugin_description\" on/off\n". 1421 | "\n". 1422 | "Mouse actions:\n". 1423 | "wheel up/down : move cursor up/down\n". 1424 | "left button : select an option from list\n". 1425 | "right button : toggle boolean (on/off) or set a new value for option (edit it with command line)\n". 1426 | "right button + drag left/right: increase/decrease value (for integer or color)\n". 1427 | "\n". 1428 | "Examples:\n". 1429 | " show options for file 'weechat'\n". 1430 | " /iset f weechat\n". 1431 | " show options for file 'irc'\n". 1432 | " /iset f irc\n". 1433 | " show options for section 'look'\n". 1434 | " /iset s look\n". 1435 | " show all options with text 'nicklist' in name\n". 1436 | " /iset nicklist\n". 1437 | " show all values which contain 'red'. ('" . weechat::config_string($options_iset{"value_search_char"}) . "' is a trigger char).\n". 1438 | " /iset ". weechat::config_string($options_iset{"value_search_char"}) ."red\n". 1439 | " show all values which hit 'off'. ('" . weechat::config_string($options_iset{"value_search_char"}) . weechat::config_string($options_iset{"value_search_char"}) . "' is a trigger char).\n". 1440 | " /iset ". weechat::config_string($options_iset{"value_search_char"}) . weechat::config_string($options_iset{"value_search_char"}) ."off\n". 1441 | " show options for file 'weechat' which contains value 'off'\n". 1442 | " /iset f weechat ".weechat::config_string($options_iset{"value_search_char"})."off\n". 1443 | "", 1444 | "", "iset_cmd_cb", ""); 1445 | weechat::hook_signal("upgrade_ended", "iset_upgrade_ended", ""); 1446 | weechat::hook_signal("window_scrolled", "iset_signal_window_scrolled_cb", ""); 1447 | weechat::hook_signal("buffer_switch", "iset_signal_buffer_switch_cb",""); 1448 | weechat::bar_item_new("isetbar_help", "iset_item_cb", ""); 1449 | weechat::bar_new("isetbar", "on", "0", "window", "", "top", "horizontal", 1450 | "vertical", "3", "3", "default", "cyan", "default", "1", 1451 | "isetbar_help"); 1452 | weechat::hook_modifier("bar_condition_isetbar", "iset_check_condition_isetbar_cb", ""); 1453 | weechat::hook_config("*", "iset_config_cb", ""); 1454 | $iset_buffer = weechat::buffer_search($LANG, $PRGNAME); 1455 | iset_init() if ($iset_buffer ne ""); 1456 | 1457 | if ($wee_version_number >= 0x00030600) 1458 | { 1459 | weechat::hook_focus("chat", "hook_focus_iset_cb", ""); 1460 | weechat::hook_hsignal($PRGNAME."_mouse", "iset_hsignal_mouse_cb", ""); 1461 | weechat::key_bind("mouse", \%mouse_keys); 1462 | } 1463 | -------------------------------------------------------------------------------- /weechat/.weechat/plugins.conf: -------------------------------------------------------------------------------- 1 | # 2 | # plugins.conf -- weechat v1.0.1 3 | # 4 | 5 | [var] 6 | fifo.fifo = "on" 7 | guile.check_license = "off" 8 | lua.check_license = "off" 9 | perl.check_license = "off" 10 | perl.highmon.alignment = "channel" 11 | perl.highmon.away_only = "off" 12 | perl.highmon.color_buf = "on" 13 | perl.highmon.first_run = "true" 14 | perl.highmon.hotlist_show = "off" 15 | perl.highmon.logging = "off" 16 | perl.highmon.merge_private = "off" 17 | perl.highmon.nick_prefix = "<" 18 | perl.highmon.nick_suffix = ">" 19 | perl.highmon.output = "buffer" 20 | perl.highmon.short_names = "off" 21 | python.apply_corrections.check_every = "5" 22 | python.apply_corrections.data_timeout = "60" 23 | python.apply_corrections.message_limit = "2" 24 | python.apply_corrections.print_format = "[nick]: [corrected]" 25 | python.apply_corrections.print_limit = "1" 26 | python.autojoin.autosave = "off" 27 | python.check_license = "off" 28 | python.grep.clear_buffer = "off" 29 | python.grep.default_tail_head = "10" 30 | python.grep.go_to_buffer = "on" 31 | python.grep.log_filter = "" 32 | python.grep.max_lines = "4000" 33 | python.grep.show_summary = "on" 34 | python.grep.size_limit = "2048" 35 | python.screen_away.away_suffix = "" 36 | python.screen_away.command_on_attach = "" 37 | python.screen_away.command_on_detach = "" 38 | python.screen_away.ignore = "" 39 | python.screen_away.ignore_relays = "off" 40 | python.screen_away.interval = "5" 41 | python.screen_away.message = "Detached from screen" 42 | python.screen_away.set_away = "on" 43 | python.screen_away.time_format = "since %Y-%m-%d %H:%M:%S%z" 44 | ruby.check_license = "off" 45 | tcl.check_license = "off" 46 | 47 | [desc] 48 | python.apply_corrections.check_every = "Interval between each check for expired messages." 49 | python.apply_corrections.data_timeout = "Time before a message is expired." 50 | python.apply_corrections.message_limit = "Number of messages to store per nick." 51 | python.apply_corrections.print_format = "Format string for the printed corrections." 52 | python.apply_corrections.print_limit = "Maximum number of lines to correct." 53 | python.screen_away.away_suffix = "What to append to your nick when you're away." 54 | python.screen_away.command_on_attach = "Commands to execute on attach, separated by semicolon" 55 | python.screen_away.command_on_detach = "Commands to execute on detach, separated by semicolon" 56 | python.screen_away.ignore = "Comma-separated list of servers to ignore." 57 | python.screen_away.ignore_relays = "Only check screen status and ignore relay interfaces" 58 | python.screen_away.interval = "How often in seconds to check screen status" 59 | python.screen_away.message = "Away message" 60 | python.screen_away.set_away = "Set user as away." 61 | python.screen_away.time_format = "time format append to away message" 62 | -------------------------------------------------------------------------------- /weechat/.weechat/python/autojoin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (c) 2009 by xt 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | # (this script requires WeeChat 0.3.0 or newer) 20 | # 21 | # History: 22 | # 2009-06-18, xt 23 | # version 0.1: initial release 24 | # 25 | # 2009-10-18, LBo 26 | # version 0.2: added autosaving of join channels 27 | # /set plugins.var.python.autojoin.autosave 'on' 28 | # 29 | # 2009-10-19, LBo 30 | # version 0.2.1: now only responds to part messages from self 31 | # find_channels() only returns join'ed channels, not all the buffers 32 | # updated description and docs 33 | # 34 | # 2009-10-20, LBo 35 | # version 0.2.2: fixed quit callback 36 | # removed the callbacks on part & join messages 37 | # 38 | # 2012-04-14, Filip H.F. "FiXato" Slagter 39 | # version 0.2.3: fixed bug with buffers of which short names were changed. 40 | # Now using 'name' from irc_channel infolist. 41 | # version 0.2.4: Added support for key-protected channels 42 | # 43 | # 2014-05-22, Nathaniel Wesley Filardo 44 | # version 0.2.5: Fix keyed channel support 45 | # 46 | # @TODO: add options to ignore certain buffers 47 | # @TODO: maybe add an option to enable autosaving on part/join messages 48 | 49 | import weechat as w 50 | import re 51 | 52 | SCRIPT_NAME = "autojoin" 53 | SCRIPT_AUTHOR = "xt " 54 | SCRIPT_VERSION = "0.2.5" 55 | SCRIPT_LICENSE = "GPL3" 56 | SCRIPT_DESC = "Configure autojoin for all servers according to currently joined channels" 57 | SCRIPT_COMMAND = "autojoin" 58 | 59 | # script options 60 | settings = { 61 | "autosave": "off", 62 | } 63 | 64 | if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", ""): 65 | 66 | w.hook_command(SCRIPT_COMMAND, 67 | SCRIPT_DESC, 68 | "[--run]", 69 | " --run: actually run the commands instead of displaying\n", 70 | "--run", 71 | "autojoin_cb", 72 | "") 73 | 74 | #w.hook_signal('*,irc_in2_join', 'autosave_channels_on_activity', '') 75 | #w.hook_signal('*,irc_in2_part', 'autosave_channels_on_activity', '') 76 | w.hook_signal('quit', 'autosave_channels_on_quit', '') 77 | 78 | # Init everything 79 | for option, default_value in settings.items(): 80 | if w.config_get_plugin(option) == "": 81 | w.config_set_plugin(option, default_value) 82 | 83 | def autosave_channels_on_quit(signal, callback, callback_data): 84 | ''' Autojoin current channels ''' 85 | if w.config_get_plugin(option) != "on": 86 | return w.WEECHAT_RC_OK 87 | 88 | items = find_channels() 89 | 90 | # print/execute commands 91 | for server, channels in items.iteritems(): 92 | channels = channels.rstrip(',') 93 | command = "/set irc.server.%s.autojoin '%s'" % (server, channels) 94 | w.command('', command) 95 | 96 | return w.WEECHAT_RC_OK 97 | 98 | 99 | def autosave_channels_on_activity(signal, callback, callback_data): 100 | ''' Autojoin current channels ''' 101 | if w.config_get_plugin(option) != "on": 102 | return w.WEECHAT_RC_OK 103 | 104 | items = find_channels() 105 | 106 | # print/execute commands 107 | for server, channels in items.iteritems(): 108 | nick = w.info_get('irc_nick', server) 109 | 110 | pattern = "^:%s!.*(JOIN|PART) :?(#[^ ]*)( :.*$)?" % nick 111 | match = re.match(pattern, callback_data) 112 | 113 | if match: # check if nick is my nick. In that case: save 114 | channel = match.group(2) 115 | channels = channels.rstrip(',') 116 | command = "/set irc.server.%s.autojoin '%s'" % (server, channels) 117 | w.command('', command) 118 | else: # someone else: ignore 119 | continue 120 | 121 | return w.WEECHAT_RC_OK 122 | 123 | def autojoin_cb(data, buffer, args): 124 | """Old behaviour: doesn't save empty channel list""" 125 | """In fact should also save open buffers with a /part'ed channel""" 126 | """But I can't believe somebody would want that behaviour""" 127 | items = find_channels() 128 | 129 | # print/execute commands 130 | for server, channels in items.iteritems(): 131 | channels = channels.rstrip(',') 132 | if not channels: # empty channel list 133 | continue 134 | command = '/set irc.server.%s.autojoin %s' % (server, channels) 135 | if args == '--run': 136 | w.command('', command) 137 | else: 138 | w.prnt('', command) 139 | 140 | return w.WEECHAT_RC_OK 141 | 142 | def find_channels(): 143 | """Return list of servers and channels""" 144 | #@TODO: make it return a dict with more options like "nicks_count etc." 145 | items = {} 146 | infolist = w.infolist_get('irc_server', '', '') 147 | # populate servers 148 | while w.infolist_next(infolist): 149 | items[w.infolist_string(infolist, 'name')] = '' 150 | 151 | w.infolist_free(infolist) 152 | 153 | # populate channels per server 154 | for server in items.keys(): 155 | keys = [] 156 | keyed_channels = [] 157 | unkeyed_channels = [] 158 | items[server] = '' #init if connected but no channels 159 | infolist = w.infolist_get('irc_channel', '', server) 160 | while w.infolist_next(infolist): 161 | if w.infolist_integer(infolist, 'nicks_count') == 0: 162 | #parted but still open in a buffer: bit hackish 163 | continue 164 | if w.infolist_integer(infolist, 'type') == 0: 165 | key = w.infolist_string(infolist, "key") 166 | if len(key) > 0: 167 | keys.append(key) 168 | keyed_channels.append(w.infolist_string(infolist, "name")) 169 | else : 170 | unkeyed_channels.append(w.infolist_string(infolist, "name")) 171 | items[server] = ','.join(keyed_channels + unkeyed_channels) 172 | if len(keys) > 0: 173 | items[server] += ' %s' % ','.join(keys) 174 | w.infolist_free(infolist) 175 | 176 | return items 177 | 178 | -------------------------------------------------------------------------------- /weechat/.weechat/python/autoload/autojoin.py: -------------------------------------------------------------------------------- 1 | ../autojoin.py -------------------------------------------------------------------------------- /weechat/.weechat/python/autoload/grep.py: -------------------------------------------------------------------------------- 1 | ../grep.py -------------------------------------------------------------------------------- /weechat/.weechat/python/autoload/otr.py: -------------------------------------------------------------------------------- 1 | ../otr.py -------------------------------------------------------------------------------- /weechat/.weechat/python/autoload/screen_away.py: -------------------------------------------------------------------------------- 1 | ../screen_away.py -------------------------------------------------------------------------------- /weechat/.weechat/python/autoload/urlview.py: -------------------------------------------------------------------------------- 1 | ../urlview.py -------------------------------------------------------------------------------- /weechat/.weechat/python/screen_away.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (c) 2009 by xt 4 | # Copyright (c) 2009 by penryu 5 | # Copyright (c) 2010 by Blake Winton 6 | # Copyright (c) 2010 by Aron Griffis 7 | # Copyright (c) 2010 by Jani Kesänen 8 | # 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | # 22 | 23 | # 24 | # (this script requires WeeChat 0.3.0 or newer) 25 | # 26 | # History: 27 | # 2014-08-02, Nils Görs 28 | # version 0.14: add time to detach message. (idea by Mikaela) 29 | # 2014-06-19, Anders Bergh 30 | # version 0.13: Fix a simple typo in an option description. 31 | # 2014-01-12, Phyks (Lucas Verney) 32 | # version 0.12: Added an option to check status of relays to set unaway in 33 | # case of a connected relay. 34 | # 2013-08-30, Anders Einar Hilden 35 | # version: 0.11: Fix reading of set_away 36 | # 2013-06-16, Renato Botelho 37 | # version 0.10: add option to don't set away, only change nick 38 | # allow multiple commands on attach/dettach 39 | # do not add suffix if nick already have it 40 | # 2012-12-29, David Flatz 41 | # version 0.9: add option to ignore servers and don't set away status for them 42 | # add descriptions to config options 43 | # 2010-08-07, Filip H.F. "FiXato" Slagter 44 | # version 0.8: add command on attach feature 45 | # 2010-05-07, Jani Kesänen 46 | # version 0.7: add command on detach feature 47 | # 2010-03-07, Aron Griffis 48 | # version 0.6: move socket check to register, 49 | # add hook_config for interval, 50 | # reduce default interval from 60 to 5 51 | # 2010-02-19, Blake Winton 52 | # version 0.5: add option to change nick when away 53 | # 2010-01-18, xt 54 | # version 0.4: only update servers that are connected 55 | # 2009-11-30, xt 56 | # version 0.3: do not touch servers that are manually set away 57 | # 2009-11-27, xt 58 | # version 0.2: code for TMUX from penryu 59 | # 2009-11-27, xt 60 | # version 0.1: initial release 61 | 62 | import weechat as w 63 | import re 64 | import os 65 | import datetime, time 66 | 67 | SCRIPT_NAME = "screen_away" 68 | SCRIPT_AUTHOR = "xt " 69 | SCRIPT_VERSION = "0.14" 70 | SCRIPT_LICENSE = "GPL3" 71 | SCRIPT_DESC = "Set away status on screen detach" 72 | 73 | settings = { 74 | 'message': ('Detached from screen', 'Away message'), 75 | 'time_format': ('since %Y-%m-%d %H:%M:%S%z', 'time format append to away message'), 76 | 'interval': ('5', 'How often in seconds to check screen status'), 77 | 'away_suffix': ('', 'What to append to your nick when you\'re away.'), 78 | 'command_on_attach': ('', 'Commands to execute on attach, separated by semicolon'), 79 | 'command_on_detach': ('', 'Commands to execute on detach, separated by semicolon'), 80 | 'ignore': ('', 'Comma-separated list of servers to ignore.'), 81 | 'set_away': ('on', 'Set user as away.'), 82 | 'ignore_relays': ('off', 'Only check screen status and ignore relay interfaces'), 83 | } 84 | 85 | TIMER = None 86 | SOCK = None 87 | AWAY = False 88 | CONNECTED_RELAY = False 89 | 90 | def set_timer(): 91 | '''Update timer hook with new interval''' 92 | 93 | global TIMER 94 | if TIMER: 95 | w.unhook(TIMER) 96 | TIMER = w.hook_timer(int(w.config_get_plugin('interval')) * 1000, 97 | 0, 0, "screen_away_timer_cb", '') 98 | 99 | def screen_away_config_cb(data, option, value): 100 | if option.endswith(".interval"): 101 | set_timer() 102 | return w.WEECHAT_RC_OK 103 | 104 | def get_servers(): 105 | '''Get the servers that are not away, or were set away by this script''' 106 | 107 | ignores = w.config_get_plugin('ignore').split(',') 108 | infolist = w.infolist_get('irc_server','','') 109 | buffers = [] 110 | while w.infolist_next(infolist): 111 | if not w.infolist_integer(infolist, 'is_connected') == 1 or \ 112 | w.infolist_string(infolist, 'name') in ignores: 113 | continue 114 | if not w.config_string_to_boolean(w.config_get_plugin('set_away')) or \ 115 | not w.infolist_integer(infolist, 'is_away') or \ 116 | w.config_get_plugin('message') in w.infolist_string(infolist, 'away_message'): 117 | # w.infolist_string(infolist, 'away_message') == \ 118 | # w.config_get_plugin('message'): 119 | buffers.append((w.infolist_pointer(infolist, 'buffer'), 120 | w.infolist_string(infolist, 'nick'))) 121 | w.infolist_free(infolist) 122 | return buffers 123 | 124 | def screen_away_timer_cb(buffer, args): 125 | '''Check if screen is attached, update awayness''' 126 | 127 | global AWAY, SOCK, CONNECTED_RELAY 128 | 129 | set_away = w.config_string_to_boolean(w.config_get_plugin('set_away')) 130 | check_relays = not w.config_string_to_boolean(w.config_get_plugin('ignore_relays')) 131 | suffix = w.config_get_plugin('away_suffix') 132 | attached = os.access(SOCK, os.X_OK) # X bit indicates attached 133 | 134 | # Check wether a client is connected on relay or not 135 | CONNECTED_RELAY = False 136 | if check_relays: 137 | infolist = w.infolist_get('relay', '', '') 138 | if infolist: 139 | while w.infolist_next(infolist): 140 | status = w.infolist_string(infolist, 'status_string') 141 | if status == 'connected': 142 | CONNECTED_RELAY = True 143 | break 144 | w.infolist_free(infolist) 145 | 146 | if (attached and AWAY) or (check_relays and CONNECTED_RELAY and not attached and AWAY): 147 | w.prnt('', '%s: Screen attached. Clearing away status' % SCRIPT_NAME) 148 | for server, nick in get_servers(): 149 | if set_away: 150 | w.command(server, "/away") 151 | if suffix and nick.endswith(suffix): 152 | nick = nick[:-len(suffix)] 153 | w.command(server, "/nick %s" % nick) 154 | AWAY = False 155 | for cmd in w.config_get_plugin("command_on_attach").split(";"): 156 | w.command("", cmd) 157 | 158 | elif not attached and not AWAY: 159 | if not CONNECTED_RELAY: 160 | w.prnt('', '%s: Screen detached. Setting away status' % SCRIPT_NAME) 161 | for server, nick in get_servers(): 162 | if suffix and not nick.endswith(suffix): 163 | w.command(server, "/nick %s%s" % (nick, suffix)); 164 | if set_away: 165 | w.command(server, "/away %s %s" % (w.config_get_plugin('message'), time.strftime(w.config_get_plugin('time_format')))) 166 | AWAY = True 167 | for cmd in w.config_get_plugin("command_on_detach").split(";"): 168 | w.command("", cmd) 169 | 170 | return w.WEECHAT_RC_OK 171 | 172 | 173 | if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, 174 | SCRIPT_DESC, "", ""): 175 | version = w.info_get('version_number', '') or 0 176 | for option, default_desc in settings.iteritems(): 177 | if not w.config_is_set_plugin(option): 178 | w.config_set_plugin(option, default_desc[0]) 179 | if int(version) >= 0x00030500: 180 | w.config_set_desc_plugin(option, default_desc[1]) 181 | 182 | if 'STY' in os.environ.keys(): 183 | # We are running under screen 184 | cmd_output = os.popen('env LC_ALL=C screen -ls').read() 185 | match = re.search(r'Sockets? in (/.+)\.', cmd_output) 186 | if match: 187 | SOCK = os.path.join(match.group(1), os.environ['STY']) 188 | 189 | if not SOCK and 'TMUX' in os.environ.keys(): 190 | # We are running under tmux 191 | socket_data = os.environ['TMUX'] 192 | SOCK = socket_data.rsplit(',',2)[0] 193 | 194 | if SOCK: 195 | set_timer() 196 | w.hook_config("plugins.var.python." + SCRIPT_NAME + ".*", 197 | "screen_away_config_cb", "") 198 | -------------------------------------------------------------------------------- /weechat/.weechat/python/urlview.py: -------------------------------------------------------------------------------- 1 | # This weechat plugin pipes the current weechat buffer through urlview 2 | # 3 | # Usage: 4 | # /urlview 5 | # 6 | # History: 7 | # 10-04-2015 8 | # Version 1.0.0: initial release 9 | # Version 1.0.1: reverse text passed to urlview 10 | # Version 1.0.2: remove weechat color from messages 11 | 12 | import distutils.spawn 13 | import os 14 | import pipes 15 | import weechat 16 | 17 | 18 | def urlview(data, buf, args): 19 | infolist = weechat.infolist_get("buffer_lines", buf, "") 20 | lines = [] 21 | while weechat.infolist_next(infolist) == 1: 22 | lines.append( 23 | weechat.string_remove_color( 24 | weechat.infolist_string(infolist, "message"), 25 | "" 26 | ) 27 | ) 28 | 29 | weechat.infolist_free(infolist) 30 | 31 | if not lines: 32 | weechat.prnt(buf, "No URLs found") 33 | return weechat.WEECHAT_RC_OK 34 | 35 | text = "\n".join(reversed(lines)) 36 | response = os.system("echo %s | urlview" % pipes.quote(text)) 37 | if response != 0: 38 | weechat.prnt(buf, "No URLs found") 39 | 40 | weechat.command(buf, "/window refresh") 41 | 42 | return weechat.WEECHAT_RC_OK 43 | 44 | 45 | def main(): 46 | if distutils.spawn.find_executable("urlview") is None: 47 | return weechat.WEECHAT_RC_ERROR 48 | 49 | if not weechat.register("urlview", "Keith Smiley", "1.0.2", "MIT", 50 | "Use urlview on the current buffer", "", ""): 51 | return weechat.WEECHAT_RC_ERROR 52 | 53 | weechat.hook_command("urlview", "Pass the current buffer to urlview", "", 54 | "", "", "urlview", "") 55 | 56 | if __name__ == "__main__": 57 | main() 58 | -------------------------------------------------------------------------------- /weechat/.weechat/relay.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relay.conf -- weechat v1.0.1 3 | # 4 | 5 | [look] 6 | auto_open_buffer = on 7 | raw_messages = 256 8 | 9 | [color] 10 | client = cyan 11 | status_active = lightblue 12 | status_auth_failed = lightred 13 | status_connecting = 130 14 | status_disconnected = lightred 15 | status_waiting_auth = brown 16 | text = default 17 | text_bg = default 18 | text_selected = white 19 | 20 | [network] 21 | allowed_ips = "" 22 | bind_address = "" 23 | clients_purge_delay = 0 24 | compression_level = 6 25 | ipv6 = on 26 | max_clients = 5 27 | password = "" 28 | ssl_cert_key = "%h/ssl/relay.pem" 29 | websocket_allowed_origins = "" 30 | 31 | [irc] 32 | backlog_max_minutes = 1440 33 | backlog_max_number = 256 34 | backlog_since_last_disconnect = on 35 | backlog_tags = "irc_privmsg" 36 | backlog_time_format = "[%H:%M] " 37 | 38 | [port] 39 | -------------------------------------------------------------------------------- /weechat/.weechat/script.conf: -------------------------------------------------------------------------------- 1 | # 2 | # script.conf -- weechat v1.0.1 3 | # 4 | 5 | [look] 6 | columns = "%s %n %V %v %u │ %d │ %t" 7 | diff_color = on 8 | diff_command = "auto" 9 | display_source = on 10 | quiet_actions = on 11 | sort = "p,n" 12 | translate_description = on 13 | use_keys = on 14 | 15 | [color] 16 | status_autoloaded = cyan 17 | status_held = white 18 | status_installed = lightcyan 19 | status_obsolete = lightmagenta 20 | status_popular = 130 21 | status_running = lightgreen 22 | status_unknown = lightred 23 | text = default 24 | text_bg = default 25 | text_bg_selected = 235 26 | text_date = default 27 | text_date_selected = white 28 | text_delimiters = 130 29 | text_description = default 30 | text_description_selected = white 31 | text_extension = default 32 | text_extension_selected = white 33 | text_name = cyan 34 | text_name_selected = lightcyan 35 | text_selected = white 36 | text_tags = brown 37 | text_tags_selected = 130 38 | text_version = magenta 39 | text_version_loaded = default 40 | text_version_loaded_selected = white 41 | text_version_selected = lightmagenta 42 | 43 | [scripts] 44 | autoload = on 45 | cache_expire = 1440 46 | download_timeout = 30 47 | path = "%h/script" 48 | hold = "" 49 | url = "http://weechat.org/files/plugins.xml.gz" 50 | url_force_https = on 51 | -------------------------------------------------------------------------------- /weechat/.weechat/script/plugins.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hashbang/dotfiles/9d4ffd7e33814df1dfabcd48aca26a30ac6ee6f2/weechat/.weechat/script/plugins.xml.gz -------------------------------------------------------------------------------- /weechat/.weechat/sec.conf: -------------------------------------------------------------------------------- 1 | # 2 | # sec.conf -- weechat v1.0.1 3 | # 4 | 5 | [crypt] 6 | cipher = aes256 7 | hash_algo = sha256 8 | passphrase_file = "" 9 | salt = on 10 | 11 | [data] 12 | -------------------------------------------------------------------------------- /weechat/.weechat/trigger.conf: -------------------------------------------------------------------------------- 1 | # 2 | # trigger.conf -- weechat v1.0.1 3 | # 4 | 5 | [look] 6 | enabled = on 7 | monitor_strip_colors = off 8 | 9 | [color] 10 | flag_command = lightgreen 11 | flag_conditions = 130 12 | flag_regex = lightcyan 13 | flag_return_code = lightmagenta 14 | regex = white 15 | replace = cyan 16 | trigger = green 17 | trigger_disabled = red 18 | 19 | [trigger] 20 | beep.arguments = "" 21 | beep.command = "/print -beep" 22 | beep.conditions = "${tg_highlight} || ${tg_msg_pv}" 23 | beep.enabled = on 24 | beep.hook = print 25 | beep.regex = "" 26 | beep.return_code = ok 27 | cmd_pass.arguments = "5000|input_text_display;5000|history_add;5000|irc_command_auth" 28 | cmd_pass.command = "" 29 | cmd_pass.conditions = "" 30 | cmd_pass.enabled = on 31 | cmd_pass.hook = modifier 32 | 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:+}}" 33 | cmd_pass.return_code = ok 34 | msg_auth.arguments = "5000|irc_message_auth" 35 | msg_auth.command = "" 36 | msg_auth.conditions = "" 37 | msg_auth.enabled = on 38 | msg_auth.hook = modifier 39 | msg_auth.regex = "==^(.*(id|identify|register|ghost +[^ ]+|release +[^ ]+) +)(.*)==${re:1}${hide:*,${re:+}}" 40 | msg_auth.return_code = ok 41 | server_pass.arguments = "5000|input_text_display;5000|history_add" 42 | server_pass.command = "" 43 | server_pass.conditions = "" 44 | server_pass.enabled = on 45 | server_pass.hook = modifier 46 | server_pass.regex = "==^(/(server|connect) .*-(sasl_)?password=)([^ ]+)(.*)==${re:1}${hide:*,${re:4}}${re:5}" 47 | server_pass.return_code = ok 48 | -------------------------------------------------------------------------------- /weechat/.weechat/weechat.conf: -------------------------------------------------------------------------------- 1 | # 2 | # weechat.conf -- weechat v1.0.1 3 | # 4 | 5 | [debug] 6 | 7 | [startup] 8 | command_after_plugins = "" 9 | command_before_plugins = "" 10 | display_logo = on 11 | display_version = on 12 | sys_rlimit = "" 13 | 14 | [look] 15 | align_end_of_lines = message 16 | bar_more_down = "++" 17 | bar_more_left = "<<" 18 | bar_more_right = ">>" 19 | bar_more_up = "--" 20 | bare_display_exit_on_input = on 21 | bare_display_time_format = "%H:%M" 22 | buffer_auto_renumber = on 23 | buffer_notify_default = all 24 | buffer_position = end 25 | buffer_search_case_sensitive = off 26 | buffer_search_force_default = off 27 | buffer_search_regex = off 28 | buffer_search_where = prefix_message 29 | buffer_time_format = "${color:250}%H${color:lightcyan}:${color:245}%M${color:lightcyan}:${color:240}%S" 30 | color_basic_force_bold = off 31 | color_inactive_buffer = on 32 | color_inactive_message = on 33 | color_inactive_prefix = on 34 | color_inactive_prefix_buffer = on 35 | color_inactive_time = off 36 | color_inactive_window = on 37 | color_nick_offline = on 38 | color_pairs_auto_reset = 5 39 | color_real_white = off 40 | command_chars = "" 41 | confirm_quit = off 42 | day_change = on 43 | day_change_message_1date = "-- %a, %d %b %Y --" 44 | day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --" 45 | eat_newline_glitch = off 46 | emphasized_attributes = "" 47 | highlight = "" 48 | highlight_regex = "" 49 | highlight_tags = "" 50 | hotlist_add_conditions = "${away} || ${buffer.num_displayed} == 0" 51 | hotlist_buffer_separator = ", " 52 | hotlist_count_max = 2 53 | hotlist_count_min_msg = 2 54 | hotlist_names_count = 3 55 | hotlist_names_length = 0 56 | hotlist_names_level = 12 57 | hotlist_names_merged_buffers = off 58 | hotlist_prefix = "H: " 59 | hotlist_remove = merged 60 | hotlist_short_names = on 61 | hotlist_sort = group_time_asc 62 | hotlist_suffix = "" 63 | hotlist_unique_numbers = on 64 | input_cursor_scroll = 20 65 | input_share = none 66 | input_share_overwrite = off 67 | input_undo_max = 32 68 | item_buffer_filter = "*" 69 | item_buffer_zoom = "!" 70 | item_time_format = "%H:%M" 71 | jump_current_to_previous_buffer = on 72 | jump_previous_buffer_when_closing = on 73 | jump_smart_back_to_buffer = on 74 | key_bind_safe = on 75 | mouse = off 76 | mouse_timer_delay = 100 77 | nick_prefix = "" 78 | nick_suffix = "" 79 | paste_bracketed = on 80 | paste_bracketed_timer_delay = 10 81 | paste_max_lines = 1 82 | prefix_action = " *" 83 | prefix_align = right 84 | prefix_align_max = 15 85 | prefix_align_min = 15 86 | prefix_align_more = "+" 87 | prefix_align_more_after = on 88 | prefix_buffer_align = right 89 | prefix_buffer_align_max = 0 90 | prefix_buffer_align_more = "+" 91 | prefix_buffer_align_more_after = on 92 | prefix_error = "=!=" 93 | prefix_join = "-->" 94 | prefix_network = "--" 95 | prefix_quit = "<--" 96 | prefix_same_nick = "" 97 | prefix_suffix = "│" 98 | read_marker = line 99 | read_marker_always_show = off 100 | read_marker_string = "- " 101 | save_config_on_exit = on 102 | save_layout_on_exit = none 103 | scroll_amount = 3 104 | scroll_bottom_after_switch = off 105 | scroll_page_percent = 100 106 | search_text_not_found_alert = on 107 | separator_horizontal = "-" 108 | separator_vertical = "" 109 | tab_width = 1 110 | time_format = "%a, %d %b %Y %T" 111 | window_auto_zoom = off 112 | window_separator_horizontal = on 113 | window_separator_vertical = on 114 | window_title = "WeeChat ${info:version}" 115 | 116 | [palette] 117 | 118 | [color] 119 | bar_more = lightcyan 120 | chat = default 121 | chat_bg = default 122 | chat_buffer = white 123 | chat_channel = white 124 | chat_day_change = cyan 125 | chat_delimiters = 235 126 | chat_highlight = lightcyan 127 | chat_highlight_bg = 235 128 | chat_host = cyan 129 | chat_inactive_buffer = default 130 | chat_inactive_window = default 131 | chat_nick = lightcyan 132 | chat_nick_colors = "cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue" 133 | chat_nick_offline = blue 134 | chat_nick_offline_highlight = default 135 | chat_nick_offline_highlight_bg = blue 136 | chat_nick_other = cyan 137 | chat_nick_prefix = green 138 | chat_nick_self = red 139 | chat_nick_suffix = green 140 | chat_prefix_action = white 141 | chat_prefix_buffer = brown 142 | chat_prefix_buffer_inactive_buffer = default 143 | chat_prefix_error = 130 144 | chat_prefix_join = lightgreen 145 | chat_prefix_more = lightmagenta 146 | chat_prefix_network = magenta 147 | chat_prefix_quit = lightred 148 | chat_prefix_suffix = 235 149 | chat_read_marker = magenta 150 | chat_read_marker_bg = default 151 | chat_server = brown 152 | chat_tags = red 153 | chat_text_found = 130 154 | chat_text_found_bg = lightmagenta 155 | chat_time = default 156 | chat_time_delimiters = brown 157 | chat_value = cyan 158 | emphasized = 130 159 | emphasized_bg = magenta 160 | input_actions = lightgreen 161 | input_text_not_found = red 162 | nicklist_away = cyan 163 | nicklist_group = green 164 | separator = 235 165 | status_count_highlight = magenta 166 | status_count_msg = brown 167 | status_count_other = default 168 | status_count_private = green 169 | status_data_highlight = lightmagenta 170 | status_data_msg = 130 171 | status_data_other = default 172 | status_data_private = lightgreen 173 | status_filter = green 174 | status_more = 130 175 | status_name = white 176 | status_name_ssl = lightgreen 177 | status_nicklist_count = default 178 | status_number = 130 179 | status_time = default 180 | 181 | [completion] 182 | base_word_until_cursor = on 183 | default_template = "%(nicks)|%(irc_channels)" 184 | nick_add_space = on 185 | nick_completer = ":" 186 | nick_first_only = off 187 | nick_ignore_chars = "[]`_-^" 188 | partial_completion_alert = on 189 | partial_completion_command = off 190 | partial_completion_command_arg = off 191 | partial_completion_count = on 192 | partial_completion_other = off 193 | 194 | [history] 195 | display_default = 5 196 | max_buffer_lines_minutes = 0 197 | max_buffer_lines_number = 4096 198 | max_commands = 100 199 | max_visited_buffers = 50 200 | 201 | [proxy] 202 | 203 | [network] 204 | connection_timeout = 60 205 | gnutls_ca_file = "/etc/ssl/certs/ca-certificates.crt" 206 | gnutls_handshake_timeout = 30 207 | proxy_curl = "" 208 | 209 | [plugin] 210 | autoload = "*" 211 | debug = off 212 | extension = ".so,.dll" 213 | path = "%h/plugins" 214 | save_config_on_unload = on 215 | 216 | [bar] 217 | buflist.color_bg = default 218 | buflist.color_delim = default 219 | buflist.color_fg = default 220 | buflist.conditions = "" 221 | buflist.filling_left_right = vertical 222 | buflist.filling_top_bottom = columns_vertical 223 | buflist.hidden = off 224 | buflist.items = "buflist" 225 | buflist.position = left 226 | buflist.priority = 100 227 | buflist.separator = on 228 | buflist.size = 0 229 | buflist.size_max = 0 230 | buflist.type = root 231 | isetbar.color_bg = default 232 | isetbar.color_delim = cyan 233 | isetbar.color_fg = default 234 | isetbar.conditions = "" 235 | isetbar.filling_left_right = vertical 236 | isetbar.filling_top_bottom = horizontal 237 | isetbar.hidden = on 238 | isetbar.items = "isetbar_help" 239 | isetbar.position = top 240 | isetbar.priority = 0 241 | isetbar.separator = on 242 | isetbar.size = 3 243 | isetbar.size_max = 3 244 | isetbar.type = window 245 | nicklist.color_bg = default 246 | nicklist.color_delim = cyan 247 | nicklist.color_fg = default 248 | nicklist.conditions = "${nicklist}" 249 | nicklist.filling_left_right = vertical 250 | nicklist.filling_top_bottom = columns_vertical 251 | nicklist.hidden = off 252 | nicklist.items = "buffer_nicklist" 253 | nicklist.position = right 254 | nicklist.priority = 200 255 | nicklist.separator = on 256 | nicklist.size = 0 257 | nicklist.size_max = 0 258 | nicklist.type = window 259 | rootinput.color_bg = default 260 | rootinput.color_delim = cyan 261 | rootinput.color_fg = default 262 | rootinput.conditions = "" 263 | rootinput.filling_left_right = vertical 264 | rootinput.filling_top_bottom = horizontal 265 | rootinput.hidden = off 266 | rootinput.items = "[input_prompt]+(away),[input_search],[input_paste],input_text" 267 | rootinput.position = bottom 268 | rootinput.priority = 50 269 | rootinput.separator = off 270 | rootinput.size = 1 271 | rootinput.size_max = 0 272 | rootinput.type = root 273 | rootstatus.color_bg = 235 274 | rootstatus.color_delim = lightcyan 275 | rootstatus.color_fg = default 276 | rootstatus.conditions = "" 277 | rootstatus.filling_left_right = vertical 278 | rootstatus.filling_top_bottom = horizontal 279 | rootstatus.hidden = off 280 | 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" 281 | rootstatus.position = bottom 282 | rootstatus.priority = 25 283 | rootstatus.separator = off 284 | rootstatus.size = 1 285 | rootstatus.size_max = 0 286 | rootstatus.type = root 287 | title.color_bg = 235 288 | title.color_delim = lightcyan 289 | title.color_fg = default 290 | title.conditions = "" 291 | title.filling_left_right = vertical 292 | title.filling_top_bottom = horizontal 293 | title.hidden = off 294 | title.items = "buffer_title" 295 | title.position = top 296 | title.priority = 500 297 | title.separator = off 298 | title.size = 0 299 | title.size_max = 0 300 | title.type = window 301 | 302 | [layout] 303 | default.buffer = "core;weechat;1" 304 | default.buffer = "perl;highmon;1" 305 | default.buffer = "irc;server.hashbang;1" 306 | default.buffer = "irc;hashbang.#!;2" 307 | default.buffer = "irc;hashbang.#!social;3" 308 | default.window = "1;0;15;1;-;-" 309 | default.window = "2;1;0;0;irc;hashbang.#!social" 310 | default.window = "3;1;0;0;core;weechat" 311 | default.current = on 312 | 313 | [notify] 314 | 315 | [filter] 316 | 317 | [key] 318 | ctrl-? = "/input delete_previous_char" 319 | ctrl-A = "/input move_beginning_of_line" 320 | ctrl-B = "/input move_previous_char" 321 | ctrl-C_ = "/input insert \x1F" 322 | ctrl-Cb = "/input insert \x02" 323 | ctrl-Cc = "/input insert \x03" 324 | ctrl-Ci = "/input insert \x1D" 325 | ctrl-Co = "/input insert \x0F" 326 | ctrl-Cv = "/input insert \x16" 327 | ctrl-D = "/input delete_next_char" 328 | ctrl-E = "/input move_end_of_line" 329 | ctrl-F = "/input move_next_char" 330 | ctrl-H = "/input delete_previous_char" 331 | ctrl-I = "/input complete_next" 332 | ctrl-J = "/input return" 333 | ctrl-K = "/input delete_end_of_line" 334 | ctrl-L = "/window refresh" 335 | ctrl-M = "/input return" 336 | ctrl-N = "/buffer +1" 337 | ctrl-P = "/buffer -1" 338 | ctrl-R = "/input search_text" 339 | ctrl-Sctrl-U = "/input set_unread" 340 | ctrl-T = "/input transpose_chars" 341 | ctrl-U = "/input delete_beginning_of_line" 342 | ctrl-W = "/input delete_previous_word" 343 | ctrl-X = "/input switch_active_buffer" 344 | ctrl-Y = "/input clipboard_paste" 345 | meta-meta2-1~ = "/window scroll_top" 346 | meta-meta2-23~ = "/bar scroll nicklist * b" 347 | meta-meta2-24~ = "/bar scroll nicklist * e" 348 | meta-meta2-4~ = "/window scroll_bottom" 349 | meta-meta2-5~ = "/window scroll_up" 350 | meta-meta2-6~ = "/window scroll_down" 351 | meta-meta2-7~ = "/window scroll_top" 352 | meta-meta2-8~ = "/window scroll_bottom" 353 | meta-meta2-A = "/buffer -1" 354 | meta-meta2-B = "/buffer +1" 355 | meta-meta2-C = "/buffer +1" 356 | meta-meta2-D = "/buffer -1" 357 | meta-- = "/filter toggle @" 358 | meta-/ = "/input jump_last_buffer_displayed" 359 | meta-0 = "/buffer *10" 360 | meta-1 = "/buffer *1" 361 | meta-2 = "/buffer *2" 362 | meta-3 = "/buffer *3" 363 | meta-4 = "/buffer *4" 364 | meta-5 = "/buffer *5" 365 | meta-6 = "/buffer *6" 366 | meta-7 = "/buffer *7" 367 | meta-8 = "/buffer *8" 368 | meta-9 = "/buffer *9" 369 | meta-< = "/input jump_previously_visited_buffer" 370 | meta-= = "/filter toggle" 371 | meta-> = "/input jump_next_visited_buffer" 372 | meta-OA = "/input history_global_previous" 373 | meta-OB = "/input history_global_next" 374 | meta-OC = "/input move_next_word" 375 | meta-OD = "/input move_previous_word" 376 | meta-OF = "/input move_end_of_line" 377 | meta-OH = "/input move_beginning_of_line" 378 | meta-Oa = "/input history_global_previous" 379 | meta-Ob = "/input history_global_next" 380 | meta-Oc = "/input move_next_word" 381 | meta-Od = "/input move_previous_word" 382 | meta2-15~ = "/buffer -1" 383 | meta2-17~ = "/buffer +1" 384 | meta2-18~ = "/window -1" 385 | meta2-19~ = "/window +1" 386 | meta2-1;3A = "/buffer -1" 387 | meta2-1;3B = "/buffer +1" 388 | meta2-1;3C = "/buffer +1" 389 | meta2-1;3D = "/buffer -1" 390 | meta2-1;3F = "/window scroll_bottom" 391 | meta2-1;3H = "/window scroll_top" 392 | meta2-1;5A = "/input history_global_previous" 393 | meta2-1;5B = "/input history_global_next" 394 | meta2-1;5C = "/input move_next_word" 395 | meta2-1;5D = "/input move_previous_word" 396 | meta2-1~ = "/input move_beginning_of_line" 397 | meta2-200~ = "/input paste_start" 398 | meta2-201~ = "/input paste_stop" 399 | meta2-20~ = "/bar scroll title * -30%" 400 | meta2-21~ = "/bar scroll title * +30%" 401 | meta2-23;3~ = "/bar scroll nicklist * b" 402 | meta2-23~ = "/bar scroll nicklist * -100%" 403 | meta2-24;3~ = "/bar scroll nicklist * e" 404 | meta2-24~ = "/bar scroll nicklist * +100%" 405 | meta2-3~ = "/input delete_next_char" 406 | meta2-4~ = "/input move_end_of_line" 407 | meta2-5;3~ = "/window scroll_up" 408 | meta2-5~ = "/window page_up" 409 | meta2-6;3~ = "/window scroll_down" 410 | meta2-6~ = "/window page_down" 411 | meta2-7~ = "/input move_beginning_of_line" 412 | meta2-8~ = "/input move_end_of_line" 413 | meta2-A = "/input history_previous" 414 | meta2-B = "/input history_next" 415 | meta2-C = "/input move_next_char" 416 | meta2-D = "/input move_previous_char" 417 | meta2-F = "/input move_end_of_line" 418 | meta2-G = "/window page_down" 419 | meta2-H = "/input move_beginning_of_line" 420 | meta2-I = "/window page_up" 421 | meta2-Z = "/input complete_previous" 422 | meta2-[E = "/buffer -1" 423 | meta-_ = "/input redo" 424 | meta-a = "/input jump_smart" 425 | meta-b = "/input move_previous_word" 426 | meta-d = "/input delete_next_word" 427 | meta-f = "/input move_next_word" 428 | meta-h = "/input hotlist_clear" 429 | meta-jmeta-f = "/buffer -" 430 | meta-jmeta-l = "/buffer +" 431 | meta-jmeta-r = "/server raw" 432 | meta-jmeta-s = "/server jump" 433 | meta-j01 = "/buffer 1" 434 | meta-j02 = "/buffer 2" 435 | meta-j03 = "/buffer 3" 436 | meta-j04 = "/buffer 4" 437 | meta-j05 = "/buffer 5" 438 | meta-j06 = "/buffer 6" 439 | meta-j07 = "/buffer 7" 440 | meta-j08 = "/buffer 8" 441 | meta-j09 = "/buffer 9" 442 | meta-j10 = "/buffer 10" 443 | meta-j11 = "/buffer 11" 444 | meta-j12 = "/buffer 12" 445 | meta-j13 = "/buffer 13" 446 | meta-j14 = "/buffer 14" 447 | meta-j15 = "/buffer 15" 448 | meta-j16 = "/buffer 16" 449 | meta-j17 = "/buffer 17" 450 | meta-j18 = "/buffer 18" 451 | meta-j19 = "/buffer 19" 452 | meta-j20 = "/buffer 20" 453 | meta-j21 = "/buffer 21" 454 | meta-j22 = "/buffer 22" 455 | meta-j23 = "/buffer 23" 456 | meta-j24 = "/buffer 24" 457 | meta-j25 = "/buffer 25" 458 | meta-j26 = "/buffer 26" 459 | meta-j27 = "/buffer 27" 460 | meta-j28 = "/buffer 28" 461 | meta-j29 = "/buffer 29" 462 | meta-j30 = "/buffer 30" 463 | meta-j31 = "/buffer 31" 464 | meta-j32 = "/buffer 32" 465 | meta-j33 = "/buffer 33" 466 | meta-j34 = "/buffer 34" 467 | meta-j35 = "/buffer 35" 468 | meta-j36 = "/buffer 36" 469 | meta-j37 = "/buffer 37" 470 | meta-j38 = "/buffer 38" 471 | meta-j39 = "/buffer 39" 472 | meta-j40 = "/buffer 40" 473 | meta-j41 = "/buffer 41" 474 | meta-j42 = "/buffer 42" 475 | meta-j43 = "/buffer 43" 476 | meta-j44 = "/buffer 44" 477 | meta-j45 = "/buffer 45" 478 | meta-j46 = "/buffer 46" 479 | meta-j47 = "/buffer 47" 480 | meta-j48 = "/buffer 48" 481 | meta-j49 = "/buffer 49" 482 | meta-j50 = "/buffer 50" 483 | meta-j51 = "/buffer 51" 484 | meta-j52 = "/buffer 52" 485 | meta-j53 = "/buffer 53" 486 | meta-j54 = "/buffer 54" 487 | meta-j55 = "/buffer 55" 488 | meta-j56 = "/buffer 56" 489 | meta-j57 = "/buffer 57" 490 | meta-j58 = "/buffer 58" 491 | meta-j59 = "/buffer 59" 492 | meta-j60 = "/buffer 60" 493 | meta-j61 = "/buffer 61" 494 | meta-j62 = "/buffer 62" 495 | meta-j63 = "/buffer 63" 496 | meta-j64 = "/buffer 64" 497 | meta-j65 = "/buffer 65" 498 | meta-j66 = "/buffer 66" 499 | meta-j67 = "/buffer 67" 500 | meta-j68 = "/buffer 68" 501 | meta-j69 = "/buffer 69" 502 | meta-j70 = "/buffer 70" 503 | meta-j71 = "/buffer 71" 504 | meta-j72 = "/buffer 72" 505 | meta-j73 = "/buffer 73" 506 | meta-j74 = "/buffer 74" 507 | meta-j75 = "/buffer 75" 508 | meta-j76 = "/buffer 76" 509 | meta-j77 = "/buffer 77" 510 | meta-j78 = "/buffer 78" 511 | meta-j79 = "/buffer 79" 512 | meta-j80 = "/buffer 80" 513 | meta-j81 = "/buffer 81" 514 | meta-j82 = "/buffer 82" 515 | meta-j83 = "/buffer 83" 516 | meta-j84 = "/buffer 84" 517 | meta-j85 = "/buffer 85" 518 | meta-j86 = "/buffer 86" 519 | meta-j87 = "/buffer 87" 520 | meta-j88 = "/buffer 88" 521 | meta-j89 = "/buffer 89" 522 | meta-j90 = "/buffer 90" 523 | meta-j91 = "/buffer 91" 524 | meta-j92 = "/buffer 92" 525 | meta-j93 = "/buffer 93" 526 | meta-j94 = "/buffer 94" 527 | meta-j95 = "/buffer 95" 528 | meta-j96 = "/buffer 96" 529 | meta-j97 = "/buffer 97" 530 | meta-j98 = "/buffer 98" 531 | meta-j99 = "/buffer 99" 532 | meta-k = "/input grab_key_command" 533 | meta-l = "/window bare" 534 | meta-m = "/mute mouse toggle" 535 | meta-n = "/window scroll_next_highlight" 536 | meta-p = "/window scroll_previous_highlight" 537 | meta-r = "/input delete_line" 538 | meta-s = "/mute aspell toggle" 539 | meta-u = "/window scroll_unread" 540 | meta-wmeta-meta2-A = "/window up" 541 | meta-wmeta-meta2-B = "/window down" 542 | meta-wmeta-meta2-C = "/window right" 543 | meta-wmeta-meta2-D = "/window left" 544 | meta-wmeta2-1;3A = "/window up" 545 | meta-wmeta2-1;3B = "/window down" 546 | meta-wmeta2-1;3C = "/window right" 547 | meta-wmeta2-1;3D = "/window left" 548 | meta-wmeta-b = "/window balance" 549 | meta-wmeta-s = "/window swap" 550 | meta-x = "/input zoom_merged_buffer" 551 | meta-z = "/window zoom" 552 | ctrl-_ = "/input undo" 553 | 554 | [key_search] 555 | ctrl-I = "/input search_switch_where" 556 | ctrl-J = "/input search_stop" 557 | ctrl-M = "/input search_stop" 558 | ctrl-R = "/input search_switch_regex" 559 | meta2-A = "/input search_previous" 560 | meta2-B = "/input search_next" 561 | meta-c = "/input search_switch_case" 562 | 563 | [key_cursor] 564 | ctrl-J = "/cursor stop" 565 | ctrl-M = "/cursor stop" 566 | meta-meta2-A = "/cursor move area_up" 567 | meta-meta2-B = "/cursor move area_down" 568 | meta-meta2-C = "/cursor move area_right" 569 | meta-meta2-D = "/cursor move area_left" 570 | meta2-1;3A = "/cursor move area_up" 571 | meta2-1;3B = "/cursor move area_down" 572 | meta2-1;3C = "/cursor move area_right" 573 | meta2-1;3D = "/cursor move area_left" 574 | meta2-A = "/cursor move up" 575 | meta2-B = "/cursor move down" 576 | meta2-C = "/cursor move right" 577 | meta2-D = "/cursor move left" 578 | @item(buffer_nicklist):K = "/window ${_window_number};/kickban ${nick}" 579 | @item(buffer_nicklist):b = "/window ${_window_number};/ban ${nick}" 580 | @item(buffer_nicklist):k = "/window ${_window_number};/kick ${nick}" 581 | @item(buffer_nicklist):q = "/window ${_window_number};/query ${nick};/cursor stop" 582 | @item(buffer_nicklist):w = "/window ${_window_number};/whois ${nick}" 583 | @chat:Q = "hsignal:chat_quote_time_prefix_message;/cursor stop" 584 | @chat:m = "hsignal:chat_quote_message;/cursor stop" 585 | @chat:q = "hsignal:chat_quote_prefix_message;/cursor stop" 586 | 587 | [key_mouse] 588 | @bar(buflist):ctrl-wheeldown = "hsignal:buflist_mouse" 589 | @bar(buflist):ctrl-wheelup = "hsignal:buflist_mouse" 590 | @bar(input):button2 = "/input grab_mouse_area" 591 | @bar(nicklist):button1-gesture-down = "/bar scroll nicklist ${_window_number} +100%" 592 | @bar(nicklist):button1-gesture-down-long = "/bar scroll nicklist ${_window_number} e" 593 | @bar(nicklist):button1-gesture-up = "/bar scroll nicklist ${_window_number} -100%" 594 | @bar(nicklist):button1-gesture-up-long = "/bar scroll nicklist ${_window_number} b" 595 | @chat(perl.iset):button1 = "hsignal:iset_mouse" 596 | @chat(perl.iset):button2* = "hsignal:iset_mouse" 597 | @chat(perl.iset):wheeldown = "/repeat 5 /iset **down" 598 | @chat(perl.iset):wheelup = "/repeat 5 /iset **up" 599 | @chat(script.scripts):button1 = "/window ${_window_number};/script go ${_chat_line_y}" 600 | @chat(script.scripts):button2 = "/window ${_window_number};/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}" 601 | @chat(script.scripts):wheeldown = "/script down 5" 602 | @chat(script.scripts):wheelup = "/script up 5" 603 | @item(buffer_nicklist):button1 = "/window ${_window_number};/query ${nick}" 604 | @item(buffer_nicklist):button1-gesture-left = "/window ${_window_number};/kick ${nick}" 605 | @item(buffer_nicklist):button1-gesture-left-long = "/window ${_window_number};/kickban ${nick}" 606 | @item(buffer_nicklist):button2 = "/window ${_window_number};/whois ${nick}" 607 | @item(buffer_nicklist):button2-gesture-left = "/window ${_window_number};/ban ${nick}" 608 | @bar:wheeldown = "/bar scroll ${_bar_name} ${_window_number} +20%" 609 | @bar:wheelup = "/bar scroll ${_bar_name} ${_window_number} -20%" 610 | @chat:button1 = "/window ${_window_number}" 611 | @chat:button1-gesture-left = "/window ${_window_number};/buffer -1" 612 | @chat:button1-gesture-left-long = "/window ${_window_number};/buffer 1" 613 | @chat:button1-gesture-right = "/window ${_window_number};/buffer +1" 614 | @chat:button1-gesture-right-long = "/window ${_window_number};/input jump_last_buffer" 615 | @chat:ctrl-wheeldown = "/window scroll_horiz -window ${_window_number} +10%" 616 | @chat:ctrl-wheelup = "/window scroll_horiz -window ${_window_number} -10%" 617 | @chat:wheeldown = "/window scroll_down -window ${_window_number}" 618 | @chat:wheelup = "/window scroll_up -window ${_window_number}" 619 | @*:button3 = "/cursor go ${_x},${_y}" 620 | -------------------------------------------------------------------------------- /weechat/.weechat/xfer.conf: -------------------------------------------------------------------------------- 1 | # 2 | # xfer.conf -- weechat v1.0.1 3 | # 4 | 5 | [look] 6 | auto_open_buffer = on 7 | progress_bar_size = 20 8 | pv_tags = "notify_private" 9 | 10 | [color] 11 | status_aborted = lightred 12 | status_active = lightblue 13 | status_connecting = 130 14 | status_done = lightgreen 15 | status_failed = lightred 16 | status_waiting = lightcyan 17 | text = default 18 | text_bg = default 19 | text_selected = white 20 | 21 | [network] 22 | blocksize = 65536 23 | fast_send = on 24 | own_ip = "" 25 | port_range = "" 26 | speed_limit = 0 27 | timeout = 300 28 | 29 | [file] 30 | auto_accept_chats = off 31 | auto_accept_files = off 32 | auto_accept_nicks = "" 33 | auto_check_crc32 = off 34 | auto_rename = on 35 | auto_resume = on 36 | convert_spaces = on 37 | download_path = "%h/xfer" 38 | upload_path = "~" 39 | use_nick_in_filename = on 40 | -------------------------------------------------------------------------------- /zsh/.zlogin: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ################################################################################ 4 | # This file is sourced only for login shells. It 5 | # should contain commands that should be executed only 6 | # in login shells. It should be used to set the terminal 7 | # type and run a series of external commands (fortune, 8 | # msgs, from, etc.) 9 | # Note that using zprofile and zlogin, you are able to 10 | # run commands for login shells before and after zshrc. 11 | # 12 | # Global Order: zshenv, zprofile, zshrc, zlogin 13 | ################################################################################ 14 | 15 | source ~/.grml-etc-core/etc/zsh/zlogin 16 | 17 | # Your custom things come here 18 | -------------------------------------------------------------------------------- /zsh/.zlogout: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # Shutdown files (.zlogout and zlogout) are run, when a login shell exits. 3 | 4 | source ~/.grml-etc-core/etc/zsh/zlogout 5 | 6 | # Your custom things come here 7 | -------------------------------------------------------------------------------- /zsh/.zprofile: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | ################################################################################ 3 | # This file is sourced only for login shells (i.e. shells 4 | # invoked with "-" as the first character of argv[0], and 5 | # shells invoked with the -l flag). It's read after zshenv. 6 | # 7 | # Global Order: zshenv, zprofile, zshrc, zlogin 8 | ################################################################################ 9 | 10 | source ~/.grml-etc-core/etc/zsh/zprofile 11 | 12 | # Your custom things come here 13 | 14 | 15 | # At last, do the tmux magic 16 | [[ -n "$TMUX" ]] || ~/.tmux_bootstrap 17 | -------------------------------------------------------------------------------- /zsh/.zshenv: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | ################################################################################ 3 | # This file is sourced on all invocations of the shell. 4 | # It is the 1st file zsh reads; it's read for every shell, 5 | # even if started with -f (setopt NO_RCS), all other 6 | # initialization files are skipped. 7 | # 8 | # This file should contain commands to set the command 9 | # search path, plus other important environment variables. 10 | # This file should not contain commands that produce 11 | # output or assume the shell is attached to a tty. 12 | # 13 | # Notice: .zshenv is the same, execpt that it's not read 14 | # if zsh is started with -f 15 | # 16 | # Global Order: zshenv, zprofile, zshrc, zlogin 17 | ################################################################################ 18 | 19 | source ~/.grml-etc-core/etc/zsh/zshenv 20 | 21 | # Your custom things come here 22 | -------------------------------------------------------------------------------- /zsh/.zshrc: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | ################################################################################ 3 | # This file is sourced only for interactive shells. It 4 | # should contain commands to set up aliases, functions, 5 | # options, key bindings, etc. 6 | # 7 | # Global Order: zshenv, zprofile, zshrc, zlogin 8 | ################################################################################ 9 | 10 | # USAGE 11 | # If you do not want to version your .zshrc customizations with Git, 12 | # please use ~/.zshrc.pre and ~/.zshrc.local. The former file is read 13 | # before ~/.zshrc, the latter is read after it. 14 | # Also, consider reading the refcard and the reference manual for 15 | # Grml's ZSH setup, which we use, both available from: 16 | # 17 | 18 | source ~/.grml-etc-core/etc/zsh/zshrc 19 | 20 | # Autoload Grml's functions and completions 21 | fpath=(~/.grml-etc-core/usr_share_grml/zsh/ $fpath) 22 | 23 | # Make plain `hashbangctl` invocations work 24 | alias hashbangctl='sudo hashbangctl' 25 | 26 | # Hashbang greetings message 27 | [ ! -d "/etc/hashbang" ] || /etc/hashbang/welcome 28 | 29 | # Your custom things come here 30 | -------------------------------------------------------------------------------- /zsh/.zshrc.pre: -------------------------------------------------------------------------------- 1 | export GRML_NO_APT_ALIASES=1 2 | export GRML_NO_SMALL_ALIASES=1 3 | --------------------------------------------------------------------------------