meta script for less code repetition (#21)

This commit is contained in:
Mylloon 2024-03-30 17:27:51 +01:00
parent 482fd90acc
commit c02da0b9ed
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 226 additions and 268 deletions

164
arch.sh
View file

@ -12,89 +12,57 @@ fi
cd "$(dirname "$0")" # change script directory cd "$(dirname "$0")" # change script directory
main() { main() {
# Variables # === Variables ==
local repo local repo
repo=https://git.mylloon.fr/Anri/confOS/raw/branch/main repo=https://git.mylloon.fr/Anri/confOS/raw/branch/main
# === Pacman configuration ==
pacman -D --asexplicit archlinux-keyring # keep this package
sudo sed -i "s/#Color/Color/g" /etc/pacman.conf
sudo sed -i "s/#ParallelDownloads = 5/ParallelDownloads = 3/g" /etc/pacman.conf
# === Remove extra packages == # === Assure that keyring is installed ==
pacman -D --asexplicit archlinux-keyring # keep this package
# === Remove extra packages from Gnome default + useless dependencies ==
sudo pacman -Rsn --noconfirm \ sudo pacman -Rsn --noconfirm \
epiphany gnome-maps cheese gnome-weather gnome-music gnome-books vim \ epiphany gnome-maps cheese gnome-weather gnome-music gnome-books vim \
# gnome-firefox, maps, caméra, météo, musique, liseuse, vim
gnome-boxes gnome-photos malcontent gnome-contacts totem gedit gnome-boxes gnome-photos malcontent gnome-contacts totem gedit
# machines, photos, parental control, contacts, vidéos, gedit
"$(pacman -Qqtd)" "$(pacman -Qqtd)"
# dependencies
# === Rustup ==
# Init rustup
rustup default stable
# Dev tools
rustup component add rust-analysis rls
# === Paru == # === Global OS configuration set-up ==
git clone https://aur.archlinux.org/paru.git # shellcheck disable=SC1091
cd paru || exit source meta.sh
makepkg -si --noconfirm
# Remove folder
cd ..
rm -rf paru ||:
paru --gendb
# Clean files used for compilation
sudo sed -i "s/#CleanAfter/CleanAfter/g" /etc/paru.conf
# === AUR packages == # === AUR packages ==
paru -S --noconfirm \ paru -S --noconfirm \
obsidian parsec-bin evolution-etesync-git x11-emoji-picker cram \ obsidian parsec-bin evolution-etesync-git x11-emoji-picker \
gnome-shell-extension-dash-to-dock gnome-shell-extension-desktop-icons-ng \ gnome-shell-extension-dash-to-dock gnome-shell-extension-desktop-icons-ng \
dracula-gtk-theme dracula-icons-git vscodium-bin otf-symbola touchegg \ dracula-gtk-theme dracula-icons-git vscodium-bin otf-symbola touchegg \
gnome-shell-extension-nightthemeswitcher nerd-fonts-meslo \ gnome-shell-extension-nightthemeswitcher nerd-fonts-meslo \
gnome-shell-extension-x11gestures gnome-shell-extension-no-overview \ gnome-shell-extension-x11gestures gnome-shell-extension-no-overview \
gnome-shell-extension-gsconnect gnome-shell-extension-tiling-assistant \ gnome-shell-extension-gsconnect gnome-shell-extension-tiling-assistant \
gnome-shell-extension-rounded-window-corners topgrade-bin ufw-docker \ gnome-shell-extension-rounded-window-corners ufw-docker blackbox-terminal \
gnome-shell-extension-alphabetical-grid-extension texlive-latexindent-meta \ gnome-shell-extension-alphabetical-grid-extension texlive-latexindent-meta \
gnome-shell-extension-quick-settings-tweaks-git gpu-screen-recorder-git \ gnome-shell-extension-quick-settings-tweaks-git gpu-screen-recorder-git \
epson-inkjet-printer-stylus-photo-px810fw-series heroic-games-launcher-bin \ epson-inkjet-printer-stylus-photo-px810fw-series heroic-games-launcher-bin \
gnome-shell-extension-blur-my-shell clamav-unofficial-sigs vesktop-bin \ gnome-shell-extension-blur-my-shell clamav-unofficial-sigs vesktop-bin \
blackbox-terminal nautilus-open-any-terminal nautilus-open-any-terminal
# === Disable wayland == # === Disable wayland ==
sed -i "s/#Wayland/Wayland/g" /etc/gdm/custom.conf sed -i "s/#Wayland/Wayland/g" /etc/gdm/custom.conf
# === Locales == # === Locales ==
sudo sed -i "s/fr_FR.UTF-8.UTF-8 UTF-8/fr_FR.UTF8 UTF-8/g" /etc/locale.gen sudo sed -i "s/fr_FR.UTF-8.UTF-8 UTF-8/fr_FR.UTF8 UTF-8/g" /etc/locale.gen
sudo locale-gen sudo locale-gen
localectl set-locale fr_FR.UTF-8 localectl set-locale fr_FR.UTF-8
# === Fish == # === Fish ==
# Remove motd # Custom Arch configuration
fish -c "set -U fish_greeting"
# Reversed search
curl -sL https://git.io/fisher | fish -c "source && fisher install jorgebucaran/fisher"
fish -c "fisher install jethrokuan/fzf"
fish -c "fisher install jorgebucaran/autopair.fish"
# SSH
wget -q https://gitlab.com/kyb/fish_ssh_agent/raw/master/functions/fish_ssh_agent.fish -P "$HOME"/.config/fish/functions/
mkdir -p "$HOME"/.ssh
# Custom config.fish
wget -q ${repo}/.config/fish/config_arch.fish -O "$HOME"/.config/fish/config.fish wget -q ${repo}/.config/fish/config_arch.fish -O "$HOME"/.config/fish/config.fish
# Fish theme
fish -c "fish_config theme choose 'Base16 Eighties' && yes | fish_config theme save"
# Fish prompt
rm "$HOME"/.config/fish/functions/fish_prompt.fish 2> /dev/null ||:
wget -q ${repo}/.config/fish/functions/fish_prompt.fish -P "$HOME"/.config/fish/functions/
# EZA colors
fish -c "set -Ux EXA_COLORS 'di=1;36:da=35'"
# Add abbreviations
wget -q ${repo}/.config/fish/conf.d/abbr.fish -O "$HOME"/.config/fish/conf.d/abbr.fish
curl -s ${repo}/.config/fish/conf.d/abbr_arch.fish >> "$HOME"/.config/fish/conf.d/abbr.fish curl -s ${repo}/.config/fish/conf.d/abbr_arch.fish >> "$HOME"/.config/fish/conf.d/abbr.fish
# Add aliases
wget -q ${repo}/.config/fish/conf.d/alias.fish -O "$HOME"/.config/fish/conf.d/alias.fish
curl -s ${repo}/.config/fish/conf.d/alias_arch.fish >> "$HOME"/.config/fish/conf.d/alias.fish curl -s ${repo}/.config/fish/conf.d/alias_arch.fish >> "$HOME"/.config/fish/conf.d/alias.fish
# Themes in Gnome Terminal, the default one will be the dark one # Themes in Gnome Terminal, the default one will be the dark one
@ -121,55 +89,17 @@ main() {
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ zoom-normal "<Control>agrave" # ctrl+0 gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ zoom-normal "<Control>agrave" # ctrl+0
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ next-tab "<Control>tab" # ctrl+tab gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ next-tab "<Control>tab" # ctrl+tab
# === Default editor ==
fish -c "set -Ux EDITOR nano"
# === Micro configuration ==
mkdir -p "$HOME"/.config/micro
wget -q --show-progress ${repo}/.config/micro/settings.json -O "$HOME"/.config/micro/settings.json
micro -plugin install detectindent
# # === GL4D ==
# # Download, build and installation
# git clone https://github.com/noalien/GL4Dummies.git
# cd GL4Dummies || exit
# make -f Makefile.autotools
# ./configure
# make
# sudo make install
# cd ..
# rm -rf GL4Dummies ||:
# # Fix for shared libraries (https://stackoverflow.com/a/9395355)
# sudo ldconfig
# # Add to path
# fish -c "set -Ua LD_LIBRARY_PATH /usr/local/lib"
# === Rust ==
# Add Cargo packages from Rust
mkdir -p "$HOME"/.cargo/bin
fish -c "fish_add_path $HOME/.cargo/bin ||:"
# Install cargo packages
cargo install cargo-update cargo-cache tealdeer
# === tldr ==
fish -c "tldr --update"
# Fish completion
local url_tldr
url_tldr=$(curl -s https://api.github.com/repos/dbrgn/tealdeer/releases/latest \
| grep 'browser_download_url": ".*/completions_fish"' \
| cut --delimiter=":" --field=2,3 \
| tr -d \" )
wget -q --show-progress "${url_tldr:1}" -O completions_fish
mv completions_fish ~/.config/fish/completions/tldr.fish
# === Spotify == # === Spotify ==
# is `spotify-launcher --force-update` needed before patching? # is `spotify-launcher --force-update` needed before patching?
bash <(curl -sSL https://spotx-official.github.io/run.sh) -ce bash <(curl -sSL https://spotx-official.github.io/run.sh) -ce
# === Syncthing == # === Syncthing ==
systemctl enable syncthing@"$USER".service systemctl enable syncthing@"$USER".service
systemctl start syncthing@"$USER".service systemctl start syncthing@"$USER".service
# === Flameshot == # === Flameshot ==
# Custom configuration # Custom configuration
rm "$HOME"/.config/flameshot/flameshot.ini 2> /dev/null ||: rm "$HOME"/.config/flameshot/flameshot.ini 2> /dev/null ||:
@ -189,6 +119,7 @@ main() {
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/ command "flameshot gui" # set command gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/ command "flameshot gui" # set command
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/ binding "Print" # set key gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot-shortcut/ binding "Print" # set key
# === Emoji picker == # === Emoji picker ==
# Custom configuration # Custom configuration
rm "$HOME"/.config/gazatu.xyz/emoji-picker.ini 2>/dev/null ||: rm "$HOME"/.config/gazatu.xyz/emoji-picker.ini 2>/dev/null ||:
@ -210,6 +141,7 @@ main() {
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ binding "<Super>period" # set shortcut gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/x11-emoji-picker/ binding "<Super>period" # set shortcut
fi fi
# === Gnome configuration == # === Gnome configuration ==
# Enable location # Enable location
gsettings set org.gnome.system.location enabled true gsettings set org.gnome.system.location enabled true
@ -309,6 +241,7 @@ main() {
systemctl enable touchegg.service systemctl enable touchegg.service
systemctl start touchegg systemctl start touchegg
# === Clipboard manager == # === Clipboard manager ==
gsettings set org.gnome.shell.keybindings toggle-message-tray "[]" gsettings set org.gnome.shell.keybindings toggle-message-tray "[]"
custom_keybindings_list=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings) custom_keybindings_list=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
@ -327,9 +260,11 @@ main() {
echo "style_main_window=true" >> /usr/share/copyq/themes/dark.ini echo "style_main_window=true" >> /usr/share/copyq/themes/dark.ini
copyq loadTheme /usr/share/copyq/themes/dark.ini copyq loadTheme /usr/share/copyq/themes/dark.ini
# === UBW (pare-feu) == # === UBW (pare-feu) ==
ufw enable ufw enable
# === Firefox == # === Firefox ==
firefox & firefox &
sleep 2 sleep 2
@ -345,19 +280,13 @@ main() {
#wget -q --show-progress ${repo}/.mozilla/firefox/extensions/SponsorBlockConfig.json -P "$HOME"/Téléchargements #wget -q --show-progress ${repo}/.mozilla/firefox/extensions/SponsorBlockConfig.json -P "$HOME"/Téléchargements
#wget -q --show-progress ${repo}/.mozilla/firefox/extensions/auto-tab-discard-preferences.json -P "$HOME"/Téléchargements #wget -q --show-progress ${repo}/.mozilla/firefox/extensions/auto-tab-discard-preferences.json -P "$HOME"/Téléchargements
# === Manual color ==
fish -c "set -Ux MANPAGER \"sh -c 'col -bx | bat -l man -p'\""
fish -c "set -Ux MANROFFOPT \"-c\""
# === Bat config ==
mkdir -p "$HOME"/.config/bat
wget -q --show-progress ${repo}/.config/bat/config -O "$HOME"/.config/bat/config
# === Docker == # === Docker ==
systemctl enable docker.service systemctl enable docker.service
systemctl start docker.service systemctl start docker.service
usermod -aG docker "$USER" usermod -aG docker "$USER"
# === Unused icons == # === Unused icons ==
apps=("fish" "cmake-gui" "com.github.hluk.copyq" "electron17" "htop" "yelp" apps=("fish" "cmake-gui" "com.github.hluk.copyq" "electron17" "htop" "yelp"
"avahi-discover" "bssh" "bvnc" "org.flameshot.Flameshot" "lstopo" "avahi-discover" "bssh" "bvnc" "org.flameshot.Flameshot" "lstopo"
@ -371,40 +300,16 @@ main() {
fi fi
done done
# === Enable Bluetooth == # === Enable Bluetooth ==
systemctl enable bluetooth.service systemctl enable bluetooth.service
systemctl start bluetooth.service systemctl start bluetooth.service
sed -i "s/#AutoEnable=true/AutoEnable=false/g" /etc/bluetooth/main.conf sed -i "s/#AutoEnable=true/AutoEnable=false/g" /etc/bluetooth/main.conf
# === VSCodium == # === VSCodium ==
wget -q ${repo}/.config/VSCodium/product.json -P "$HOME"/.config/VSCodium/ wget -q ${repo}/.config/VSCodium/product.json -P "$HOME"/.config/VSCodium/
# === Git ==
wget -q ${repo}/dotfiles/.gitconfig -O "$HOME"/.gitconfig
# === Python ==
# Add PIP packages from Python to the path
mkdir -p "$HOME"/.local/bin
fish -c "fish_add_path $HOME/.local/bin ||:"
# === OCaml ==
# Init Opam and install stuff
echo | opam init
fish -c "yes | opam init"
opam install -y \
utop ocaml-lsp-server ocamlformat core menhir pprint sexplib \
ppx_sexp_conv cohttp-lwt-unix dotenv twostep lwt_ssl alcotest ppx_deriving
wget -q ${repo}/dotfiles/.ocamlformat -O "$HOME"/.ocamlformat
# Add Opam packages from OCaml
mkdir -p "$HOME"/.opam/default/bin
fish -c "fish_add_path $HOME/.opam/default/bin ||:"
# === Clang ==
wget -q ${repo}/dotfiles/.clang-format -O "$HOME"/.clang-format
# === Perl ==
# Add perl packages to path
fish -c "fish_add_path /usr/bin/vendor_perl ||:"
# === Discord == # === Discord ==
# Skip update # Skip update
@ -412,17 +317,6 @@ main() {
updated_config_discord="$(< "$path_config_discord" jq '. + { "SKIP_HOST_UPDATE": true }')" updated_config_discord="$(< "$path_config_discord" jq '. + { "SKIP_HOST_UPDATE": true }')"
echo "$updated_config_discord" > "$path_config_discord" echo "$updated_config_discord" > "$path_config_discord"
# === Emacs ==
# mkdir -p "$HOME"/.emacs.d
# wget -q ${repo}/.emacs.d/init.el -O "$HOME"/.emacs.d/init.el
# === MIDI files ==
{
echo "soundfont /usr/share/soundfonts/FluidR3_GS.sf2"
echo "soundfont /usr/share/soundfonts/FluidR3_GM.sf2"
} | sudo tee -a /etc/timidity/timidity.cfg > /dev/null
sudo mkdir -p /usr/share/sounds/sf2
sudo ln -s /usr/share/soundfonts/*.sf2 /usr/share/sounds/sf2/
# === Printers == # === Printers ==
sudo systemctl enable cups.socket sudo systemctl enable cups.socket
@ -430,6 +324,7 @@ main() {
sudo systemctl enable avahi-daemon.service sudo systemctl enable avahi-daemon.service
sudo systemctl start avahi-daemon.service sudo systemctl start avahi-daemon.service
# === UFW == # === UFW ==
sudo systemctl enable ufw.service sudo systemctl enable ufw.service
sudo systemctl start ufw.service sudo systemctl start ufw.service
@ -440,17 +335,17 @@ main() {
sudo ufw-docker install sudo ufw-docker install
sudo systemctl restart ufw sudo systemctl restart ufw
# === Optimizations == # === Optimizations ==
# Disable NetworkManager-wait-online.service because it add 8s at boot # Disable NetworkManager-wait-online.service because it add 8s at boot
sudo systemctl disable NetworkManager-wait-online.service sudo systemctl disable NetworkManager-wait-online.service
# === Update NPM ==
sudo npm i -g npm@latest
# === s-tui == # === s-tui ==
# Configuration # Configuration
wget -q --show-progress ${repo}/.config/s-tui/s-tui.conf -P "$HOME"/.config/s-tui/ wget -q --show-progress ${repo}/.config/s-tui/s-tui.conf -P "$HOME"/.config/s-tui/
# === ClamAV == # === ClamAV ==
# Virus definitions # Virus definitions
sudo systemctl enable clamav-freshclam.service sudo systemctl enable clamav-freshclam.service
@ -459,6 +354,7 @@ main() {
sudo systemctl enable clamav-daemon.service sudo systemctl enable clamav-daemon.service
sudo systemctl start clamav-daemon.service sudo systemctl start clamav-daemon.service
# === GPU Screen recorder == # === GPU Screen recorder ==
# Configuration # Configuration
wget -q --show-progress ${repo}/.config/gpu-screen-recorder.env -P "$HOME"/.config/ wget -q --show-progress ${repo}/.config/gpu-screen-recorder.env -P "$HOME"/.config/

View file

@ -12,23 +12,21 @@ fi
cd "$(dirname "$0")" # change script directory cd "$(dirname "$0")" # change script directory
main() { main() {
# Variables # === Variables ==
local repo local repo
repo=https://git.mylloon.fr/Anri/confOS/raw/branch/main repo=https://git.mylloon.fr/Anri/confOS/raw/branch/main
# === Init pacman == # === Init pacman ==
sudo pacman-key --init sudo pacman-key --init
sudo pacman-key --populate sudo pacman-key --populate
sudo pacman -Sy --noconfirm archlinux-keyring sudo pacman -Sy --noconfirm archlinux-keyring
# === Update Arch mirrors ==
sudo pacman -S --noconfirm pacman-contrib
curl -s "https://archlinux.org/mirrorlist/?country=FR&country=GB&protocol=https&use_mirror_status=on" | \
sed -e "s/^#Server/Server/" -e "/^#/d" | sudo bash -c "rankmirrors -n 7 - > /etc/pacman.d/mirrorlist"
# === Update Arch == # === Update Arch ==
sudo pacman -Syyuu --noconfirm sudo pacman -Syyuu --noconfirm
# === Install packages == # === Install packages ==
sudo pacman -S --noconfirm \ sudo pacman -S --noconfirm \
git wget zip openssh bat base-devel make python-pygments micro git-lfs npm \ git wget zip openssh bat base-devel make python-pygments micro git-lfs npm \
@ -43,43 +41,21 @@ main() {
man-pages bottom man-pages bottom
# === Rustup == # === Global OS configuration set-up ==
# Init rustup # shellcheck disable=SC1091
rustup default stable source meta.sh
# fish_add_path "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin"
# Dev tools
rustup component add rust-analysis rls
# === Colors package manager ==
sudo sed -i "s/#Color/Color/g" /etc/pacman.conf
sudo sed -i "s/#ParallelDownloads = 5/ParallelDownloads = 3/g" /etc/pacman.conf
# === Remove SU password == # === Remove SU password ==
echo -e "\n# Disable password for specific user\n$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers > /dev/null echo -e "\n# Disable password for specific user\n$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers > /dev/null
# === Paru ==
git clone https://aur.archlinux.org/paru.git
cd paru || exit
makepkg -si --noconfirm
# Remove folder
cd ..
rm -rf paru ||:
paru --gendb
# Clean files used for compilation
sudo sed -i "s/#CleanAfter/CleanAfter/g" /etc/paru.conf
# === AUR packages == # === AUR packages ==
paru -S --noconfirm \ paru -S --noconfirm \
otf-font-awesome topgrade-bin cram otf-font-awesome
# === Rust ==
# Add Cargo packages from Rust
mkdir -p "$HOME"/.cargo/bin
fish -c "fish_add_path $HOME/.cargo/bin ||:"
# Add cargo packages
cargo install cargo-update cargo-cache
# === Set-up systemd # === Set-up systemd ==
mkdir -p subsystemctl mkdir -p subsystemctl
cd subsystemctl || exit cd subsystemctl || exit
curl -so PKGBUILD https://raw.githubusercontent.com/sorah/arch.sorah.jp/master/aur-sorah/PKGBUILDs/subsystemctl/PKGBUILD curl -so PKGBUILD https://raw.githubusercontent.com/sorah/arch.sorah.jp/master/aur-sorah/PKGBUILDs/subsystemctl/PKGBUILD
@ -88,139 +64,43 @@ main() {
rm -rf subsystemctl ||: rm -rf subsystemctl ||:
sudo subsystemctl start sudo subsystemctl start
# === Locales == # === Locales ==
sudo sed -i "s/#fr_FR.UTF-8 UTF-8/fr_FR.UTF8 UTF-8/g" /etc/locale.gen sudo sed -i "s/#fr_FR.UTF-8 UTF-8/fr_FR.UTF8 UTF-8/g" /etc/locale.gen
sudo locale-gen sudo locale-gen
subsystemctl exec sudo localectl set-locale fr_FR.UTF-8 subsystemctl exec sudo localectl set-locale fr_FR.UTF-8
# === Shared folders == # === Shared folders ==
sudo mkdir -p /mnt/y sudo mkdir -p /mnt/y
# === Fish == # === Fish ==
# Remove motd # Custom WSL configuration
fish -c "set -U fish_greeting"
# Reversed search
curl -sL https://git.io/fisher | fish -c "source && fisher install jorgebucaran/fisher"
fish -c "fisher install jethrokuan/fzf"
fish -c "fisher install jorgebucaran/autopair.fish"
# SSH
wget -q https://gitlab.com/kyb/fish_ssh_agent/raw/master/functions/fish_ssh_agent.fish -P "$HOME"/.config/fish/functions/
mkdir -p "$HOME"/.ssh
# Custom config.fish
wget -q ${repo}/.config/fish/config_wsl.fish -O "$HOME"/.config/fish/config.fish wget -q ${repo}/.config/fish/config_wsl.fish -O "$HOME"/.config/fish/config.fish
# Fish theme
fish -c "fish_config theme choose 'Base16 Eighties' && yes | fish_config theme save"
fish -c "set fish_color_comment 5c6773" # custom comment color
# Fish prompt
rm "$HOME"/.config/fish/functions/fish_prompt.fish 2> /dev/null ||:
wget -q ${repo}/.config/fish/functions/fish_prompt.fish -P "$HOME"/.config/fish/functions/
# EZA colors
fish -c "set -Ux EXA_COLORS 'di=1;36:da=35'"
# Add abbreviations
wget -q ${repo}/.config/fish/conf.d/abbr.fish -O "$HOME"/.config/fish/conf.d/abbr.fish
curl -s ${repo}/.config/fish/conf.d/abbr_wsl.fish >> "$HOME"/.config/fish/conf.d/abbr.fish curl -s ${repo}/.config/fish/conf.d/abbr_wsl.fish >> "$HOME"/.config/fish/conf.d/abbr.fish
# Add aliases
wget -q ${repo}/.config/fish/conf.d/alias.fish -O "$HOME"/.config/fish/conf.d/alias.fish
curl -s ${repo}/.config/fish/conf.d/alias_wsl.fish >> "$HOME"/.config/fish/conf.d/alias.fish curl -s ${repo}/.config/fish/conf.d/alias_wsl.fish >> "$HOME"/.config/fish/conf.d/alias.fish
# === Default editor ==
fish -c "set -Ux EDITOR nano"
# === Micro configuration ==
mkdir -p "$HOME"/.config/micro
wget -q --show-progress ${repo}/.config/micro/settings.json -O "$HOME"/.config/micro/settings.json
micro -plugin install detectindent
# # === GL4D ==
# # Download, build and installation
# git clone https://github.com/noalien/GL4Dummies.git
# cd GL4Dummies || exit
# make -f Makefile.autotools
# ./configure
# make
# sudo make install
# cd ..
# rm -rf GL4Dummies ||:
# # Fix for shared libraries (https://stackoverflow.com/a/9395355)
# sudo ldconfig
# # Add to path
# fish -c "set -Uax LD_LIBRARY_PATH /usr/local/lib"
# === tldr ==
cargo install tealdeer
fish -c "tldr --update"
# Fish completion
local url_tldr
url_tldr=$(curl -s https://api.github.com/repos/dbrgn/tealdeer/releases/latest \
| grep 'browser_download_url": ".*/completions_fish"' \
| cut --delimiter=":" --field=2,3 \
| tr -d \" )
wget -q --show-progress "${url_tldr:1}" -O completions_fish
mv completions_fish ~/.config/fish/completions/tldr.fish
# === Manual color ==
fish -c "set -Ux MANPAGER \"sh -c 'col -bx | bat -l man -p'\""
fish -c "set -Ux MANROFFOPT \"-c\""
# === Bat config ==
mkdir -p "$HOME"/.config/bat
wget -q --show-progress ${repo}/.config/bat/config -O "$HOME"/.config/bat/config
# === Git ==
wget -q ${repo}/dotfiles/.gitconfig -O "$HOME"/.gitconfig
# === Python ==
# Add PIP packages from Python
mkdir -p "$HOME"/.local/bin
fish -c "fish_add_path $HOME/.local/bin ||:"
# === OCaml == # === OCaml ==
# Init Opam and install stuff
echo | opam init
fish -c "yes | opam init"
opam install -y \
utop ocaml-lsp-server ocamlformat core menhir pprint sexplib \
ppx_sexp_conv cohttp-lwt-unix dotenv twostep lwt_ssl alcotest ppx_deriving
wget -q ${repo}/dotfiles/.ocamlformat -O "$HOME"/.ocamlformat
# Add Opam packages from OCaml
mkdir -p "$HOME"/.opam/default/bin
fish -c "fish_add_path $HOME/.opam/default/bin ||:"
# Fix dlllwt_unix_stubs.so shared object file # Fix dlllwt_unix_stubs.so shared object file
fish -c "set -Ux CAML_LD_LIBRARY_PATH $(opam var stublibs)" fish -c "set -Ux CAML_LD_LIBRARY_PATH $(opam var stublibs)"
# === Clang ==
wget -q ${repo}/dotfiles/.clang-format -O "$HOME"/.clang-format
# === Valgrind == # === Valgrind ==
fish -c "set -Ux DEBUGINFOD_URLS https://debuginfod.archlinux.org" fish -c "set -Ux DEBUGINFOD_URLS https://debuginfod.archlinux.org"
# === Unison == # === Unison ==
mkdir -p "$HOME"/.unison mkdir -p "$HOME"/.unison
wget -q ${repo}/.unison/default.prf -O "$HOME"/.unison/default.prf wget -q ${repo}/.unison/default.prf -O "$HOME"/.unison/default.prf
# === Perl ==
# Add perl packages to path
fish -c "fish_add_path /usr/bin/vendor_perl ||:"
# === Emacs ==
# mkdir -p "$HOME"/.emacs.d
# wget -q ${repo}/.emacs.d/init.el -O "$HOME"/.emacs.d/init.el
# === Bash VSCode fix == # === Bash VSCode fix ==
curl -s ${repo}/dotfiles/.bashrc >> "$HOME"/.bashrc curl -s ${repo}/dotfiles/.bashrc >> "$HOME"/.bashrc
# === MIDI files ==
{
echo "soundfont /usr/share/soundfonts/FluidR3_GS.sf2"
echo "soundfont /usr/share/soundfonts/FluidR3_GM.sf2"
} | sudo tee -a /etc/timidity/timidity.cfg > /dev/null
sudo mkdir -p /usr/share/sounds/sf2
sudo ln -s /usr/share/soundfonts/*.sf2 /usr/share/sounds/sf2/
# === Update NPM == # === Clear useless packages ==
sudo npm i -g npm@latest
# === Clear useless packages
pacman -Qqtd | sudo pacman --noconfirm -Rsn subsystemctl - 2> /dev/null ||: pacman -Qqtd | sudo pacman --noconfirm -Rsn subsystemctl - 2> /dev/null ||:
echo -e "\nInstallation terminée !\nIl faut redémarrer WSL (dans Powershell = wsl --shutdown)." echo -e "\nInstallation terminée !\nIl faut redémarrer WSL (dans Powershell = wsl --shutdown)."

182
meta.sh Executable file
View file

@ -0,0 +1,182 @@
#!/usr/bin/env bash
set -o errexit # crash the script when a command crash
set -o pipefail # same as above for piped command
set -o nounset # crash when a variable doesnt exist
# TRACE=1 for debug
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
cd "$(dirname "$0")" # change script directory
main() {
# === Variables ==
local repo
repo=https://git.mylloon.fr/Anri/confOS/raw/branch/main
# === Package manager ==
sudo sed -i "s/#Color/Color/g" /etc/pacman.conf
sudo sed -i "s/#ParallelDownloads = 5/ParallelDownloads = 3/g" /etc/pacman.conf
# === Update Arch mirrors ==
sudo pacman -S --noconfirm pacman-contrib
curl -s "https://archlinux.org/mirrorlist/?country=FR&country=DE&protocol=https&use_mirror_status=on" | \
sed -e "s/^#Server/Server/" -e "/^#/d" | sudo bash -c "rankmirrors -n 7 - > /etc/pacman.d/mirrorlist"
# === Rustup ==
# Init rustup
rustup default stable
# Dev tools
rustup component add rust-analysis rls
# === Rust ==
# Add Cargo packages from Rust
mkdir -p "$HOME"/.cargo/bin
fish -c "fish_add_path $HOME/.cargo/bin ||:"
# Install cargo packages
cargo install cargo-update cargo-cache tealdeer
# === Paru ==
git clone https://aur.archlinux.org/paru.git
cd paru || exit
makepkg -si --noconfirm
# Remove folder
cd ..
rm -rf paru ||:
paru --gendb
# Clean files used for compilation
sudo sed -i "s/#CleanAfter/CleanAfter/g" /etc/paru.conf
# === AUR packages ==
paru -S --noconfirm \
topgrade-bin cram
# === Fish ==
# Remove motd
fish -c "set -U fish_greeting"
# Reversed search
curl -sL https://git.io/fisher | fish -c "source && fisher install jorgebucaran/fisher"
fish -c "fisher install jethrokuan/fzf"
fish -c "fisher install jorgebucaran/autopair.fish"
# SSH
wget -q https://gitlab.com/kyb/fish_ssh_agent/raw/master/functions/fish_ssh_agent.fish -P "$HOME"/.config/fish/functions/
mkdir -p "$HOME"/.ssh
# Fish theme
fish -c "fish_config theme choose 'Base16 Eighties' && yes | fish_config theme save"
fish -c "set fish_color_comment 5c6773" # custom comment color
# Fish prompt
rm "$HOME"/.config/fish/functions/fish_prompt.fish 2> /dev/null ||:
wget -q ${repo}/.config/fish/functions/fish_prompt.fish -P "$HOME"/.config/fish/functions/
# EZA colors
fish -c "set -Ux EXA_COLORS 'di=1;36:da=35'"
# Add abbreviations
wget -q ${repo}/.config/fish/conf.d/abbr.fish -O "$HOME"/.config/fish/conf.d/abbr.fish
# Add aliases
wget -q ${repo}/.config/fish/conf.d/alias.fish -O "$HOME"/.config/fish/conf.d/alias.fish
# === Default editor ==
fish -c "set -Ux EDITOR nano"
# === Micro configuration ==
mkdir -p "$HOME"/.config/micro
wget -q --show-progress ${repo}/.config/micro/settings.json -O "$HOME"/.config/micro/settings.json
micro -plugin install detectindent
# # === GL4D ==
# # Download, build and installation
# git clone https://github.com/noalien/GL4Dummies.git
# cd GL4Dummies || exit
# make -f Makefile.autotools
# ./configure
# make
# sudo make install
# cd ..
# rm -rf GL4Dummies ||:
# # Fix for shared libraries (https://stackoverflow.com/a/9395355)
# sudo ldconfig
# # Add to path
# fish -c "set -Uax LD_LIBRARY_PATH /usr/local/lib"
# === tldr ==
fish -c "tldr --update"
# Fish completion
local url_tldr
url_tldr=$(curl -s https://api.github.com/repos/dbrgn/tealdeer/releases/latest \
| grep 'browser_download_url": ".*/completions_fish"' \
| cut --delimiter=":" --field=2,3 \
| tr -d \" )
wget -q --show-progress "${url_tldr:1}" -O completions_fish
mv completions_fish ~/.config/fish/completions/tldr.fish
# === Manual color ==
fish -c "set -Ux MANPAGER \"sh -c 'col -bx | bat -l man -p'\""
fish -c "set -Ux MANROFFOPT \"-c\""
# === Bat config ==
mkdir -p "$HOME"/.config/bat
wget -q --show-progress ${repo}/.config/bat/config -O "$HOME"/.config/bat/config
# === Git ==
wget -q ${repo}/dotfiles/.gitconfig -O "$HOME"/.gitconfig
# === Python ==
# Add PIP packages from Python to the path
mkdir -p "$HOME"/.local/bin
fish -c "fish_add_path $HOME/.local/bin ||:"
# === OCaml ==
# Init Opam and install stuff
echo | opam init
fish -c "yes | opam init"
opam install -y \
utop ocaml-lsp-server ocamlformat core menhir pprint sexplib \
ppx_sexp_conv cohttp-lwt-unix dotenv twostep lwt_ssl alcotest ppx_deriving
wget -q ${repo}/dotfiles/.ocamlformat -O "$HOME"/.ocamlformat
# Add Opam packages from OCaml
mkdir -p "$HOME"/.opam/default/bin
fish -c "fish_add_path $HOME/.opam/default/bin ||:"
# === Clangd ==
wget -q ${repo}/dotfiles/.clang-format -O "$HOME"/.clang-format
# === Perl ==
# Add perl packages to path
fish -c "fish_add_path /usr/bin/vendor_perl ||:"
# === Emacs ==
# mkdir -p "$HOME"/.emacs.d
# wget -q ${repo}/.emacs.d/init.el -O "$HOME"/.emacs.d/init.el
# === MIDI files ==
{
echo "soundfont /usr/share/soundfonts/FluidR3_GS.sf2"
echo "soundfont /usr/share/soundfonts/FluidR3_GM.sf2"
} | sudo tee -a /etc/timidity/timidity.cfg > /dev/null
sudo mkdir -p /usr/share/sounds/sf2
sudo ln -s /usr/share/soundfonts/*.sf2 /usr/share/sounds/sf2/
# === Update NPM ==
sudo npm i -g npm@latest
}
main "$@"