-
Notifications
You must be signed in to change notification settings - Fork 0
/
installi3.sh
executable file
·124 lines (103 loc) · 4.63 KB
/
installi3.sh
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#! /usr/bin/env bash
set -euo pipefail
if [ -z "$1" ]; then
echo "Please pass either <latop> or <desktop> (without the angles) as a parameter"
exit
fi
mkdir -p .tmp
echo "# Install some basic tools we need to install the rest"
sudo apt update
sudo apt install -y wget curl ca-certificates apt-transport-https gnupg lsb-release
echo "# Installing packages for building things"
# Packages for building things
sudo apt install -y git build-essential autoconf gcc make pkg-config automake autoconf bison flex check libtool python3 python3-pip \
python3-gi python3-setuptools python3-stdeb dh-python
echo "# Setting python -> Python 3"
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
echo "# Installing packages for our i3-based desktop"
sudo apt install -y \
feh gucharmap compton udisks2 udiskie at autorandr pasystray pavucontrol pavumeter lxappearance arandr scrot playerctl policykit-1-gnome fd-find network-manager \
bmon pulsemixer
# Packages required to build i3-gaps
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev \
libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev \
libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev libtool automake meson ninja-build
# Packages required to build i3lock-color
sudo apt install -y \
libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev \
libxcb-randr0-dev libxcb-image0-dev libxcb-util0-dev libxcb-xrm-dev libxcb-xtest0-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev
# Packages required to build picom
sudo apt install -y \
libxcb-damage0 libxcb-damage0-dev libxcb-sync-dev libxcb-sync1 libxcb-present-dev libxcb-present0 \
libxcb-glx0 libxcb-glx0-dev uthash-dev libev-dev libconfig-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libdbus-1-dev
# Build i3-gaps
#echo "# Building i3-gaps"
#pushd .tmp
#git clone https://github.com/Airblader/i3.git i3-gaps
#pushd i3-gaps
#git checkout gaps && git pull
#mkdir -p build
#meson setup build --prefix=/usr/local
#meson compile -C build
#sudo meson install -C build
#popd
#popd
# Install i3 from PPAs
/usr/lib/apt/apt-helper download-file https://debian.sur5r.net/i3/pool/main/s/sur5r-keyring/sur5r-keyring_2023.02.18_all.deb keyring.deb SHA256:a511ac5f10cd811f8a4ca44d665f2fa1add7a9f09bef238cdfad8461f5239cc4
sudo apt install ./keyring.deb
echo "deb http://debian.sur5r.net/i3/ $(grep '^DISTRIB_CODENAME=' /etc/lsb-release | cut -f2 -d=) universe" | sudo tee /etc/apt/sources.list.d/sur5r-i3.list
sudo apt update
sudo apt install i3
# Non apt installs specifically for i3 destktop environment
echo "# Build and install i3lock-color"
pushd .tmp
curl -fsSL https://github.com/Raymo111/i3lock-color/archive/refs/tags/2.13.c.4.tar.gz -o ../downloads/i3lock-color.tgz
tar -xzf ../downloads/i3lock-color.tgz
pushd i3lock-color-2.13.c.4
sudo ./install-i3lock-color.sh
popd
popd
echo "# Build and install betterlockscreen"
pushd .tmp
curl -fsSL https://github.com/betterlockscreen/betterlockscreen/archive/refs/tags/v4.0.3.tar.gz -o ../downloads/betterlockscreen.tar.gz
tar -xzf ../downloads/betterlockscreen.tar.gz
pushd betterlockscreen-4.0.3
sudo cp betterlockscreen /usr/local/bin/betterlockscreen
popd
popd
echo "# Build and install picom"
pushd .tmp
curl -fsSL https://github.com/yshui/picom/archive/refs/tags/v9.1.tar.gz -o ../downloads/picom.tar.gz
tar -xzf ../downloads/picom.tar.gz
pushd picom-9.1
meson --buildtype=release . build
ninja -C build
sudo ninja -C build install
popd
popd
if [ $1 == "laptop" ]; then
echo "# Installing some extra packages because we're on a laptop"
# Packages for just the laptop
sudo apt update
sudo apt install -y \
tlp tlp-rdw
git clone https://github.com/d4nj1/TLPUI ./.tmp/TLPUI
cd ./.tmp/TLPUI
python3 setup.py --command-packages=stdeb.command bdist_deb
sudo dpkg -i deb_dist/python3-tlpui_*all.deb # PPAs for just the laptop
cd ../..
fi
# TODO: Configuration for udiskie if needed, going to assume it is ok by default these days
# https://computingforgeeks.com/automount-removable-media-on-linux-with-udiskie/
echo "# Installing scripts"
sudo cp -Rf i3de/* /
if [ $1 == "laptop" ]; then
# restart the acpi daemon, so it picks up the hook we added for the laptop lid
sudo /etc/init.d/acpid restart
# reload udev rules to pick up the rules we added for hdmi hotplug
sudo udevadm control --reload-rules
else
# If we're not on a laptop, remove the lid and hdmi hooks, they'll be borked on a desktop
sudo rm /etc/udev/rules.d/95-monitors.rules
sudo rm /etc/acpi/events/laptop-lid
fi