Cleanup unused files

This commit is contained in:
tristaan
2023-11-11 20:00:39 +01:00
parent c63319a6a1
commit 473c43a508
43 changed files with 48 additions and 3302 deletions

View File

@@ -1,64 +1,52 @@
#!/bin/bash
UNAME="$(uname -s)"
case "${UNAME}" in
Linux*) machine=Linux SCRIPT_DIR=$(readlink -f ${0%/*});;
Darwin*) machine=Darwin SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd);;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) SCRIPT_DIR=$(readlink -f ${0%/*});;
Linux*) machine=Linux SCRIPT_DIR=$(readlink -f ${0%/*});;
Darwin*) machine=Darwin SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd);;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) SCRIPT_DIR=$(readlink -f ${0%/*});;
esac
safe_link(){
local src="$1"
local dest="$HOME/`basename $src`"
[ ! -e "$dest" ] && ln -sf "$src" "$dest"
local src="$1"
local dest="$HOME/`basename $src`"
[ ! -e "$dest" ] && ln -sf "$src" "$dest"
}
symlink_dotfiles() {
if [[ $machine == 'Linux' ]]; then
safe_link "$SCRIPT_DIR/.Xresources"
safe_link "$SCRIPT_DIR/.dmrc"
elif [[ $machine == 'Darwin' ]]; then
safe_link "$SCRIPT_DIR/.skhdrc"
safe_link "$SCRIPT_DIR/.chunkwmrc"
fi
safe_link "$SCRIPT_DIR/.gitconfig"
safe_link "$SCRIPT_DIR/.oh-my-zsh"
safe_link "$SCRIPT_DIR/.zshrc"
safe_link "$SCRIPT_DIR/.taskrc"
for file in .config/*; do
[ ! -e "${HOME}/${file}" ] && ln -fs "${SCRIPT_DIR}/${file}" "${HOME}/${file}"
done
[ -e "${HOME}/.oh-my-zsh/custom/themes" ] && rm -r "${HOME}/.oh-my-zsh/custom/themes" && ln -fs "${SCRIPT_DIR}/zsh-themes" "${HOME}/.oh-my-zsh/custom/themes"
safe_link "$SCRIPT_DIR/.gitconfig"
safe_link "$SCRIPT_DIR/.oh-my-zsh"
safe_link "$SCRIPT_DIR/.zshrc"
for file in .config/*; do
[ ! -e "${HOME}/${file}" ] && ln -fs "${SCRIPT_DIR}/${file}" "${HOME}/${file}"
done
[ -e "${HOME}/.oh-my-zsh/custom/themes" ] && rm -r "${HOME}/.oh-my-zsh/custom/themes" && ln -fs "${SCRIPT_DIR}/zsh-themes" "${HOME}/.oh-my-zsh/custom/themes"
}
for var in "$@"
do
if [ $var == "-u" ] ; then
sudo pacman -Syyu
fi
# Install
if [ $var == "-i" ] ; then
if [ ! -d "$HOME/.config" ]; then
mkdir $HOME/.config
fi
git submodule init && git submodule update
symlink_dotfiles
# Install already build packages
if [ $var == "-i" ] ; then
sudo pacman -S zsh zsh-autosuggestions zsh-syntax-highlighting alacritty neovim i3-gaps ctags udiskie nitrogen compton dunst rofi terminus-font openssh lxappearance xsel conky firejail wget ttf-font-awesome
sudo firecfg
fi
if [ $var == "-t" ] ; then
wget https://aur.archlinux.org/cgit/aur.git/snapshot/trizen.tar.gz
tar -xvf trizen.tar.gz
cd trizen
makepkg -sri
cd ..
rm -r trizen*
fi
# Install packages from the AUR
if [ $var == "-ii" ]; then
trizen -S polybar i3lock-color-git terminess-powerline-font-git arc-gtk-theme numix-circle-arc-icons-git pulsemixer
fi
if [ $var == "-l" ]; then
git submodule init && git submodule update
symlink_dotfiles
fi
if [[ $machine == 'Linux' ]]; then
sudo pacman -Syyu
sudo pacman -S zsh zsh-autosuggestions zsh-syntax-highlighting alacritty neovim terminus-font openssh firejail
sudo firecfg
wget https://aur.archlinux.org/cgit/aur.git/snapshot/trizen.tar.gz
tar -xvf trizen.tar.gz
cd trizen
makepkg -sri
cd ..
rm -r trizen*
elif [[ $machine == 'Darwin' ]]; then
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
berew install alacritty terminus
fi
fi
done