From eacf8f9eb9428d078bead25949cb57416775987e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 4 Apr 2024 17:54:18 +0200 Subject: [PATCH] Install `zoxide` --- scripts/Arch/Collections/personal.sh | 1 + scripts/Common/Config/zoxide/install.ps1 | 12 ++++++++++++ scripts/Common/Config/zoxide/install.sh | 16 ++++++++++++++++ scripts/Windows/Collections/Generic.ps1 | 5 +++++ 4 files changed, 34 insertions(+) create mode 100644 scripts/Common/Config/zoxide/install.ps1 create mode 100755 scripts/Common/Config/zoxide/install.sh diff --git a/scripts/Arch/Collections/personal.sh b/scripts/Arch/Collections/personal.sh index 8b02ecdf..52d4c0b9 100755 --- a/scripts/Arch/Collections/personal.sh +++ b/scripts/Arch/Collections/personal.sh @@ -34,6 +34,7 @@ sudo pkgfile --update; . "../Software/vim/install.sh"; . "../Software/git/install.sh"; . "../Software/aliae/install.sh"; +. "../../Common/Config/zoxide/install.sh"; sudo chsh $USER --shell "$(which fish)"; diff --git a/scripts/Common/Config/zoxide/install.ps1 b/scripts/Common/Config/zoxide/install.ps1 new file mode 100644 index 00000000..baec169b --- /dev/null +++ b/scripts/Common/Config/zoxide/install.ps1 @@ -0,0 +1,12 @@ +#!/bin/pwsh +. "$PSScriptRoot/../powershell/lib.ps1"; + +Add-PowerShellProfileStatement ` + -System ` + -Category "zoxide" ` + -Statement $( + @( + "# zoxide", + $(Get-ScriptInitializer "zoxide init powershell | Out-String") + ) -join [System.Environment]::NewLine + ) diff --git a/scripts/Common/Config/zoxide/install.sh b/scripts/Common/Config/zoxide/install.sh new file mode 100755 index 00000000..0ae00598 --- /dev/null +++ b/scripts/Common/Config/zoxide/install.sh @@ -0,0 +1,16 @@ +#!/bin/bash +pushd "${BASH_SOURCE%/*}" > /dev/null; +. "../bash/profile.sh"; +. "../fish/profile.sh"; + +{ + echo 'eval "$(zoxide init bash)"'; +} | addBashProfile "zoxide"; + +{ + echo "zoxide init fish | source"; +} | addFishProfile "zoxide"; + +sudo pwsh -NoProfile ./install.ps1; + +popd > /dev/null; diff --git a/scripts/Windows/Collections/Generic.ps1 b/scripts/Windows/Collections/Generic.ps1 index c7a6d470..1f04728a 100644 --- a/scripts/Windows/Collections/Generic.ps1 +++ b/scripts/Windows/Collections/Generic.ps1 @@ -30,6 +30,11 @@ function Restore-GenericApps([Context] $context) { Restore-Git $context; Restore-PuTTY $context; + # Essentials + choco install -y zoxide; + winget install --accept-source-agreements --accept-package-agreements -e --id junegunn.fzf; + . "$PSScriptRoot/../../Common/Config/zoxide/install.ps1"; + # Design choco install -y ` nerd-fonts-CascadiaCode;