add termux script (#24)

This commit is contained in:
Mylloon 2024-03-30 18:17:02 +01:00
parent 45331eb326
commit c4be19b6ea
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 91 additions and 0 deletions

View file

@ -129,6 +129,12 @@ d'applications est [uad_exported_selection.txt](./uad_exported_selection.txt).
[Ici](https://git.mylloon.fr/Anri/cat/wiki/Debloat-MIUI) un petit descriptif de
quelques applications que je désactive qui sont mauvaise.
### Termux
```bash
curl https://git.mylloon.fr/Anri/confOS/raw/branch/main/termux.sh -s | bash
```
<details><summary><h2>Anciens scripts</h2></summary>
Ils restent là au cas où, mais attention ils ne sont **pas à jour**.

85
termux.sh Normal file
View file

@ -0,0 +1,85 @@
#!/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
function main {
# === Variables ==
local repo
repo=https://git.mylloon.fr/Anri/confOS/raw/branch/main
# === Update ==
pkg update -y
# === Packages ==
pkg install -y fish eza tealdeer bat
# === Fish ==
# Default shell
chsh -s 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 SSH
echo "fish_ssh_agent" > "$HOME"/.config/fish/config.fish
# 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"
# === 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\""
# === Git ==
wget -q "${repo}"/dotfiles/.gitconfig -O "$HOME"/.gitconfig
}
if type termux-info &> /dev/null;
then
main "$@"
else
echo "Ce script ne fonctionne que sur Termux." >&2
fi