-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup-alacritty
executable file
·83 lines (64 loc) · 2.02 KB
/
setup-alacritty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
set -eu
get_latest_reposiotry() {
local repo_uri="${1}"
local repo_dir="${2}"
echo "Repository URI: ${repo_uri}"
if [[ ! -d "${repo_dir}" ]]; then
echo "Cloning repository..."
mkdir -p "$(dirname "${repo_dir}")"
git clone --quiet --recursive "${repo_uri}" "${repo_dir}"
pushd "${repo_dir}" >/dev/null
else
echo "Pulling latest commits..."
pushd "${repo_dir}" >/dev/null
git pull
git submodule update --init
fi
popd >/dev/null
}
declare -r owner="alacritty"
declare -r repo="alacritty"
get_latest_reposiotry "https://github.com/${owner}/${repo}" "${HOME}/Dev/github/${owner}/${repo}"
pushd "${HOME}/Dev/github/${owner}/${repo}" >/dev/null
post_setup_install_man_pages() {
echo "Installing manual pages..."
sudo mkdir -p /usr/local/share/man/man1
gzip -c extra/alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null
gzip -c extra/alacritty-msg.man | sudo tee /usr/local/share/man/man1/alacritty-msg.1.gz > /dev/null
}
setup_for_darwin() {
echo "Building alacritty..."
make app
echo "Installing alacritty..."
sudo cp -f target/release/alacritty /usr/local/bin
cp -r target/release/osx/Alacritty.app /Applications/
post_setup_install_man_pages
echo "Updating terminfo database..."
tic -xe alacritty,alacritty-direct extra/alacritty.info
echo "Done!"
}
setup_for_debian() {
echo "Installing dependencies..."
sudo apt install -y cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev python3
echo "Building alacritty..."
cargo build --release
echo "Installing alacritty..."
sudo cp -f target/release/alacritty /usr/local/bin
post_setup_install_man_pages
echo "Adding desktop shortcut..."
sudo cp -f extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install extra/linux/Alacritty.desktop
sudo update-desktop-database
echo "Done!"
}
case $OSTYPE in
darwin*)
setup_for_darwin;;
linux*)
setup_for_debian
;;
*)
echo "Unknown OS!"
exit 1;;
esac