From 40faa56c3ee2663f3b346836037a97fbe987f5e9 Mon Sep 17 00:00:00 2001 From: the_4n0nym0u53 Date: Sat, 5 Mar 2022 20:51:07 +0100 Subject: [PATCH] Create unified install script --- README.md | 7 ++----- artix-install.sh | 35 ----------------------------------- deb-install.sh | 26 -------------------------- fedora-install.sh | 31 ------------------------------- install.sh | 30 ++++++++++++++++++++++++++++++ termux-install.sh | 29 ----------------------------- 6 files changed, 32 insertions(+), 126 deletions(-) delete mode 100755 artix-install.sh delete mode 100755 deb-install.sh delete mode 100755 fedora-install.sh create mode 100755 install.sh delete mode 100755 termux-install.sh diff --git a/README.md b/README.md index 2ab6e1f..a3228e4 100644 --- a/README.md +++ b/README.md @@ -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`: diff --git a/artix-install.sh b/artix-install.sh deleted file mode 100755 index 72eb783..0000000 --- a/artix-install.sh +++ /dev/null @@ -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!" diff --git a/deb-install.sh b/deb-install.sh deleted file mode 100755 index ee52248..0000000 --- a/deb-install.sh +++ /dev/null @@ -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!" diff --git a/fedora-install.sh b/fedora-install.sh deleted file mode 100755 index a04fee9..0000000 --- a/fedora-install.sh +++ /dev/null @@ -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!" diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..37775e1 --- /dev/null +++ b/install.sh @@ -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!" diff --git a/termux-install.sh b/termux-install.sh deleted file mode 100755 index 6686629..0000000 --- a/termux-install.sh +++ /dev/null @@ -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!"