This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/bash/module/Bootstrap.sh

76 lines
1.7 KiB
Bash

# Install Cargo/Rust.
function bootstrap_rust() {
curl https://sh.rustup.rs -sSf | sh
rustup component add rust-analyzer
}
# Install TeXLive.
function bootstrap_texlive() {
cd /tmp
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xf install-tl-unx.tar.gz
rm install-tl-unx.tar.gz
cd ./install-tl-*
./install-tl
}
# Install grub theme.
function bootstrap_grub() {
wget -O- https://github.com/shvchk/fallout-grub-theme/raw/master/install.sh | bash
echo 'GRUB_HIDDEN_TIMEOUT=' >> /etc/default/grub
grub2-mkconfig -o /etc/grub2.cfg
}
# Install ffmpeg.
function bootstrap_ffmpeg() {
flatpak install org.kde.kdenlive
}
# Install Editorconfig file (with tabs) in current directory.
function bootstrap_editorconfig() {
echo "\
[*]
end_of_line = lf
charset = utf-8
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
" > .editorconfig
}
# Install Editorconfig file (with specified spaces, 8 by default) in current directory.
# Usage: bootstrap_editorconfig_space [AMOUNT]
function bootstrap_editorconfig_space() {
local spaces="${1}"
[[ "${spaces}" = "" ]] && spaces=8
echo "\
[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = ${spaces}
insert_final_newline = true
trim_trailing_whitespace = true
" > .editorconfig
}
# Setup all the flatpak apps on the machine.
function bootstrap_flatpak() {
# Add Flathub repo.
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# Reinstall apps.
local IFS=$'\n'
local targets="$(cat ~/.config/linux/Flatpak.txt)"
process() {
local packet="${target#*$'\t'}"
packet="${packet%%$'\t'*}"
flatpak install "${packet}"
}
_iterate_targets process ${targets[@]}
}