weechat-awayonlock/install.sh

26 lines
688 B
Bash
Raw Permalink Normal View History

2023-07-16 02:32:47 +00:00
#!/bin/sh
set -e
config_dir="${XDG_DATA_HOME:-$HOME/.local/share}"
if [ -z "$config_dir" ] ; then
echo "Couldn't guess your XDG_DATA_HOME! Please manually install the script." 2>&1
exit 1
fi
weechat_dir="${config_dir}/weechat"
if [ ! -d "${weechat_dir}" ] ; then
echo "Couldn't find your weechat home at ${weechat_dir}. Please manually install the script." 2>&1
exit 1
fi
mkdir -p "${weechat_dir}/python/autoload"
echo "Copying script files..."
cp -v "$PWD/src/"*.py "${weechat_dir}/python"
chmod +x "${weechat_dir}/python/away_on_lock.py"
echo "Setting script to autoload..."
ln -s "../away_on_lock.py" "${weechat_dir}/python/autoload/away_on_lock.py"
echo "Done!"