# 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
}