2020-11-21 18:07:26 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
DIR=$(dirname "$(readlink -f "$0")")
|
|
|
|
. "$DIR/../env.sh"
|
|
|
|
|
2020-11-27 05:18:51 +00:00
|
|
|
if ! has_cmd python; then
|
2020-11-23 07:54:48 +00:00
|
|
|
"$PDIR/devel/python.sh"
|
2020-11-23 02:00:49 +00:00
|
|
|
fi
|
2020-11-21 18:07:26 +00:00
|
|
|
log 'Setting up ranger'
|
|
|
|
|
2021-06-15 03:58:26 +00:00
|
|
|
if [ "$LANG" != "en_US.UTF-8" ] ; then
|
|
|
|
echo "please set LANG to en_US.UTF-8 for ranger to work properly"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-11-21 18:07:26 +00:00
|
|
|
# install ranger
|
|
|
|
case "$PM" in
|
2021-09-16 14:18:49 +00:00
|
|
|
pkg)
|
|
|
|
pkg install p7zip unrar
|
|
|
|
pip install ranger-fm
|
|
|
|
;;
|
2020-11-21 18:07:26 +00:00
|
|
|
apt)
|
|
|
|
# atool/p7zip-full for archive previewing/extracting etc
|
2021-01-15 07:41:42 +00:00
|
|
|
sudo apt install -y atool p7zip-full unrar libx11-dev libxext-dev
|
2020-11-21 18:07:26 +00:00
|
|
|
sudo pip3 install ranger-fm ueberzug
|
|
|
|
;;
|
|
|
|
pacman)
|
|
|
|
sudo pacman -S --noconfirm --needed atool p7zip unrar
|
|
|
|
sudo pip install ranger-fm ueberzug
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# linking configuration files
|
|
|
|
lnsf "$DIR/ranger/commands.py" "$XDG_CONFIG_HOME/ranger/commands.py"
|
|
|
|
lnsf "$DIR/ranger/rc.conf" "$XDG_CONFIG_HOME/ranger/rc.conf"
|
|
|
|
lnsf "$DIR/ranger/scope.sh" "$XDG_CONFIG_HOME/ranger/scope.sh"
|
|
|
|
lnsf "$DIR/ranger/colorschemes/solarizedmod.py" "$XDG_CONFIG_HOME/ranger/colorschemes/solarizedmod.py"
|
|
|
|
|
|
|
|
# install devicons
|
|
|
|
DEVICONS_DIR=$HOME/.config/ranger/plugins/ranger_devicons
|
2020-11-23 02:00:49 +00:00
|
|
|
if [ ! -d "$DEVICONS_DIR" ]; then
|
|
|
|
git_clone https://gitee.com/klesh/ranger_devicons.git "$DEVICONS_DIR"
|
|
|
|
fi
|