-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu
153 lines (131 loc) · 5.21 KB
/
ubuntu
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/bash
# Tested only for Ubuntu
append(){ # $1: text, $2: path
sudo=""
if [[ $2 != */home* ]]; then
sudo="sudo"
fi
$sudo mkdir -p $(dirname "$2") && $sudo touch "$2"
if [[ $(cat $2) == *"$1"* ]]; then
echo -e "
\rThe following lines were already added
\r=============
\r$1
\r============="
else
cat << POMU | $sudo tee -a $2 > /dev/null
$1
POMU
fi
}
sudo apt update -y
sudo apt upgrade -y
# Remove LibreOffice
echo "
Removing LibreOffice"
sudo apt-get remove --purge libreoffice*
sudo apt-get clean
sudo apt-get autoremove
# apt
echo "
Installing apt packages"
sudo add-apt-repository ppa:flatpak/stable -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update -y
sudo apt install flatpak git xclip neofetch aria2 gnome-tweaks -y
# flatpak
echo "
Installing flatpak packages"
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.libreoffice.LibreOffice com.belmoussaoui.Authenticator org.gimp.GIMP io.mpv.Mpv com.discordapp.Discord org.qbittorrent.qBittorrent org.kde.kdenlive org.x.Warpinator com.github.finefindus.eyedropper org.bunkus.mkvtoolnix-gui com.mattjakeman.ExtensionManager -y
# Github CLI & login
echo "
Installing Github CLI & login"
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
gh auth login
# Linux config
echo "
Adding Linux configs"
git clone https://github.com/pomubry/linux-config.git ~/Downloads/linux-config
chmod +x ~/Downloads/linux-config/bin/*
mkdir ~/bin
cp -r ~/Downloads/linux-config/bin ~/Downloads/linux-config/mumble-dark.qbtheme ~/Downloads/linux-config/.poshthemes ~
cp -r ~/Downloads/linux-config/Code ~/.config
mkdir -p ~/.var/app/io.mpv.Mpv/config/mpv
cp -r ~/Downloads/linux-config/mpv/* ~/.var/app/io.mpv.Mpv/config/mpv
append '
# custom alias
alias mpv="flatpak run io.mpv.Mpv"
alias mkvmerge="flatpak run org.bunkus.mkvtoolnix-gui"' ~/.bashrc
append '
# bin
export PATH=~/bin:$PATH' ~/.bashrc
if [[ $(cat ~/.gitconfig) == *defaultbranch* ]]; then
echo "Github user/defaultbranch config already added. Skipping..."
else
echo "$(cat ~/Downloads/linux-config/.gitconfig)
$(cat ~/.gitconfig)" > ~/.gitconfig
fi
rm -rf ~/Downloads/linux-config
# oh-my-posh
echo "
Installing oh-my-posh"
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
# mkdir ~/.poshthemes
# wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
# unzip -o ~/.poshthemes/themes.zip -d ~/.poshthemes
chmod u+rw ~/.poshthemes/*.omp.*
# rm ~/.poshthemes/themes.zip
# font for oh-my-posh
echo "
Installing font for oh-my-posh"
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaCode.zip -O ~/Downloads/cascadia-nf.zip
mkdir ~/.fonts
unzip -o -j ~/Downloads/cascadia-nf.zip "Caskaydia Cove Nerd Font Complete Mono Regular.otf" -d ~/.fonts
rm ~/Downloads/cascadia-nf.zip
# config for oh-my-posh
append '
# poshtheme config
eval "$(oh-my-posh init bash --config ~/.poshthemes/pdrome.omp.json)"' ~/.bashrc
# nvm
echo "
Installing nvm"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
# VSCode
echo "
Installing VSCode"
sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt install apt-transport-https
sudo apt update
sudo apt install code
# Veracrypt
echo "
Installing Veracrypt"
veracryptLatest=$(curl https://www.veracrypt.fr/en/Downloads.html | grep -i "Latest Stable Release" | egrep -o "[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}")
ubuntuVersion=$(cat /proc/version | egrep -o "[0-9]{2}\.[0-9]{2}")
ubuntuVersion=${ubuntuVersion:0:5}
veracryptGui="https://launchpad.net/veracrypt/trunk/$veracryptLatest/+download/veracrypt-$veracryptLatest-Ubuntu-$ubuntuVersion-amd64.deb"
wget $veracryptGui -O ~/Downloads/veracryptGui.deb
sudo apt install ~/Downloads/veracryptGui.deb -y
rm ~/Downloads/veracryptGui.deb
# ProtonVPN
echo "
Installing ProtonVPN"
protonvpn=$(curl https://protonvpn.com/support/linux-ubuntu-vpn-setup/ | grep "/stable" | egrep -o "https.+\.deb")
wget $protonvpn -O ~/Downloads/protonvpn.deb
sudo apt install ~/Downloads/protonvpn.deb
sudo apt update -y
sudo apt install protonvpn
sudo apt install gnome-shell-extension-appindicator gir1.2-appindicator3-0.1
rm ~/Downloads/protonvpn.deb
echo "Done!"