Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

3. Installation

reddy75 edited this page Feb 13, 2020 · 3 revisions

3.1 Download

Following commands are performed in BASH.

Download latest released version of script in terminal into /tmp directory. You can check it from https://github.com/reddy75/wrecon/releases.

For example, the latest version is v1.02, and we want archive type tar.gz

cd /tmp
BASE_NAME=reddy75/wrecon
BASE_URL=https://github.com/${BASE_NAME}/archive
API_URL=https://api.github.com/repos/${BASE_NAME}/releases/latest
LATEST_VERSION=$(curl --silent "${API_URL}" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
ARCHIVE_FILE=${LATEST_VERSION}.tar.gz
WRECON_DIR="wrecon-${LATEST_VERSION#*v}"
DOWNLOAD_URL=${BASE_URL}/${ARCHIVE_FILE}; echo "SCRIPT DOWNLOAD FROM : ${DOWNLOAD_URL}"
wget ${DOWNLOAD_URL}

3.2 Extract

Extract archive by command

tar -xvf ${ARCHIVE_FILE}

and output will be similar like

wrecon-1.02/
wrecon-1.02/README.txt
wrecon-1.02/gpl-3.0.txt
wrecon-1.02/wrecon.py
wrecon-1.02/wrecon.py.sig

Then go into wrecon-1.02 directory,

cd ${WRECON_DIR}/

3.3 Verify script code by signature file

To verify the script code is signed by author (using by gpg), you ensure by command(s)

gpg --verify wrecon.py.sig

or

gpg --verify wrecon.py.sig wrecon.py

When you see last line like 'gpg: Good signature from...', then script is prepared for copy into your weechat.

3.4 Copy script into weechat

Configuration for user of weechat is usually located in default directory ${HOME}/.weechat/. This may be different based on your setup of system, or installation of weechat. You need copy script into python subdirectory of weechat, usually by command

cp wrecon.py ${HOME}/.weechat/python/

If copy was successful then all is prepared.

3.5 Autoload of script

You can also ensure script can be loaded automatically when weechat is started, then follow last step (making a link for autoload)

ln -s ${HOME}/.weechat/python/wrecon.py ${HOME}/.weechat/python/autoload/wrecon.py