Create unified install script

This commit is contained in:
the_4n0nym0u53 2022-03-05 20:51:07 +01:00
parent 61da6ec21b
commit 40faa56c3e
No known key found for this signature in database
GPG Key ID: 35EE09F5481049BB
6 changed files with 32 additions and 126 deletions

View File

@ -1,16 +1,13 @@
# My dotfiles
This is a collection of some of my dotfiles for my Linux systems. I personally use these on Artix, Fedora, Ubuntu and Termux (Android).
This is a collection of some of my dotfiles for my Linux systems. These work on Artix, Debian, Fedora, Ubuntu and Termux (Android).
To install:
```bash
$ git clone https://github.com/theanonymousexyz/dotfiles.git
$ cd dotfiles
$ ./artix-install.sh # For Artix
$ ./deb-install.sh # For Debian and Ubuntu
$ ./fedora-install.sh # For Fedora
$ ./termux-install.sh # For Termux
$ ./install.sh
```
Note that I use `doas` instead of `sudo` (only on Artix). If you prefer `sudo`, then change all instances of `doas` to `sudo`, or simply create a symlink `doas` pointing to `sudo`:

View File

@ -1,35 +0,0 @@
#!/bin/sh
if [ "$(lsb_release -si)" != "Artix" ]; then
echo "This script is only intended to be used for a full setup on Artix. Quitting..."
exit 1
fi
echo "Configuring directories..."
cd -- "$(dirname -- $0)"
set -- "alacritty" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh"
mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory
sleep 0.5
echo "Creating the symlinks with stow..."
for pkg in "$@"; do
echo "* Stowing $pkg"
stow -t "$HOME" --ignore="README.md" "$pkg"
sleep 0.1
done
sleep 0.4
echo "Making scripts executable..."
chmod +x scripts/.local/bin/clear-clipboard.sh
chmod +x scripts/.local/bin/erase-disk.sh
chmod +x scripts/.local/bin/update.sh
chmod +x sway/.config/sway/autostart.sh
chmod +x waybar/.config/waybar/ivpn-reconnect.sh
chmod +x waybar/.config/waybar/ivpn-status.sh
chmod +x waybar/.config/waybar/mediaplayer.py
sleep 0.5
echo "Done!"

View File

@ -1,26 +0,0 @@
#!/bin/sh
if [ "$(lsb_release -si)" != "Debian" ] && [ "$(lsb_release -si)" != "Ubuntu" ]; then
echo "This script is only intended to be used for a full setup on Debian or Ubuntu. Quitting..."
exit 1
fi
echo "Configuring directories..."
cd -- "$(dirname -- $0)"
set -- "scripts" "zsh"
mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory
sleep 0.5
echo "Creating the symlinks with stow..."
for pkg in "$@"; do
echo "* Stowing $pkg"
stow -t "$HOME" --ignore="README.md" "$pkg"
sleep 0.1
done
sleep 0.4
sleep 0.5
echo "Done!"

View File

@ -1,31 +0,0 @@
#!/bin/sh
if [ "$(lsb_release -si)" != "Fedora" ]; then
echo "This script is only intended to be used for a full setup on Fedora. Quitting..."
exit 1
fi
echo "Configuring directories..."
cd -- "$(dirname -- $0)"
set -- "nvim" "scripts" "zsh"
mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory
sleep 0.5
echo "Creating the symlinks with stow..."
for pkg in "$@"; do
echo "* Stowing $pkg"
stow -t "$HOME" --ignore="README.md" "$pkg"
sleep 0.1
done
sleep 0.4
echo "Making scripts executable..."
chmod +x scripts/.local/bin/clear-clipboard.sh
chmod +x scripts/.local/bin/erase-disk.sh
chmod +x scripts/.local/bin/update.sh
sleep 0.5
echo "Done!"

30
install.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
echo "=> Determining OS..."
if [ "$(uname -o)" = "Android" ] || [ "$(lsb_release -si)" = "Fedora" ]; then
set -- "nvim" "scripts" "zsh"
elif [ "$(lsb_release -si)" = "Debian" ] || [ "$(lsb_release -si)" = "Ubuntu" ]; then
set -- "scripts" "zsh"
elif [ "$(lsb_release -si)" = "Artix" ]; then
set -- "alacritty" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh"
else
echo "OS not supported!"
exit 1
fi
sleep 0.5
echo "=> Installing dotfile packages..."
cd -- "$(dirname -- $0)"
for pkg in "$@"; do
sleep 0.1
echo " -> Stowing $pkg"
[ "$pkg" = "zsh" ] && mkdir -p "$HOME/.config/$pkg" # Symlink only the individual files instead of the entire directory
stow -t "$HOME" --ignore="README.md" "$pkg"
done
sleep 0.5
echo "=> Done!"

View File

@ -1,29 +0,0 @@
#!/bin/sh
if [ "$(uname -o)" != "Android" ]; then
echo "This script is only intended to be used for a full setup in Termux for Android. Quitting..."
exit 1
fi
echo "Configuring directories..."
cd -- "$(dirname -- $0)"
set -- "nvim" "scripts" "zsh"
mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory
sleep 0.5
echo "Creating the symlinks with stow..."
for pkg in "$@"; do
echo "* Stowing $pkg"
stow -t "$HOME" --ignore="README.md" "$pkg"
sleep 0.1
done
sleep 0.4
echo "Making scripts executable..."
chmod +x scripts/.local/bin/update.sh
sleep 0.5
echo "Done!"