dotfiles/picom/install.sh

45 lines
1.6 KiB
Bash
Raw Normal View History

2020-09-17 16:02:24 +00:00
#!/bin/bash
DIR=$(readlink -f $(dirname $0))
. $DIR/../env.sh
2020-09-18 04:16:15 +00:00
PICOM_VER=v8.1
2020-09-17 16:02:24 +00:00
# install ranger
case "$PM" in
apt)
# install build tools
! which pip3 && $ROOT/python/install.sh
2020-09-18 04:16:15 +00:00
sudo pip3 install meson
2020-09-17 16:02:24 +00:00
# install dependencies
2020-09-18 04:16:15 +00:00
sudo apt install -y ninja-build libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev
2020-09-17 16:02:24 +00:00
;;
pacman)
2020-09-18 18:01:58 +00:00
sudo pacman -S --needed uthash ninja meson
2020-09-17 16:02:24 +00:00
;;
esac
2020-09-19 15:33:13 +00:00
# build and install picom
VERSION=next
2020-09-19 15:33:13 +00:00
VERSION_PATH=$XDG_CONFIG_HOME/picom/version
if [ "$VERSION" = "next" ] || ! eqv "$VERSION_PATH" "$VERSION"; then
echo Downloading picom $VERSION
[ ! -f /tmp/picom-$VERSION.zip ] && \
curl "https://github.com/yshui/picom/archive/$VERSION.zip" -Lo /tmp/picom-$VERSION.zip
2020-09-19 15:33:13 +00:00
unzip /tmp/picom-$VERSION.zip -d /tmp
FD=$(unzip -l /tmp/picom-$VERSION.zip | awk 'NR==5{print $4}')
pushd /tmp/$FD
2020-09-19 15:33:13 +00:00
meson --buildtype=release . build
sudo ninja -C build install
popd
mkdir -p $(dirname $VERSION_PATH)
2020-09-19 15:33:13 +00:00
echo "$VERSION" > "$VERSION_PATH"
sudo rm -rf /tmp/picom-$VERSION*
fi
2020-09-18 18:01:58 +00:00
# configuration
2020-09-19 15:33:13 +00:00
lnsf $DIR/config/launch.sh $XDG_CONFIG_HOME/picom/launch.sh
lnsf $DIR/config/toggle.sh $XDG_CONFIG_HOME/picom/toggle.sh
lnsf $DIR/config/picom.conf $XDG_CONFIG_HOME/picom/picom.conf