Move some installer contents to extra_installers scripts

This commit is contained in:
Evie Litherland-Smith 2023-01-16 11:14:42 +00:00
parent d64ec10144
commit 0c0f841c7d
6 changed files with 81 additions and 28 deletions

View file

@ -4,22 +4,18 @@ Collection of various settings, configurations and other miscellaneous tools.
## Settings ## Settings
- [neovim](https://neovim.io) - [neovim](https://neovim.io)
- [kitty](https://sw.kovidgoyal.net/kitty/) - [kitty](https://sw.kovidgoyal.net/kitty/)
- [i3](https://i3wm.org)
- [lazygit](https://github.com/jesseduffield/lazygit) - [lazygit](https://github.com/jesseduffield/lazygit)
- [tmux](https://tmux.github.io/) - [tmux](https://tmux.github.io/)
## Fonts ## Fonts
- [FiraCode](https://github.com/tonsky/FiraCode) - [NerdFonts symbols](https://github.com/ryanoasis/nerd-fonts)
## Templates ## Templates
- SSH config
- Python package - Python package
- Crontab - Crontab
# Package config ## Installation
List of arch personal arch linux packages in `pacman.txt`. `install.sh` will set up most common configurations
Install with: `extra_installers/` contains additional (unfinished) scripts to simplify installing commonly used software
```sh
sudo pacman --needed -S $(awk '{print $1}' pacman.txt)
```

View file

@ -1,3 +1,3 @@
autoload -U bashcompinit autoload -U bashcompinit
bashcompinit bashcompinit
eval "$(register-python-argcomplete pipx)" eval "$(register-python-argcomplete3 pipx)"

8
extra_installers/pipx.sh Executable file
View file

@ -0,0 +1,8 @@
#! /usr/bin/env bash
pipx install pyright
pipx install poetry
pipx install black
pipx install isort
pipx install zimports
pipx install pre-commit

47
extra_installers/software.sh Executable file
View file

@ -0,0 +1,47 @@
#! /usr/bin/env bash
# Install various programs
echo "--- Not finished, not recommended to run as a script ---"
echo "--- Copy individual commands and run as desired ---"
exit 1
mkdir -p "$HOME/.local/bin"
# kitty
if [ ! which -a kitty > /dev/null ]
then
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
# Create a symbolic link to add kitty to PATH (assuming $HOME/.local/bin is in
# your system-wide PATH)
ln -s "$HOME/.local/kitty.app/bin/kitty" "$HOME/.local/bin/"
# Place the kitty.desktop file somewhere it can be found by the OS
cp "$HOME/.local/kitty.app/share/applications/kitty.desktop" "$HOME/.local/share/applications/"
# If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file
cp "$HOME/.local/kitty.app/share/applications/kitty-open.desktop" "$HOME/.local/share/applications/"
# Update the paths to the kitty and its icon in the kitty.desktop file(s)
sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" "$HOME/.local/share/applications/kitty*.desktop"
sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" "$HOME/.local/share/applications/kitty*.desktop"
fi
# neovim
if [ ! which -a nvim > /dev/null ]
then
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
mv nvim.appimage "$HOME/.local/bin/nvim"
ln -s "$HOME/.local/bin/nvim" "$HOME/.local/bin/vim"
fi
# fzf
if [ ! which -a fzf > /dev/null ]
then
git clone --depth 1 https://github.com/junegunn/fzf.git "$HOME/.fzf"
"$HOME/.fzf/install"
fi
# pipx
if [ ! which -a fzf > /dev/null ]
then
python3 -m pip install --user pipx
pipx ensurepath
fi

9
extra_installers/ssh-agent.sh Executable file
View file

@ -0,0 +1,9 @@
#! /usr/bin/env bash
# SSH agent
ssh_agent_export="export SSH_AUTH_SOCK=\"\$XDG_RUNTIME_DIR/ssh-agent.socket\""
grep "$ssh_agent_export" "$HOME/.profile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.profile"
grep "$ssh_agent_export" "$HOME/.zprofile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.zprofile"
grep "$ssh_agent_export" "$HOME/.bash_profile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.bash_profile"
systemctl --user enable ssh-agent.service

View file

@ -36,19 +36,9 @@ do
create_symlink "$CONFIG_DIR/systemd/user" "$FILE" create_symlink "$CONFIG_DIR/systemd/user" "$FILE"
done done
# SSH agent
ssh_agent_export="export SSH_AUTH_SOCK=\"\$XDG_RUNTIME_DIR/ssh-agent.socket\""
grep "$ssh_agent_export" "$HOME/.profile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.profile"
grep "$ssh_agent_export" "$HOME/.zprofile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.zprofile"
grep "$ssh_agent_export" "$HOME/.bash_profile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.bash_profile"
systemctl --user enable ssh-agent.service
# SSH sockets # SSH sockets
mkdir -p "$HOME/.ssh/sockets" mkdir -p "$HOME/.ssh/sockets"
[ ! -e "$HOME/.ssh/config" ] && cp templates/ssh-config "$HOME/.ssh/config"
# Install arch packages
sudo pacman --needed -S $(awk '{print $1}' pacman.txt) || echo "Issue installing pacman packages"
# nvim setup - install Packer # nvim setup - install Packer
PACKER_REPO="https://github.com/wbthomason/packer.nvim" PACKER_REPO="https://github.com/wbthomason/packer.nvim"
@ -73,12 +63,15 @@ fi
grep "editor" "$HOME/.gitconfig" > /dev/null || git config --global core.editor "nvim" grep "editor" "$HOME/.gitconfig" > /dev/null || git config --global core.editor "nvim"
# Add NerdFont symbols # Add NerdFont symbols
# TODO currently an issue with the spaces in the file names mkdir -p "$HOME/.local/share/fonts"
# mkdir -p "$HOME/.local/share/fonts" for FILE in nerdfont_symbols/*
# for FILE in nerdfont_symbols/* do
# do create_symlink "$HOME/.local/share/fonts" "$FILE"
# create_symlink "$HOME/.local/share/fonts" "$FILE" done
# done
# Ensure nvim plugins # Ensure nvim plugins
which -a efm-langserver > /dev/null || ln -s "$(readlink -f config/nvim/external/efm-langserver)" "$HOME/.local/bin/." mkdir -p "$HOME/.local/bin"
for FILE in bin/*
do
which -a "$(basename $FILE)" > /dev/null || create_symlink "$HOME/.local/bin" "$FILE"
done