-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·248 lines (220 loc) · 12 KB
/
setup.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#!/bin/bash
ROOT_DIR=$HOME/.local/share/ubuntu-setup
CONFIGS_DIR=$ROOT_DIR/configs
RUNNING_GNOME=$([[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]] && echo true || echo false)
setup_system() {
echo "Setup System..."
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y curl fonts-firacode git
sudo cp $CONFIGS_DIR/sysctl.conf /etc/sysctl/local.conf
sudo sysctl -qp
cp $CONFIGS_DIR/bashrc ~/.bashrc
cp $CONFIGS_DIR/inputrc ~/.inputrc
cp $CONFIGS_DIR/aliases ~/.aliases
if $RUNNING_GNOME; then
sudo apt-get install -y dconf-editor flatpak gnome-shell-extension-manager gnome-sushi gnome-tweaks
sudo ln -sf /var/lib/snapd/snap /snap
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
gsettings set org.gnome.desktop.app-folders folder-children "['']"
gsettings set org.gnome.desktop.interface clock-show-date false
gsettings set org.gnome.desktop.notifications show-in-lock-screen false
gsettings set org.gnome.desktop.peripherals.touchpad click-method 'fingers'
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click false
gsettings set org.gnome.desktop.privacy report-technical-problems false
gsettings set org.gnome.desktop.session idle-delay 0
gsettings set org.gnome.desktop.wm.keybindings close "['<Super>w']"
gsettings set org.gnome.desktop.wm.keybindings switch-group "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-group-backward "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>1']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Super>2']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Super>3']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Super>4']"
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Super>f']"
gsettings set org.gnome.desktop.wm.preferences auto-raise true
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:minimize,maximize,close'
gsettings set org.gnome.desktop.wm.preferences num-workspaces 4
gsettings set org.gnome.mutter attach-modal-dialogs false
gsettings set org.gnome.mutter center-new-windows true
gsettings set org.gnome.mutter dynamic-workspaces false
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-automatic false
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-from 22.0
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-to 6.0
gsettings set org.gnome.settings-daemon.plugins.media-keys screen-reader "[]"
gsettings set org.gnome.settings-daemon.plugins.power ambient-enabled false
gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 3600
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 1800
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing'
gsettings set org.gnome.shell app-picker-layout "[]"
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed false
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position 'BOTTOM'
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true
gsettings set org.gnome.shell.extensions.dash-to-dock scroll-action 'cycle-windows'
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false
gsettings set org.gnome.shell.extensions.ding show-home false
gsettings set org.gnome.shell.extensions.ding start-corner 'top-left'
gsettings set org.gnome.shell.keybindings switch-to-application-1 "['<Alt>1']"
gsettings set org.gnome.shell.keybindings switch-to-application-2 "['<Alt>2']"
gsettings set org.gnome.shell.keybindings switch-to-application-3 "['<Alt>3']"
gsettings set org.gnome.shell.keybindings switch-to-application-4 "['<Alt>4']"
gsettings set org.gnome.shell.keybindings switch-to-application-5 "['<Alt>5']"
gsettings set org.gnome.shell.keybindings switch-to-application-6 "['<Alt>6']"
gsettings set org.gnome.shell.keybindings switch-to-application-7 "['<Alt>7']"
gsettings set org.gnome.shell.keybindings switch-to-application-8 "['<Alt>8']"
gsettings set org.gnome.shell.keybindings switch-to-application-9 "['<Alt>9']"
gnome-extensions disable ding@rastersoft.com
gnome-extensions disable tiling-assistant@ubuntu.com
fi
}
setup_extensions() {
echo "Setup Extensions..."
sudo apt-get install -y pipx
pipx install gnome-extensions-cli --system-site-packages
gext install just-perfection-desktop@just-perfection
gext install Vitals@CoreCoding.com
gext install ddterm@amezin.github.com
gext install easy_docker_containers@red.software.systems
sudo cp ~/.local/share/gnome-shell/extensions/just-perfection-desktop\@just-perfection/schemas/org.gnome.shell.extensions.just-perfection.gschema.xml /usr/share/glib-2.0/schemas/
sudo cp ~/.local/share/gnome-shell/extensions/Vitals\@CoreCoding.com/schemas/org.gnome.shell.extensions.vitals.gschema.xml /usr/share/glib-2.0/schemas/
sudo cp ~/.local/share/gnome-shell/extensions/ddterm\@amezin.github.com/schemas/com.github.amezin.ddterm.gschema.xml /usr/share/glib-2.0/schemas/
sudo cp ~/.local/share/gnome-shell/extensions/easy_docker_containers\@red.software.systems/schemas/red.software.systems.easy_docker_containers.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
gsettings set org.gnome.shell.extensions.just-perfection animation 5
gsettings set org.gnome.shell.extensions.just-perfection window-demands-attention-focus true
gsettings set org.gnome.shell.extensions.vitals hot-sensors "['_memory_usage_', '_processor_usage_', '_battery_rate_']"
gsettings set org.gnome.shell.extensions.vitals show-battery true
gsettings set org.gnome.shell.extensions.vitals show-fan false
gsettings set org.gnome.shell.extensions.vitals show-storage false
gsettings set org.gnome.shell.extensions.vitals show-system false
gsettings set org.gnome.shell.extensions.vitals show-voltage false
gsettings set org.gnome.shell.extensions.vitals update-time 3
gsettings set com.github.amezin.ddterm background-color '#282A36'
gsettings set com.github.amezin.ddterm bold-color '#6E46A4'
gsettings set com.github.amezin.ddterm bold-color-same-as-fg false
gsettings set com.github.amezin.ddterm custom-font 'Monospace 12'
gsettings set com.github.amezin.ddterm ddterm-toggle-key "['<Super>grave']"
gsettings set com.github.amezin.ddterm foreground-color '#F8F8F2'
gsettings set com.github.amezin.ddterm palette "['#262626', '#E356A7', '#42E66C', '#E4F34A', '#9B6BDF', '#E64747', '#75D7EC', '#EFA554', '#7A7A7A', '#FF79C6', '#50FA7B', '#F1FA8C', '#BD93F9', '#FF5555', '#8BE9FD', '#FFB86C']"
gsettings set com.github.amezin.ddterm panel-icon-type 'none'
gsettings set com.github.amezin.ddterm scrollback-lines 8192
gsettings set com.github.amezin.ddterm tab-policy 'automatic'
gsettings set com.github.amezin.ddterm use-theme-colors false
gsettings set com.github.amezin.ddterm window-above false
gsettings set com.github.amezin.ddterm windows-size 0.5
gsettings set red.software.systems.easy_docker_containers refresh-delay 3
}
setup_gestures() {
echo "Setup Gestures..."
sudo apt-get install -y wmctrl xdotool libinput-tools
git clone -q https://github.com/bulletmark/libinput-gestures.git /tmp/libinput-gestures
cd /tmp/libinput-gestures
sudo ./libinput-gestures-setup install
sudo usermod -aG input $USER
cd - > /dev/null
rm -rf /tmp/libinput-gestures
cp $CONFIGS_DIR/libinput-gestures/libinput-gestures.conf ~/.config/libinput-gestures.conf
libinput-gestures-setup service autostart start
}
setup_zsh() {
echo "Setup ZSH..."
sudo apt-get install -y zsh
chsh -s /bin/zsh
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-completions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-history-substring-search.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
cp $CONFIGS_DIR/zshrc ~/.zshrc
}
setup_zellij() {
echo "Setup Zellij..."
curl -sLo /tmp/zellij.tar.gz https://github.com/zellij-org/zellij/releases/latest/download/zellij-x86_64-unknown-linux-musl.tar.gz
tar -xf /tmp/zellij.tar.gz -C /tmp zellij
sudo install /tmp/zellij /usr/local/bin
rm /tmp/zellij.tar.gz /tmp/zellij
mkdir -p ~/.config/zellij
cp $CONFIGS_DIR/zellij.kdl ~/.config/zellij/config.kdl
}
setup_docker() {
echo "Setup Docker..."
sudo apt-get install -y docker.io docker-buildx docker-compose-plugin
sudo usermod -aG docker $USER
}
setup_mise() {
echo "Setup Mise..."
curl -s https://mise.run | sh
mise use --global node@lts
mise use --global go@latest
}
setup_lazygit() {
echo "Setup Lazygit..."
LAZYGIT_VERSION=$(curl -s https://api.github.com/repos/jesseduffield/lazygit/releases/latest | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo /tmp/lazygit.tar.gz https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz
tar -xf /tmp/lazygit.tar.gz -C /tmp lazygit
sudo install /tmp/lazygit /usr/local/bin
rm /tmp/lazygit.tar.gz /tmp/lazygit
}
setup_lazydocker() {
echo "Setup Lazydocker..."
LAZYDOCKER_VERSION=$(curl -s https://api.github.com/repos/jesseduffield/lazydocker/releases/latest | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo /tmp/lazydocker.tar.gz https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz
tar -xf /tmp/lazydocker.tar.gz -C /tmp lazydocker
sudo install /tmp/lazydocker /usr/local/bin
rm /tmp/lazydocker.tar.gz /tmp/lazydocker
}
setup_flameshot() {
echo "Setup Flameshot..."
sudo apt-get install -y flameshot
mkdir -p ~/.config/flameshot
cp $CONFIGS_DIR/flameshot.ini ~/.config/flameshot/flameshot.ini
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybindings:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'Flameshot'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybindings:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command 'sh -c -- "flameshot gui"'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybindings:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding '<Super>c'
}
setup_alacritty() {
echo "Setup Alacritty..."
sudo apt-get install -y alacritty
mkdir -p ~/.config/alacritty
cp $CONFIGS_DIR/alacritty.toml ~/.config/alacritty/alacritty.toml
}
setup_core() {
setup_system
[[ $RUNNING_GNOME ]] && setup_extensions
[[ $RUNNING_GNOME ]] && setup_gestures
}
setup_cli() {
setup_zsh
setup_zellij
setup_docker
setup_mise
setup_lazygit
setup_lazydocker
}
setup_desktop() {
setup_flameshot
setup_alacritty
}
setup_all() {
setup_core
setup_cli
[[ $RUNNING_GNOME ]] && setup_desktop
}
case $1 in
"all") setup_all ;;
"core") setup_core ;;
"cli") setup_cli ;;
"desktop") [[ $RUNNING_GNOME ]] && setup_desktop ;;
"zsh") setup_zsh ;;
"zellij") setup_zellij ;;
"docker") setup_docker ;;
"mise") setup_mise ;;
"lazygit") setup_lazygit ;;
"lazydocker") setup_lazydocker ;;
"flameshot") [[ $RUNNING_GNOME ]] && setup_flameshot ;;
"alacrity") [[ $RUNNING_GNOME ]] && setup_alacrity ;;
esac