-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_script.sh
More file actions
executable file
·131 lines (108 loc) · 3.95 KB
/
Copy pathsetup_script.sh
File metadata and controls
executable file
·131 lines (108 loc) · 3.95 KB
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
#!/bin/bash
set -euo pipefail
exec > >(tee output.log) 2>&1
source "utils.sh"
install_apps() {
BASE_PKGS=(git rsync nano fastfetch greetd greetd-agreety fish github-cli micro ttf-firacode-nerd noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra timidity++ mpd mpc ncmpcpp mpdscribble brightnessctl flatpak tree bash-completion uv)
DESKTOP_PKGS=(wayland niri xorg xwayland-satellite wl-clipboard fuzzel mako foot polkit-gnome xdg-desktop-portal xdg-desktop-portal-gnome gnome-keyring awww swayidle)
APP_PKGS=(firefox zed nicotine+ nautilus vesktop gimp krita steam celluloid loupe seahorse)
PACMAN_PKGS=("${BASE_PKGS[@]}" "${DESKTOP_PKGS[@]}" "${APP_PKGS[@]}")
PARU_PKGS=()
FLATPAK_PKGS=(io.github.arijanj.Mimic com.stremio.Stremio)
log "Installing packages..."
sudo pacman -S --needed "${PACMAN_PKGS[@]}"
paru -S --needed "${PARU_PKGS[@]}"
flatpak install -y flathub "${FLATPAK_PKGS[@]}"
uv tool install beets
log "Finished installing packages."
}
configure_apps() {
# mpd doesn't create these itself
mkdir -p "$HOME/.local/share/mpd/playlists"
mkdir -p "$HOME/.local/state/mpd"
local SOURCES=(
"Pictures/Wallpapers"
".config/niri"
".config/fastfetch"
".config/foot"
".config/fuzzel"
".config/mako"
".config/mpd"
".config/beets"
".config/ncmpcpp"
)
log "Setting up dotfiles..."
for src in "${SOURCES[@]}"; do
if [[ -d "giffoni/${src}" ]]; then
install_dotfile "giffoni/${src}" "$HOME/${src}"
else
warn "Source not found, skipping: $src"
fi
done
log "Setting up system config files..."
sudo cp -vr sys_configs/greetd_config.toml /etc/greetd/config.toml
log "Enabling services..."
local USER_SERVICES=(mpd mpdscribble)
local SYS_SERVICES=(greetd)
for service in "${USER_SERVICES[@]}"; do
systemctl --user enable "$service" || warn "Failed to enable $service."
done
for service in "${SYS_SERVICES[@]}"; do
sudo systemctl enable "$service" || warn "Failed to enable $service."
done
log "Adding ASCII greeting..."
sudo cp -vr sys_configs/login_greet.txt /etc/issue
log "Configuring git..."
git config --global color.ui auto
log "Changing user shell to fish..."
chsh -s /bin/fish
log "Finished configuring apps."
}
giffoni_related() {
while true; do
read -p "Are you Giffoni, and is your HD plugged in? (y/n): " yn
case $yn in
[Yy]*)
log "Configuring git for Giffoni..."
git config --global user.name "Giffoni Lopes"
git config --global user.email "kgiffoni_@tuta.com"
log "Getting external hard drive files..."
sudo mount /dev/sda1 /mnt
rsync -rtv --progress /mnt/Music/ $HOME/Music/
cp -vr /mnt/.mpdscribble $HOME/
cp -vr /mnt/Code $HOME/
log "Unmounting external hard drive..."
sudo umount /mnt
break
;;
[Nn]*)
log "Alrighty then..."
break
;;
*)
warn "Please answer yes or no."
;;
esac
done
}
# grub_tweaks() {
# log "Tweaking grub config..."
# # find a line that starts with GRUB_CMDLINE_LINUX_DEFAULT, if it has the word "splash", removes that word
# sudo sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=.*splash/{
# s/ splash//
# s/splash //
# s/splash//
# }' /etc/default/grub
# # find a line that starts with GRUB_TIMEOUT= and replace whatever its value is with, including quotes, '0'
# sudo sed -i "s/^\(GRUB_TIMEOUT=\).*/\1'0'/" /etc/default/grub
# log "Applying new grub config..."
# sudo grub-mkconfig -o /boot/grub/grub.cfg
# log "Finished tweaking grub."
# }
check_deps pacman paru git awk sudo
install_apps
configure_apps
# not realy using GRUB anymore :p
# grub_tweaks
giffoni_related
log "All done. Restart and enjoy."