From 0a67016b0781b16f7ff1efdb5b65d0361b783851 Mon Sep 17 00:00:00 2001 From: Rick van Lieshout Date: Thu, 4 Apr 2024 11:47:18 +0200 Subject: [PATCH] fixed install.sh removing the entire home directory --- config/git/settings.yml | 8 ++++++++ dependencies/aur.txt | 1 - dependencies/pacman.txt | 37 ++++++++++++++++++++++++++----------- dependencies/pip.txt | 5 ----- install.sh | 27 ++++++++++++++++++++++----- 5 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 config/git/settings.yml delete mode 100644 dependencies/pip.txt diff --git a/config/git/settings.yml b/config/git/settings.yml new file mode 100644 index 0000000..52e9595 --- /dev/null +++ b/config/git/settings.yml @@ -0,0 +1,8 @@ +# current machine's name, optional; it can be used to filter settings or in the commit message +hostname: "" +profile: main +# sync on remote git +repository: + type: git + url: git@github.com:Mastermindzh/code-settings.git + branch: master diff --git a/dependencies/aur.txt b/dependencies/aur.txt index 72ed42f..f2e29fa 100644 --- a/dependencies/aur.txt +++ b/dependencies/aur.txt @@ -18,7 +18,6 @@ sysmontask keychain nomachine chili-sddm-theme -robo3t-bin dive gnome-text-editor greenclip diff --git a/dependencies/pacman.txt b/dependencies/pacman.txt index 29fedc9..da77d24 100644 --- a/dependencies/pacman.txt +++ b/dependencies/pacman.txt @@ -3,14 +3,9 @@ # base-devel git -xorg-server -xorg-xinit -mesa +wget libconfig -compton wmctrl -zenity -xorg-xrandr acpi ntp openssh @@ -18,10 +13,26 @@ gvfs-smb sddm polkit-gnome gnome-keyring +libgnome-keyring +python-keyring libsecret seahorse +reflector + +# +# i3wm +# i3-gaps i3lock +xorg-xrandr + +# +# Xorg stuff +# +xorg-server +xorg-xinit +mesa +zenity # # Programming @@ -93,9 +104,7 @@ neofetch network-manager-applet networkmanager networkmanager-l2tp -noto-fonts-emoji obsidian -otf-font-awesome papirus-icon-theme pavucontrol peek @@ -114,10 +123,16 @@ system-config-printer thefuck thunar thunar-archive-plugin -ttf-font-awesome -ttf-ubuntu-font-family + w3m -wget + xclip xfce4-terminal xorg-xkill + +# fonts +fontconfig +noto-fonts-emoji +otf-font-awesome +ttf-font-awesome +ttf-ubuntu-font-family diff --git a/dependencies/pip.txt b/dependencies/pip.txt deleted file mode 100644 index 1873553..0000000 --- a/dependencies/pip.txt +++ /dev/null @@ -1,5 +0,0 @@ -msrestazure -azure.common -azure.mgmt -azure.mgmt.containerservice -azure.graphrbac diff --git a/install.sh b/install.sh index f398276..94962f4 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,12 @@ #!/bin/bash +# ======================================= +# Script setup +# ======================================= + +set -e +set -o pipefail + # ======================================= # Helper functions # ======================================= @@ -45,7 +52,7 @@ function linkDir { # replace line endings with a space (for use in package managers) function fileToList { - echo $(cat "$1" | sed '/^\s*#\([^!]\|$\)/d' | sed ':a;N;$!ba;s/\n/ /g') + echo $(cat "$1" | sed '/^\s*#\([^!]\|$\)/d' | tr +'\n' ' ' | tr -s ' ') } # create and copy files to directory @@ -91,9 +98,9 @@ function install_config { linkDir "$PWD"/config/notify-osd/notify-osd ~/.notify-osd linkDir "$PWD"/config/terminal/xfce4-term ~/.config/xfce4/terminal linkDir "$PWD"/config/polybar ~/.config/polybar - linkDir "$PWD"/bash/.aliases ~/ # link user files + ln -sf "$PWD"/bash/.aliases ~/ ln -sf "$PWD"/bash/.bashrc ~/.bashrc ln -sf "$PWD"/bash/.dotnet-install.sh ~/.dotnet-install.sh ln -sf "$PWD"/bash/.alias.sh ~/.alias @@ -105,6 +112,8 @@ function install_config { ln -sf "$PWD"/config/mimeapps.list ~/.config/mimeapps.list ln -sf "$PWD"/config/greenclip.toml ~/.config/greenclip.toml ln -sf "$PWD"/config/terminalrc ~/.config/xfce4/terminal/terminalrc + mkdir -p ~/.config/Code/User/globalStorage/zokugun.sync-settings + ln -sf "$PWD"/config/git/settings.yml ~/.config/Code/User/globalStorage/zokugun.sync-settings/settings.yml mkdir -p ~/.config/rofi ln -sf "$PWD"/config/rofi/rofi.rasi ~/.config/rofi/config.rasi @@ -150,12 +159,15 @@ function install_dependencies { install_trizen fileToList dependencies/aur.txt | xargs trizen -S --noconfirm - - fileToList dependencies/pip.txt | xargs sudo pip install - fileToList dependencies/npm.txt | xargs sudo npm install -g } +# set up a new ssh key +function create_ssh_key { + ssh-keygen -t ed25519 -C "info@rickvanlieshout.com" + eval "$(ssh-agent -s)" +} + # ======================================= # User output functions # ======================================= @@ -214,6 +226,11 @@ ask "Do you want to continue installing my config and rice?" Y && install_dependencies fi +# Ask for SSH generation +if ask "Do you want to generate a new SSH key?" Y; then + create_ssh_key +fi + # Ask for config installation if ask "Do you want to install the config files?" Y; then install_config