-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgru.fish
executable file
·471 lines (385 loc) · 10.8 KB
/
gru.fish
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
#!/usr/bin/env fish
set SCRIPT_DIR (realpath (dirname (status -f)))
source $SCRIPT_DIR/modules/common.fish
function read_confirm --description 'Ask the user for confirmation' --argument prompt default
if test -z "$prompt"
set prompt "Continue?"
end
set -l choice "[Y/n]"
switch $default
case N n
set choice "[y/N]"
set default_return 1
case '*'
set default Y
set default_return 0
end
while true
read -p 'set_color green; echo -n "$prompt $choice: "; set_color normal' -l confirm
switch $confirm
case Y y
return 0
case N n
return 1
case ''
return $default_return
end
end
end
function setup_git
if ! read_confirm "Setup git?"
return
end
install_package git
if install_package git-lfs
echo "Setup git-lfs"
git lfs install
end
if test ! -L $HOME/.gitconfig.local
echo "Linking gitconfig"
ln -s $SCRIPT_DIR/.gitconfig.local $HOME/.gitconfig.local
git config --global include.path $HOME/.gitconfig.local
read -p 'set_color green; echo -n "Git user name: "; set_color normal' -l user_name
read -p 'set_color green; echo -n "Git user email: "; set_color normal' -l user_email
git config --global user.name $user_name
git config --global user.email $user_email
end
install_package github-cli
end
function setup_neovim
if ! read_confirm "Setup neovim?"
return
end
install_package neovim
install_package neovide
set -l nvim_dir "$HOME/.config/nvim"
set -l nvim_config_repo "[email protected]:synasius/nvim-lazyvim.git"
if test ! -e $nvim_dir
git clone $nvim_config_repo $nvim_dir && nvim
end
end
function setup_kitty
if ! read_confirm "Setup kitty?"
return
end
install_package kitty
backup_and_link $SCRIPT_DIR/kitty $HOME/.config/kitty
end
function setup_fish
if ! read_confirm "Setup fish?"
return
end
set -l fish_shell_passwd (grep -E $USER".*fish" /etc/passwd | string trim)
if test -z $fish_shell_passwd
chsh -s (which fish)
end
backup_and_link $SCRIPT_DIR/fish $HOME/.config/fish
end
function setup_fnm
if ! read_confirm "Setup Fast Node Manager?"
return
end
install_package fnm-bin
end
function setup_docker
if ! read_confirm "Setup docker?"
return
end
install_package docker
install_package docker-buildx
install_package docker-compose
if test -z (groups | grep docker)
echo Add $USER "to group docker"
sudo usermod -aG docker $USER
end
end
function setup_rust
if ! read_confirm "Setup rust?"
return
end
if install_package rustup
rustup default stable
rustup component add rust-analyzer rust-src
else
rustup update
end
# an alternative linker
install_package lld
install_package cargo-watch
install_package cargo-tarpaulin
install_package cargo-audit
install_package cargo-expand
install_package cargo-udeps
install_package cargo-expand
install_package sqlx-cli
end
function setup_unity
if ! read_confirm "Setup Unity?"
return
end
install_package unityhub
# To support progressive lightmapper GPU
install_package clinfo
install_package ocl-icd
install_package opencl-headers
# To support install of Android SDK
install_package cpio
# Other tools for scripting
# install_package visual-studio-code-bin
install_package dotnet-runtime
install_package dotnet-sdk
install_package mono-msbuild
install_package mono
end
function setup_godot
if ! read_confirm "Setup Godot?"
return
end
install_package godot
end
function setup_flutter
if ! read_confirm "Setup Flutter?" n
return
end
install_package fvm-bin
install_package android-studio
# For web build
install_package google-chrome
# For desktop support
install_package clang
install_package cmake
install_package ninja
end
function setup_keyboard_modifiers
if ! read_confirm "Setup Keyboard Modifiers (for XFCE, not necessary in Gnome)?" n
return
end
set -l modifiers "ctrl:nocaps,compose:ralt"
set -l modifiers_found (grep -E $modifiers /etc/X11/xorg.conf.d/00-keyboard.conf | string trim)
if test -z $modifiers_found
echo "Setup modifiers in xorg.conf.d"
localectl set-x11-keymap us "" "" ctrl:nocaps,compose:ralt
end
set -l modifiers_found (grep -E $modifiers /etc/default/keyboard | string trim)
if test -z $modifiers_found
echo "Setup modifiers in /etc/default/keyboard"
sudo sed -i 's/XKBOPTIONS=".*"/XKBOPTIONS="ctrl:nocaps,compose:ralt"/g' /etc/default/keyboard
end
end
function setup_starship
if ! read_confirm "Setup Stasrship?"
return
end
install_package starship
backup_and_link $SCRIPT_DIR/starship.toml $HOME/.config/starship.toml
end
function setup_shell_themes
if ! read_confirm "Setup Terminal Themes?"
return
end
set -l themes_dir $HOME/.config/gruthemes
if test ! -d $themes_dir
git clone [email protected]:folke/tokyonight.nvim.git $themes_dir --depth 1
else
git -C $themes_dir pull
end
end
function setup_gaming
if ! read_confirm "Setup Gaming?"
return
end
# entertainment
install_package steam
install_package wine
install_package lutris
install_package mangohud
install_package gamemode
install_package vulkan-tools
if test ! -d "$HOME/.itch"
echo "Setup itch.io"
pushd /tmp
curl -JLO "https://itch.io/app/download?platform=linux"
chmod +x itch-setup && ./itch-setup
rm itch-setup
popd
end
end
function setup_various
if ! read_confirm "Setup Various?"
return
end
flatpak install com.spotify.Client
flatpak install flathub com.discordapp.Discord
flatpak install io.gitlab.azymohliad.WatchMate
flatpak install io.gitlab.news_flash.NewsFlash
flatpak install flathub org.famistudio.FamiStudio
flatpak install org.kde.digikam
flatpak install io.bassi.Amberol
flatpak install org.gnome.design.Lorem
flatpak install de.haeckerfelix.Fragments
install_package obsidian
install_package foliate
install_package shotwell
install_package calibre
install_package bitwarden
install_package switcheroo-control
install_package just
install_package jq
install_package binance
install_package anytype
# UFRII driver for Canon printers
install_package cnrdrvcups-lb
end
function setup_fonts
if ! read_confirm "Setup fonts?"
return
end
install_package ttf-nerd-fonts-symbols-common
install_package ttf-nerd-fonts-symbols-2048-em
install_package xclip
set -l font_path $HOME/.local/share/fonts/MonoLisa
if test -e $font_path
return
end
echo "setup MonoLisa font"
while true
read -p 'set_color green; echo -n "Path to monolisa font: "; set_color normal' -l path
if test -e $path
mkdir -p $font_path
unzip -d $font_path $path
return
else
echo 'Invalid MonoLisa path'
end
end
end
# utilities
function setup_cli_utils
if ! read_confirm "Setup cli utilities?"
return
end
install_package ripgrep
install_package fd
install_package dua-cli
install_package dust
install_package bat
install_package bottom
install_package exa
end
# cloud
function setup_cloud
if ! read_confirm "Setup cloud utilities?"
return
end
install_package google-cloud-cli
install_package google-cloud-cli-gke-gcloud-auth-plugin
install_package kubectl
install_package sops
install_package aws-cli
install_package helm
install_package cmctl
end
function setup_python
if ! read_confirm "Setup python dev tools?"
return
end
install_package python-poetry
install_package python-tox
install_package pyenv
install_package postgresql-libs
install_package ruff
end
# For integration testing
function setup_integration_testing
if ! read_confirm "Setup integration testing tools?" n
return
end
install_package xorg-server-xvfb
install_package google-chrome
install_package chromedriver
end
# graphics and media
function setup_graphic
if ! read_confirm "Setup graphic tooling?"
return
end
install_package blender
install_package gimp
install_package inkscape
install_package krita
install_package simple-scan
install_package evince
install_package xf86-input-wacom
install_package libwacom
install_package pureref
install_package perl-image-exiftool
install_package jhead
install_package optipng
install_package pngquant
end
# Mega client
function setup_mega_sync
echo "TO BE IMPLEMENTED"
end
# Gnome Extensions
function setup_gnome
if ! read_confirm "Setup gnome?"
return
end
install_package gnome-browser-connector
install_package gnome-calendar
install_package gnome-font-viewer
install_package gnome-characters
install_package gnome-clocks
install_package gnome-logs
install_package gnome-tweaks
backup_and_link $SCRIPT_DIR/slideshows/Wallpapers $HOME/Pictures/Wallpapers
backup_and_link $SCRIPT_DIR/slideshows/gnome-background-properties $HOME/.local/share/gnome-background-properties
end
setup_git
setup_neovim
setup_fish
setup_kitty
setup_shell_themes
setup_fnm
# game dev
setup_unity
setup_godot
setup_gaming
setup_fonts
setup_starship
setup_cli_utils
setup_cloud
# development
setup_docker
setup_python
setup_rust
setup_integration_testing
setup_mega_sync
setup_graphic
setup_various
setup_gnome
# Flutter
# setup_flutter
# Run `flutter doctor`
# Install Android SDK and SDK Commandline Tools
# Accept licenses `flutter doctor --android-licenses`
#
# TODO: Things to add:
# - nvidia-all
# - backlight.rules
# ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video $sys$devpath/brightness", RUN+="/bin/chmod g+w $sys$devpath/brightness"
# - Parameter to /etc/kernel/cmdline
# acpi_backlight=nvidia_wmi_ec
# - gcr-ssh-agent
# systemctl --user enable gcr-ssh-agent.socket
# systemctl --user enable gcr-ssh-agent.service
# systemctl --user start gcr-ssh-agent.service
# - download mega from website and install
# sudo pacman -U ~/Downloads/megasync-x86_64.pkg.tar.zst
# sudo pacman -U ~/Downloads/nautilus-megasync-x86_64.pkg.tar.zst
echo "Other Thing To Do:"
echo "- Sync Firefox account"
echo "- Install AppIndicator extension for Gnome"
echo "- Setup MonoLisa font"
echo "- Setup gnome online accounts"