-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebian-install-sway.sh
124 lines (101 loc) · 3.26 KB
/
debian-install-sway.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
#!/bin/bash
set -e
if [ $(id -u) -eq 0 ]; then
echo 'Please execute this script as a regular user.'
exit 1
fi
which sudo >/dev/null
if [ $? -ne 0 ]; then
echo 'An installation with sudo is required.'
exit 1
fi
function reconfig_meson() {
if [ -d build ]; then
sudo rm -r build/meson-logs
meson build --wipe
else
meson build
fi
}
echo 'Enabling contrib and non-free repositories'
# sudo sed -i -e 's/main$/main contrib non-free/g' /etc/apt/sources.list
sudo apt-add-repository contrib
sudo apt-add-repository non-free
sudo apt update
mkdir -p ~/sway-src
echo 'Installing wlroots...'
sudo apt install -y build-essential cmake meson libwayland-dev wayland-protocols \
libegl1-mesa-dev libgles2-mesa-dev libdrm-dev libgbm-dev libinput-dev \
libxkbcommon-dev libudev-dev libpixman-1-dev libsystemd-dev libcap-dev \
libxcb1-dev libxcb-composite0-dev libxcb-xfixes0-dev libxcb-xinput-dev \
libxcb-image0-dev libxcb-render-util0-dev libx11-xcb-dev libxcb-icccm4-dev \
freerdp2-dev libwinpr2-dev libpng-dev libavutil-dev libavcodec-dev \
libavformat-dev universal-ctags git
cd ~/sway-src
[ ! -d wlroots ] && git clone https://github.com/swaywm/wlroots.git
cd wlroots
git fetch
# git checkout 0.7.0
git checkout 0.10.1
reconfig_meson
ninja -C build
sudo ninja -C build install
sudo ldconfig
echo 'Installing json-c...'
sudo apt install -y autoconf libtool
cd ~/sway-src
[ ! -d json-c ] && git clone https://github.com/json-c/json-c.git
cd json-c
git fetch
# git checkout json-c-0.13.1-20180305
git checkout json-c-0.14-20200419
sh autogen.sh
./configure --enable-threading --prefix=/usr/local
CPUCOUNT=$(grep processor /proc/cpuinfo | wc -l)
make -j$CPUCOUNT
sudo make install
sudo ldconfig
echo 'Installing scdoc'
cd ~/sway-src
[ ! -d scdoc ] && git clone https://git.sr.ht/~sircmpwn/scdoc
cd scdoc
git fetch
# git checkout 1.9.7
git checkout 1.10.1
make PREFIX=/usr/local -j$CPUCOUNT
sudo make PREFIX=/usr/local install
echo 'Installing sway'
sudo apt install -y libpcre3-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev xwayland
cd ~/sway-src
[ ! -d sway ] && git clone https://github.com/swaywm/sway.git
cd sway
git fetch
# git checkout 1.2
git checkout 1.4
reconfig_meson
ninja -C build
sudo ninja -C build install
echo 'Installing swaybg'
cd ~/sway-src
[ ! -d swaybg ] && git clone https://github.com/swaywm/swaybg.git
cd swaybg
git fetch
git checkout 1.0
reconfig_meson
ninja -C build
sudo ninja -C build install
read -p "Do you wish to install kitty terminal emulator, and configure it as default for Sway? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt install -y curl xz-utils libcanberra0 libxcb-xkb1
sudo mkdir -p /opt/kitty
# curl -L https://github.com/kovidgoyal/kitty/releases/download/v0.14.4/kitty-0.14.4-x86_64.txz | sudo tar xvJ -C /opt/kitty
curl -L https://github.com/kovidgoyal/kitty/releases/download/v0.17.3/kitty-0.17.3-x86_64.txz | sudo tar xvJ -C /opt/kitty
sudo ln -sf /opt/kitty/bin/kitty /usr/local/bin
mkdir -p ~/.config/sway
cp /usr/local/etc/sway/config ~/.config/sway
# sudo sed -i -e 's/urxvt/kitty/g' /usr/local/etc/sway/config
sed -i -e 's/urxvt/kitty/g' ~/.config/sway/config
fi
echo 'All set, now you should be able to just execute "sway" from a tty.'
echo 'The default key combination for opening a terminal in Sway is <WinKey>+<Enter>'