-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
207 lines (168 loc) · 7.15 KB
/
install.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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#!/bin/bash
SOURCE_DIR=${SOURCE_DIR:-'/tmp/dotfiles'}
USE_ZSH=${USE_ZSH:-0}
USE_OH_MY_ZSH=${USE_OH_MY_ZSH:-0}
USE_PREZTO_ZSH=${USE_PREZTO_ZSH:-1}
USE_POWERLEVEL10K=${USE_POWERLEVEL10K:-0}
USE_GNOME=${USE_GNOME:-1}
INSTALL_VIM=${INSTALL_VIM:-0}
INSTALL_EMACS=${INSTALL_EMACS:-0}
INSTALL_ANDROIND_ADB=${INSTALL_ANDROIND_ADB:-1}
cat << EOF | sudo tee -a /etc/dnf/dnf.conf
fastestmirror=True
max_parallel_downloads=8
EOF
sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install -y htop glances vim-enhanced axel mumble \
gnupg zsh zstd bzip2 tmux \
pinta alacritty keepassxc fwupd vlc \
p7zip unzip ccze wavemon powertop \
rsync util-linux-user iperf3 \
libavif-tools lshw pavucontrol \
plymouth-theme-hot-dog
sudo dnf install -y dnf-plugins-core
if [ "$USE_GNOME" -eq "0" ]; then
sudo yum install -y gnome-tweaks gnome-backgrounds-extras variety
fi
sudo dnf groupinstall -y development-tools
sudo dnf install -y python3-devel python2-devel python3-pip \
git qemu libvirt virt-manager podman podman-docker
sudo yum remove -y nano
sudo yum install -y https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
# configure podman - rootless
sudo systemctl --user enable --now podman.socket
systemctl --user enable --now podman.socket
# systemctl --user status podman.socket
## brave
#sudo dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/x86_64/
#sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
#sudo dnf install -y brave-browser
# some python libs
# pip --user install pdbpp remote_pdb mypy
pip3 --user install ansiblelint black docutils elasticsearch \
flake8 gitreview openstackclient pdbpp remote_pdb ipdb jedi \
mypy neovim numpy pandoc pylint pyflakes pynvim tox \
virtualenv yamllint zuulfmt jinjalint -U
### nerd fonts
#git clone --depth 1 https://github.com/ryanoasis/nerd-fonts /tmp/nerd-fonts
#cd /tmp/nerd-fonts && sudo ./install.sh -M -O -S
#cd -
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts && \
curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf && \
cd -
# npm
curl --silent --location https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo npm install -g pnpm prettier
# dotfiles
mkdir -p ~/.vim/
if ! [ -d "${SOURCE_DIR}" ]; then
git clone https://github.com/danpawlik/dotfiles.git "${SOURCE_DIR}"
fi
# vim
if [ "$INSTALL_VIM" -eq "0" ]; then
bash "${SOURCE_DIR}/setup-vim.sh"
fi
if [ "$INSTALL_EMACS" -eq "0" ]; then
sudo yum install -y ShellCheck marked ripgrep fd-find || true
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
fi
# android
if [ "$INSTALL_ANDROIND_ADB" -eq "0" ]; then
sudo yum install -y android-tools.x86_64 android-file-transfer
git clone https://github.com/M0Rf30/android-udev-rules /tmp/android-udev-rules
sudo bash -x /tmp/android-udev-rules/install.sh "$(whoami)"
fi
# tmux
# alternative config git clone https://github.com/gpakosz/.tmux.git "${HOME}/.tmux"
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
$HOME/.tmux/plugins/tpm/bin/install_plugins
ln -s "${HOME}/.tmux/.tmux.conf" "${HOME}/.tmux.conf"
cp -a $SOURCE_DIR/tmux/.tmux* "${HOME}/"
if [ "$USE_ZSH" -eq "0" ]; then
# prezto
if [ "$USE_PREZTO_ZSH" -eq "0" ]; then
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
setopt EXTENDED_GLOB
for rcfile in $(ls "${HOME}/.zprezto/runcoms/" | grep -vi 'readme'); do
ln -s "${HOME}/.zprezto/runcoms/${rcfile}" "${ZDOTDIR:-$HOME}/.${rcfile}"
done
cp -a $SOURCE_DIR/prezto/.z* "${HOME}/.zprezto/runcoms/"
git clone --recurse-submodules https://github.com/belak/prezto-contrib "${ZPREZTODIR}/contrib"
# starship
mkdir -p "${HOME}/.config"
curl -SL https://starship.rs/install.sh > /tmp/starship.sh
bash /tmp/starship.sh -y
cp -a $SOURCE_DIR/starship/starship.toml "${HOME}/.config/"
fi
# oh my zsh
if [ "$USE_OH_MY_ZSH" -eq "0" ]; then
unset ZSH
curl -SL "https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh" | bash
if [ "$USE_POWERLEVEL10K" -eq "0" ]; then
cp $SOURCE_DIR/powerlevel10k/.p10k.zsh "${HOME}/"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
fi
# install zsh autosuggestions.
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
cp -a $SOURCE_DIR/oh_my_zsh/.z* "${HOME}/"
fi
cp -a $SOURCE_DIR/zsh_common/.z* "$HOME/"
# FIXME: it requires password
# chsh -s /bin/zsh
source "${HOME}/.zshrc"
fi
# add FZF
$HOME/.vim/plugged/fzf/install --all
# alacritty
mkdir -p "${HOME}/.config"
cp -a $SOURCE_DIR/alacritty "${HOME}/.config/"
# git
git config --global core.editor vim
git config --global core.pager cat
git config --global pager.branch false
# install fonts
FONT_DIR=/tmp/fonts
mkdir -p "${FONT_DIR}" "${HOME}/.fonts"
curl -SL https://github.com/tonsky/FiraCode/releases/download/5.2/Fira_Code_v5.2.zip > $FONT_DIR/Fira_code.zip
curl -SL https://github.com/source-foundry/Hack/releases/download/v3.003/Hack-v3.003-ttf.zip > $FONT_DIR/Hack.zip
curl -SL https://fonts.google.com/download?family=Work%20Sans > $FONT_DIR/Work_Sans.zip
curl -SL https://fonts.google.com/download?family=Source%20Sans%20Pro > $FONT_DIR/Source_Sans_Pro.zip
curl -SL https://fonts.google.com/download?family=Lato > $FONT_DIR/Lato.zip
curl -SL https://fonts.google.com/download?family=Open%20Sans > $FONT_DIR/Open_Sans.zip
curl -SL https://fonts.google.com/download?family=Roboto > $FONT_DIR/Roboto.zip
curl -SL https://fonts.google.com/download?family=Source%20Code%20Pro > $FONT_DIR/Source_Code_Pro.zip
cd "${FONT_DIR}"
for i in $(ls | grep '.zip'); do 7za x -y $i; done
for i in $(find . -type f -name '*ttf' | grep -i regular); do cp $i $HOME/.fonts/ ; done
cd -
# restore KDE env
#TBD
# System tune
sudo mkdir -p /etc/NetworkManager/conf.d/
if ! [ -f '/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf' ]; then
cat << EOF | sudo tee /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
[connection]
wifi.powersave = 2
EOF
fi
cat << EOF | sudo tee /etc/systemd/system/powertop.service
[Unit]
Description=PowerTOP auto tune
[Service]
Type=oneshot
Environment="TERM=dumb"
RemainAfterExit=true
ExecStart=/usr/sbin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now powertop.service
if [ "$USE_ZSH" -eq "0" ]; then
echo "All configuration applied, changing shell is missing..."
echo "Changing the shell to zsh"
chsh -s /bin/zsh
fi