diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 54e38d5..0b5a47e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -6,7 +6,10 @@ { "label": "Run install script", "type": "shell", - "command": "./install", + "command": "sh", + "args": [ + "./install-linux.sh" + ], "problemMatcher": [] } ] diff --git a/README.md b/README.md index 7856aaf..c57062e 100644 --- a/README.md +++ b/README.md @@ -16,5 +16,10 @@ Install and link everything with: mkdir -p ~/.config && cd ~/.config git clone https://github.com/ewpratten/ewconfig cd ewconfig -./install -``` \ No newline at end of file + +# Linux +sh ./install-linux.sh + +# Windows, with GIT BASH +sh ./install-windows.sh +``` diff --git a/configs/autostart/gnome-keyring-ssh.desktop b/configs/autostart/gnome-keyring-ssh.desktop deleted file mode 100644 index a46a76a..0000000 --- a/configs/autostart/gnome-keyring-ssh.desktop +++ /dev/null @@ -1,157 +0,0 @@ -[Desktop Entry] -Hidden=true -Type=Application -Name[af]=SSH-sleutelagent -Name[ar]=عميل مفاتيح SSH -Name[as]=SSH কি সহায়ক -Name[ast]=Axente de claves SSH -Name[be]=SSH-агент ключоў -Name[bg]=Агентът на SSH за ключове -Name[bn]=SSH কী এজেন্ট -Name[bn_IN]=SSH কি এজেন্ট -Name[bs]=Agent za SSH ključeve -Name[ca]=Agent de claus SSH -Name[ca@valencia]=Agent de claus SSH -Name[cs]=Agent klíčů SSH -Name[da]=SSH-nøgleagent -Name[de]=SSH-Schlüsselagent -Name[el]=Πράκτορας κλειδιού SSH -Name[en_GB]=SSH Key Agent -Name[eo]=SSH-ŝlosila agento -Name[es]=Agente de claves SSH -Name[et]=SSH-võtmete agent -Name[eu]=SSH gako-agentea -Name[fa]=عامل کلید SSH -Name[fi]=SSH-avainten agentti -Name[fr]=Agent de clés SSH -Name[fur]=Agjent clâfs SSH -Name[gd]=Àidseant iuchair SSH -Name[gl]=Axente de chave SSH -Name[gu]=SSH કી ઍજન્ટ -Name[he]=סוכן מפתחות SSH -Name[hi]=AFS कुँजी प्रतिनिधि -Name[hr]=Agent SSH ključa -Name[hu]=SSH-kulcs ügynök -Name[id]=Agen Kunci SSH -Name[it]=Agente chiavi SSH -Name[ja]=SSH 鍵エージェント -Name[kk]=SSH кілттер агенті -Name[km]=ភ្នាក់ងារ​សោ SSH -Name[kn]=SSH ಕೀಲಿ ಮಧ್ಯವರ್ತಿ -Name[ko]=SSH 키 에이전트 -Name[lt]=SSH raktų tarnyba -Name[lv]=SSH atslēgu aģents -Name[mjw]=SSH Key Agent -Name[mk]=Агент за SSH клучеви -Name[ml]=എസ്എസ്എച് കീ ഏജന്റ് -Name[mr]=SSH कि एजंट -Name[ms]=Ejen Kunci SSH -Name[nb]=SSH-nøkkelagent -Name[nl]=SSH-sleutelagent -Name[nn]=Nøkkelagent for SSH -Name[oc]=Agent de claus SSH -Name[or]=SSH କି ସଦସ୍ୟ -Name[pa]=SSH ਕੁੰਜੀ ਏਜੰਟ -Name[pl]=Agent kluczy SSH -Name[pt]=Agente de chaves SSH -Name[pt_BR]=Agente de chaves SSH -Name[ro]=Agent pentru chei SSH -Name[ru]=Агент ключей SSH -Name[sk]=Agent kľúčov SSH -Name[sl]=Agent ključev SSH -Name[sr]=Агент за ССХ кључеве -Name[sr@latin]=Agent za SSH ključeve -Name[sv]=SSH-nyckelagent -Name[ta]=SSH முகவர் -Name[te]=SSH కీ వాహకము -Name[th]=เอเจนต์กุญแจ SSH -Name[tr]=SSH Anahtar Aracı -Name[ug]=SSH ئاچقۇچ ياردەمچىسى -Name[uk]=Агент ключів SSH -Name[vi]=Đại diện khóa SSH -Name[zh_CN]=SSH 密钥代理 -Name[zh_HK]=SSH 密碼匙代理程式 -Name[zh_TW]=SSH 金鑰代理程式 -Name=SSH Key Agent -Comment[af]=GNOME-sleutelring: SSH-agent -Comment[ar]=حلقة مفاتيح جنوم: عميل SSH -Comment[as]=GNOME Keyring: SSH সহায়ক -Comment[ast]=Depósitu de claves de GNOME: axente SSH -Comment[be]=Вязкі ключоў GNOME: SSH-агент -Comment[bg]=Ключодържател на GNOME: агент на SSH -Comment[bn]=GNOME কী রিং: SSH এজেন্ট -Comment[bn_IN]=GNOME Keyring: SSH এজেন্ট -Comment[bs]=Gnomovi privjesci: SSH agent -Comment[ca]=Anell de claus del GNOME: agent SSH -Comment[ca@valencia]=Anell de claus del GNOME: agent SSH -Comment[cs]=Klíčenka GNOME: Agent SSH -Comment[da]=GNOME-nøgleringsdæmon: SSH-agent -Comment[de]=GNOME-Schlüsselbunddienst: SSH-Agent -Comment[el]=Κλειδοθήκη GNOME: Πράκτορας SSH -Comment[en_GB]=GNOME Keyring: SSH Agent -Comment[eo]=GNOME Ŝlosilaro: SSH-agento -Comment[es]=Depósito de claves de GNOME: agente SSH -Comment[et]=GNOME võtmerõngas: SSH-agent -Comment[eu]=GNOMEren gako-sorta: SSH agentea -Comment[fa]=دسته‌کلید گنوم: عامل SSH -Comment[fi]=Gnomen avainnippu: SSH-agentti -Comment[fr]=Trousseau de clés de GNOME : agent SSH -Comment[fur]=Puarteclâfs di GNOME: agjent SSH -Comment[gd]=Dul-iuchrach: Àidseant SSH -Comment[gl]=GNOME Keyring: Axente SSH -Comment[gu]=GNOME કીરીંગ: SSH ઍજન્ટ -Comment[he]=קבוצת מפתחות של GNOME: סוכן SSH -Comment[hi]=गनोम कीरिंग: SSH प्रतिनिधि -Comment[hr]=GNOME skup ključeva: SSH agent -Comment[hu]=GNOME kulcstartó – SSH-ügynök -Comment[id]=Ring Kunci GNOME: Agen SSH -Comment[it]=Portachiavi di GNOME: agente SSH -Comment[ja]=GNOME キーリング: SSH エージェント -Comment[kk]=GNOME Keyring: SSH агенті -Comment[km]=GNOME Keyring ៖ ភ្នាក់ងារ SSH -Comment[kn]=GNOME ಕೀಲಿಗೊಂಚಲು: SSH ಮಧ್ಯವರ್ತಿ -Comment[ko]=그놈 키 모음: SSH 에이전트 -Comment[lt]=GNOME raktinė: SSH tarnyba -Comment[lv]=GNOME atslēgu saišķis — SSH aģents -Comment[mjw]=GNOME Keyring: SSH Agent -Comment[mk]=Приврзок на GNOME: SSH агент -Comment[ml]=ഗ്നോം കീറിങ്: എസ്എസ്എച് ഏജന്റ് -Comment[mr]=GNOME किरिंग: SSH एजंट -Comment[ms]=Gelang Kunci GNOME: Ejen SSH -Comment[nb]=GNOME nøkkelring: SSH-agent -Comment[ne]=जिनोम किरिङ : SSH एजेन्ट -Comment[nl]=Sleutelbos-service: SSH-agent -Comment[nn]=GNOME Nøkkelring: SSH-agent -Comment[oc]=Trossèl de claus GNOME : agent SSH -Comment[or]=GNOME କି ରିଙ୍ଗ: SSH ସଦସ୍ୟ -Comment[pa]=ਗਨੋਮ ਕੀਰਿੰਗ: SSH ਏਜੰਟ -Comment[pl]=Baza kluczy dla środowiska GNOME: agent SSH -Comment[pt]=GNOME Keyring: agente SSH -Comment[pt_BR]=Chaveiro do GNOME: Agente SSH -Comment[ro]=Inelul de chei GNOME: Agent SSH -Comment[ru]=Связка ключей GNOME: SSH-агент -Comment[sk]=SSH agent zväzku kľúčov GNOME -Comment[sl]=Zbirka ključev GNOME: agent SSH -Comment[sr]=Гномови привесци: ССХ агент -Comment[sr@latin]=Gnomovi privesci: SSH agent -Comment[sv]=GNOME-nyckelring: SSH-agent -Comment[ta]=GNOME கீரிங்: SSH முகவர் -Comment[te]=GNOME కీరింగ్: SSH వాహకం -Comment[th]=พวงกุญแจของ GNOME: เอเจนต์ SSH -Comment[tr]=GNOME Anahtarlığı: SSH Aracı -Comment[ug]=گىنوم ئاچقۇچ ھالقىسى:SSH ياردەمچىسى -Comment[uk]=Служба в'язки ключів GNOME: агент SSH -Comment[vi]=Chùm chìa khóa GNOME: Đại diện SSH -Comment[zh_CN]=GNOME 密钥环:SSH 代理 -Comment[zh_HK]=GNOME 密碼匙圈:SSH 代理程式 -Comment[zh_TW]=GNOME 鑰匙圈:SSH 代理程式 -Comment=GNOME Keyring: SSH Agent -Exec=/usr/bin/gnome-keyring-daemon --start --components=ssh -OnlyShowIn=GNOME;Unity;MATE; -X-GNOME-Autostart-Phase=PreDisplayServer -X-GNOME-AutoRestart=false -X-GNOME-Autostart-Notify=true -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=gnome-keyring -X-GNOME-Bugzilla-Component=general -X-GNOME-Bugzilla-Version=42.1 diff --git a/configs/autostart/logid.desktop b/configs/autostart/logid.desktop deleted file mode 100644 index acaaf24..0000000 --- a/configs/autostart/logid.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Name = Logid -GenericName = Logid -Comment = Logitech Mouse Driver -Exec = logid -v -c $HOME/.config/logid/logid.cfg -Type = Application -X-GNOME-Autostart-enabled = false diff --git a/configs/git/.gitconfig b/configs/git/.gitconfig index aa4acf2..e113bf8 100644 --- a/configs/git/.gitconfig +++ b/configs/git/.gitconfig @@ -1,10 +1,9 @@ [include] - path = ~/.config/git/features/enable-signing.gitconfig - -[user] - email = evan@ewpratten.com - name = Evan Pratten - signingkey = ~/.ssh/id_ed25519_sk_rk_yk20572395 + # NOTE: These paths are imported if they exist and ignored if they don't + # This allows us to have a single config file for all our machines + # and control the specifics by symlinking the relevant files per-machine + path = ~/.config/git/config-fragments/personal-info.gitconfig + path = ~/.config/git/config-fragments/enable-signing.gitconfig [init] defaultBranch = master @@ -39,11 +38,5 @@ helper = helper = !/usr/bin/gh auth git-credential -[sendemail] - smtpserver = smtp.migadu.com - smtpuser = evan@ewpratten.com - smtpencryption = tls - smtpserverport = 587 - [mailmap] file = ~/.config/git/.mailmap diff --git a/configs/git/features/enable-signing.gitconfig b/configs/git/config-fragments/enable-signing.gitconfig similarity index 100% rename from configs/git/features/enable-signing.gitconfig rename to configs/git/config-fragments/enable-signing.gitconfig diff --git a/configs/git/config-fragments/personal-info.gitconfig b/configs/git/config-fragments/personal-info.gitconfig new file mode 100644 index 0000000..1b89904 --- /dev/null +++ b/configs/git/config-fragments/personal-info.gitconfig @@ -0,0 +1,10 @@ +[user] + email = evan@ewpratten.com + name = Evan Pratten + signingkey = ~/.ssh/id_ed25519_sk_rk_yk20572395 + +[sendemail] + smtpserver = smtp.migadu.com + smtpuser = evan@ewpratten.com + smtpencryption = tls + smtpserverport = 587 diff --git a/configs/nvim/pack/pack b/configs/nvim/pack/pack new file mode 120000 index 0000000..7c8b955 --- /dev/null +++ b/configs/nvim/pack/pack @@ -0,0 +1 @@ +/home/ewpratten/.config/ewconfig/configs/nvim/pack \ No newline at end of file diff --git a/configs/nvim/third_party/third_party b/configs/nvim/third_party/third_party new file mode 120000 index 0000000..937284f --- /dev/null +++ b/configs/nvim/third_party/third_party @@ -0,0 +1 @@ +/home/ewpratten/.config/ewconfig/configs/nvim/third_party \ No newline at end of file diff --git a/configs/rofi/rofi b/configs/rofi/rofi new file mode 120000 index 0000000..7be4e32 --- /dev/null +++ b/configs/rofi/rofi @@ -0,0 +1 @@ +/home/ewpratten/.config/ewconfig/configs/rofi/ \ No newline at end of file diff --git a/solutions/configure-gnome-remote-desktop.sh b/configs/scripts/configure-gnome-remote-desktop similarity index 100% rename from solutions/configure-gnome-remote-desktop.sh rename to configs/scripts/configure-gnome-remote-desktop diff --git a/configs/scripts/ewp-sendmail.py b/configs/scripts/ewp-sendmail similarity index 100% rename from configs/scripts/ewp-sendmail.py rename to configs/scripts/ewp-sendmail diff --git a/configs/scripts/guru-vpn.py b/configs/scripts/guru-vpn similarity index 100% rename from configs/scripts/guru-vpn.py rename to configs/scripts/guru-vpn diff --git a/configs/scripts/houdini-tool.py b/configs/scripts/houdini-tool similarity index 100% rename from configs/scripts/houdini-tool.py rename to configs/scripts/houdini-tool diff --git a/solutions/run-logid.sh b/configs/scripts/run-logid similarity index 100% rename from solutions/run-logid.sh rename to configs/scripts/run-logid diff --git a/configs/scripts/usdnc-to-usd.py b/configs/scripts/usdnc-to-usd similarity index 100% rename from configs/scripts/usdnc-to-usd.py rename to configs/scripts/usdnc-to-usd diff --git a/configs/scripts/video_trimmer.py b/configs/scripts/video_trimmer similarity index 100% rename from configs/scripts/video_trimmer.py rename to configs/scripts/video_trimmer diff --git a/configs/scripts/wg-genzone.py b/configs/scripts/wg-genzone similarity index 100% rename from configs/scripts/wg-genzone.py rename to configs/scripts/wg-genzone diff --git a/configs/scripts/wg-handshakes.py b/configs/scripts/wg-handshakes similarity index 100% rename from configs/scripts/wg-handshakes.py rename to configs/scripts/wg-handshakes diff --git a/configs/bash/.bashrc b/configs/shells/bash/.bashrc similarity index 72% rename from configs/bash/.bashrc rename to configs/shells/bash/.bashrc index 19ec4c7..23bf9d4 100644 --- a/configs/bash/.bashrc +++ b/configs/shells/bash/.bashrc @@ -1,18 +1,13 @@ # This is a somewhat hacky bashrc that is used to provide some of the conveniences from my zshrc on machines that I can't get zsh on export EWCONFIG_ROOT="$HOME/.config/ewconfig" +# Load macros +. $EWCONFIG_ROOT/configs/shells/bash/macros.sh + # I always want my ~/bin to be in my PATH export PATH="$HOME/bin:$PATH" +export PATH="$EWCONFIG_ROOT/configs/scripts:$PATH" export PATH="$HOME/.local/bin:$PATH" -# Makes a directory, then moves into it -mkcd() { - if [ $# != 1 ]; then - echo "Usage: mkcd " - else - mkdir -p $1 && cd $1 - fi -} - # A basic prompt to display user@host dir sign export PS1="(bash) \[\e[0;32m\]\u@\h \[\e[0;36m\]\w \[\e[0;36m\]\$ \[\e[0m\]" diff --git a/configs/zsh/macros.sh b/configs/shells/bash/macros.sh similarity index 96% rename from configs/zsh/macros.sh rename to configs/shells/bash/macros.sh index 78342e9..130c2c5 100644 --- a/configs/zsh/macros.sh +++ b/configs/shells/bash/macros.sh @@ -158,15 +158,6 @@ wg-cat() { fi } -# Search for a process -proc-grep() { - if [ $# != 1 ]; then - echo "Usage: proc-grep " - else - ps aux | { head -1; grep $1 } - fi -} - # Updates ewconfig ewconfig-pull() { cwd=$(pwd) diff --git a/configs/zsh/.zshrc b/configs/shells/zsh/.zshrc similarity index 74% rename from configs/zsh/.zshrc rename to configs/shells/zsh/.zshrc index 60015ff..6df5967 100644 --- a/configs/zsh/.zshrc +++ b/configs/shells/zsh/.zshrc @@ -3,21 +3,22 @@ export EWCONFIG_ROOT="$HOME/.config/ewconfig" # Load my custom prompt and macros -. $EWCONFIG_ROOT/configs/zsh/prompt.sh -. $EWCONFIG_ROOT/configs/zsh/macros.sh -. $EWCONFIG_ROOT/configs/zsh/keybinds.sh -. $EWCONFIG_ROOT/configs/zsh/autocomplete.sh +. $EWCONFIG_ROOT/configs/shells/zsh/prompt.sh +. $EWCONFIG_ROOT/configs/shells/zsh/macros.sh +. $EWCONFIG_ROOT/configs/shells/zsh/keybinds.sh +. $EWCONFIG_ROOT/configs/shells/zsh/autocomplete.sh # Load per-host configuration if [ -f $EWCONFIG_ROOT/configs/zsh/by_host/$HOSTNAME.sh ]; then - . $EWCONFIG_ROOT/configs/zsh/by_host/$HOSTNAME.sh + . $EWCONFIG_ROOT/configs/shells/zsh/by_host/$HOSTNAME.sh fi # Show some host info -. $EWCONFIG_ROOT/configs/zsh/info.sh +. $EWCONFIG_ROOT/configs/shells/zsh/info.sh # I always want my ~/bin to be in my PATH export PATH="$HOME/bin:$PATH" +export PATH="$EWCONFIG_ROOT/configs/scripts:$PATH" export PATH="$HOME/.local/bin:$PATH" # Configure a sane default editor diff --git a/configs/zsh/autocomplete.sh b/configs/shells/zsh/autocomplete.sh similarity index 100% rename from configs/zsh/autocomplete.sh rename to configs/shells/zsh/autocomplete.sh diff --git a/configs/zsh/info.sh b/configs/shells/zsh/info.sh similarity index 100% rename from configs/zsh/info.sh rename to configs/shells/zsh/info.sh diff --git a/configs/zsh/keybinds.sh b/configs/shells/zsh/keybinds.sh similarity index 100% rename from configs/zsh/keybinds.sh rename to configs/shells/zsh/keybinds.sh diff --git a/configs/shells/zsh/macros.sh b/configs/shells/zsh/macros.sh new file mode 100644 index 0000000..d043a99 --- /dev/null +++ b/configs/shells/zsh/macros.sh @@ -0,0 +1,11 @@ +# We are compatible with bash, so first load the bash-specific macros +. $EWCONFIG_ROOT/configs/shells/bash/macros.sh + +# Search for a process +proc-grep() { + if [ $# != 1 ]; then + echo "Usage: proc-grep " + else + ps aux | { head -1; grep $1 } + fi +} diff --git a/configs/zsh/prompt.sh b/configs/shells/zsh/prompt.sh similarity index 100% rename from configs/zsh/prompt.sh rename to configs/shells/zsh/prompt.sh diff --git a/configs/tabset/tabset b/configs/tabset/tabset new file mode 120000 index 0000000..a3e8e62 --- /dev/null +++ b/configs/tabset/tabset @@ -0,0 +1 @@ +/home/ewpratten/.config/ewconfig/configs/tabset/ \ No newline at end of file diff --git a/configs/zsh/by_host/ewpratten-laptop.sh b/configs/zsh/by_host/ewpratten-laptop.sh deleted file mode 100644 index 2d52610..0000000 --- a/configs/zsh/by_host/ewpratten-laptop.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/bash - -# Various custom-compiled libs live here -export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH - -# SDKMAN! -export SDKMAN_DIR="$HOME/.sdkman" -[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" - -# NVM -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -# Flutter -export PATH="$PATH:$HOME/development/flutter/bin" diff --git a/helpers/git-config-features.sh b/helpers/git-config-features.sh deleted file mode 100644 index 5736766..0000000 --- a/helpers/git-config-features.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash -set -e - -if [[ "$HOSTNAME" == "fedora" ]] || [[ "$HOSTNAME" == "ewpratten-laptop" ]]; then - mkdir -p $HOME/.config/git/features - ln -sf $EWCONFIG_ROOT/configs/git/features/enable-signing.gitconfig $HOME/.config/git/features/enable-signing.gitconfig -fi \ No newline at end of file diff --git a/helpers/install-ssh-config.sh b/helpers/install-ssh-config.sh deleted file mode 100644 index ef1ed14..0000000 --- a/helpers/install-ssh-config.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/sh -# Installs the SSH config file -set -e - -# Link the SSH config file -echo "Linking SSH config file..." -mkdir -p "$HOME/.ssh" -ln -sf "$(pwd)/configs/ssh/config" "$HOME/.ssh/config" - -# Set the correct permissions -echo "Setting SSH config file permissions..." -chmod 644 "$HOME/.ssh/config" -chown "$USER:$USER" "$HOME/.ssh/config" \ No newline at end of file diff --git a/install b/install deleted file mode 100755 index 5a7e72c..0000000 --- a/install +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -CONFIG="install.conf.yaml" -DOTBOT_DIR="dotbot" - -DOTBOT_BIN="bin/dotbot" -BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -cd "${BASEDIR}" -git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive -git submodule update --init --recursive "${DOTBOT_DIR}" - -"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}" diff --git a/install-linux.sh b/install-linux.sh new file mode 100644 index 0000000..60aa757 --- /dev/null +++ b/install-linux.sh @@ -0,0 +1,120 @@ +#! /bin/sh +set -e +export EWCONFIG_ROOT=$(dirname $(readlink -f $0)) + +# -- Ensure that deps exist -- + +# Pull git submodules if needed +if type -p git > /dev/null; then + echo "Syncing git submodules..." + git submodule update --init --recursive +fi + +# Make sure scripts are all executable +chmod +x $EWCONFIG_ROOT/configs/scripts/* +chmod +x $EWCONFIG_ROOT/configs/nautilus/scripts/* + +# -- Directory Setup -- +set -x + +# Ensure that needed directories exist +mkdir -p ~/Downloads # For downloads +mkdir -p ~/bin # Personal bin dir. Reduces the risk of breaking ~/.local/bin +mkdir -p ~/projects # For my projects +mkdir -p ~/src # For compiling other people's projects +mkdir -p ~/services # Service dir for servers mostly + +# Build the directory structure if ~/.config +mkdir -p ~/.config/nvim +mkdir -p ~/.config/termux +mkdir -p ~/.config/logid +mkdir -p ~/.config/systemd/user +mkdir -p ~/.config/git +mkdir -p ~/.config/git/config-fragments +mkdir -p ~/.config/user-tmpfiles.d +mkdir -p ~/.cargo +mkdir -p ~/.ssh + +# Build directory structure for program plugins +mkdir -p ~/.local/share/nautilus/scripts/ + +# -- Config Linking -- + +# Configure the shell +ln -sf $EWCONFIG_ROOT/configs/shells/zsh/.zshrc ~/.zshrc +ln -sf $EWCONFIG_ROOT/configs/shells/bash/.bashrc ~/.bashrc + +# Configure Git +ln -sf $EWCONFIG_ROOT/configs/git/.gitconfig ~/.gitconfig +ln -sf $EWCONFIG_ROOT/configs/sssh/allowed_signers ~/.ssh/allowed_signers +ln -sf $EWCONFIG_ROOT/configs/git/.mailmap ~/.config/git/.mailmap + +# Check if GIT is installed > 2.34 +set +x +if type -p git > /dev/null; then + # If GIT has SSH signing support, enable it + git_version=$(git --version | cut -d' ' -f3 | cut -d'.' -f1-2) + minimum_version=2.34 + if [ "$(printf '%s\n' "$minimum_version" "$git_version" | sort -V | head -n1)" = "$minimum_version" ]; then + set -x + ln -sf $EWCONFIG_ROOT/configs/git/config-fragments/enable-signing.gitconfig ~/.config/git/config-fragments/enable-signing.gitconfig + fi +fi + +# Configure SSH +ln -sf $EWCONFIG_ROOT/configs/ssh/config ~/.ssh/config +chmod 644 "$HOME/.ssh/config" +chown "$USER:$USER" "$HOME/.ssh/config" + +# Configure (neo)Vim +ln -sf $EWCONFIG_ROOT/configs/nvim/init.vim ~/.config/nvim/init.vim +ln -sf $EWCONFIG_ROOT/configs/nvim/pack ~/.config/nvim/pack +ln -sf $EWCONFIG_ROOT/configs/nvim/third_party ~/.config/nvim/third_party + +# Nautilus right-click scripts +ln -sf $EWCONFIG_ROOT/configs/nautilus/scripts/* ~/.local/share/nautilus/scripts/ + +# Tabset configs +ln -sf $EWCONFIG_ROOT/configs/tabset/ ~/.config/tabset + +# Rofi configs +ln -sf $EWCONFIG_ROOT/configs/rofi/ ~/.config/rofi + +# Cargo +ln -sf $EWCONFIG_ROOT/configs/cargo/config.toml ~/.cargo/config.toml + +# Termux +ln -sf $EWCONFIG_ROOT/configs/termux/termux.properties ~/.config/termux/termux.properties + +# Set up user-tempfiles configs +ln -sf $EWCONFIG_ROOT/configs/user-tmpfiles.d/* ~/.config/user-tmpfiles.d/ + +# Logid config +ln -sf $EWCONFIG_ROOT/configs/logid/logid.cfg ~/.config/logid/logid.cfg + +# -- Optional Configs -- +set +x + +# If ~/.config/git/config-fragments/personal-info.gitconfig does not exist +if [ ! -f ~/.config/git/config-fragments/personal-info.gitconfig ]; then + # Ask if the user wants to install personal GIT config + echo "Do you want to install the personal GIT config? (y/n)" + read -r install_git_config + if [ "$install_git_config" = "y" ]; then + ln -sf $EWCONFIG_ROOT/configs/git/config-fragments/personal-info.gitconfig ~/.config/git/config-fragments/personal-info.gitconfig + fi +fi + +# Link houdini scripts for appropriate versions +if [ -d ~/houdini19.5 ]; then mkdir -p ~/houdini19.5/scripts; ln -sf $EWCONFIG_ROOT/configs/houdini19.5/scripts/* ~/houdini19.5/scripts; fi + +# Link blender scripts for appropriate versions +if [ -d ~/.config/blender/3.6 ]; then ln -sf $EWCONFIG_ROOT/configs/blender/3.x/scripts/addons/* ~/.config/blender/3.6/scripts/addons/; fi + +# -- Finalization -- + +# On systems that need it, configure Gnome +sh ./helpers/configure-gnome.sh + +# Attempt to force a termux settings reload on Android devices +termux-reload-settings || true diff --git a/install-windows.sh b/install-windows.sh new file mode 100644 index 0000000..e8a0b62 --- /dev/null +++ b/install-windows.sh @@ -0,0 +1,40 @@ +#! /bin/sh +set -e +export EWCONFIG_ROOT=$(dirname $(readlink -f $0)) + +# Pull git submodules if needed +echo "Syncing git submodules..." +git submodule update --init --recursive + +# Make sure scripts are all executable +chmod +x $EWCONFIG_ROOT/configs/scripts/* +chmod +x $EWCONFIG_ROOT/configs/nautilus/scripts/* + +# -- Directory Setup -- +set -x + +# Ensure that needed directories exist +mkdir -p ~/bin # Personal bin dir. Reduces the risk of breaking ~/.local/bin +mkdir -p ~/projects # For my projects + +# Build the directory structure if ~/.config +mkdir -p ~/.config/git +mkdir -p ~/.config/git/config-fragments +mkdir -p ~/.cargo +mkdir -p ~/.ssh + +# -- Config Linking -- + +# Configure the shell +ln -sf $EWCONFIG_ROOT/configs/shells/zsh/.zshrc ~/.zshrc +ln -sf $EWCONFIG_ROOT/configs/shells/bash/.bashrc ~/.bashrc + +# Configure Git +ln -sf $EWCONFIG_ROOT/configs/git/.gitconfig ~/.gitconfig +ln -sf $EWCONFIG_ROOT/configs/sssh/allowed_signers ~/.ssh/allowed_signers +ln -sf $EWCONFIG_ROOT/configs/git/.mailmap ~/.config/git/.mailmap + +# Configure SSH +ln -sf $EWCONFIG_ROOT/configs/ssh/config ~/.ssh/config +chmod 644 "$HOME/.ssh/config" +chown "$USER:$USER" "$HOME/.ssh/config" \ No newline at end of file