Continue Script OwO

This commit is contained in:
Nikurasu 2023-11-21 16:16:47 +01:00
parent e5705ce0b9
commit 5141107558
Signed by: Nikurasu
GPG key ID: 9E7F14C03EF1F271
2 changed files with 79 additions and 9 deletions

13
patch-codium.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
SERVICE_URL='https://marketplace.visualstudio.com/_apis/public/gallery'
CACHE_URL='https://vscode.blob.core.windows.net/gallery/index'
ITEM_URL='https://marketplace.visualstudio.com/items'
gum style --border rounded --margin '1 1' --padding '1 1' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Select the product.json file of vs-codium to patch it'
PRODUCT_JSON=$(sudo find /usr -name 'product.json' | gum choose)
JSON_STRING=$(cat $PRODUCT_JSON)
JSON_STRING=$(echo "$JSON_STRING" | jq '.extensionsGallery.serviceUrl = $newVal' --arg newVal "$SERVICE_URL")
JSON_STRING=$(echo "$JSON_STRING" | jq '.extensionsGallery.cacheUrl = $newVal' --arg newVal "$CACHE_URL")
JSON_STRING=$(echo "$JSON_STRING" | jq '.extensionsGallery.itemUrl = $newVal' --arg newVal "$ITEM_URL")
JSON_STRING=$(echo "$JSON_STRING" | jq 'del(.linkProtectionTrustedDomains)')
echo "$JSON_STRING" | jq '.linkProtectionTrustedDomains'

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
echo '
-------------------------------------------------------------
_ _ _ _ ____ _ _____ _ _
@ -11,24 +11,81 @@ echo '
Dirty Setup Script for this glorious Dotfiles
-------------------------------------------------------------'
echo '
-------------------------------------------------------------
Install hard dependency golang
-------------------------------------------------------------'
if type -p apt > /dev/null
then
echo 'Debian/Ubuntu'
sudo apt update && sudo apt install golang
PKG_MNGR="apt"
elif type -p dnf > /dev/null
then
echo 'RHEL/Fedora'
sudo dnf install golang
PKG_MNGR="dnf"
fi
echo '
-------------------------------------------------------------
Install hard dependencies golang, jq
-------------------------------------------------------------'
if [ "$PKG_MNGR" = "apt" ]
then
sudo apt-get update > /dev/null && sudo apt-get install golang jq
elif [ "$PKG_MNGR" = "dnf" ]
then
sudo dnf install golang jq
else
echo "No Package Manager configured, couldn't install"
fi
if ! type -p go > /dev/null
then
echo '-------------------------------------------------------------'
echo "Couldn't install go qwq... Aborting the script"
echo '-------------------------------------------------------------'
exit 1
fi
echo '
-------------------------------------------------------------
Install Gum for a pretty CLI Experience
-------------------------------------------------------------'
go install github.com/charmbracelet/gum@latest
go install github.com/charmbracelet/gum@latest > /dev/null
if ! type -p gum > /dev/null
then
echo '-------------------------------------------------------------'
echo "Couldn't install gum qwq... Aborting the script"
echo '-------------------------------------------------------------'
exit 1
fi
gum style --border rounded --margin '1 2' --padding '2 4' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Gum is now installed' 'yay :3'
echo "Niku perfers to use the fish shell, but the design of the dotfiles (starship) works with nearly any shell, do you want to switch to fish"
WANTS_FISH=$(gum choose "Yes" "No")
if [ "$WANTS_FISH" = "Yes" ]
then
if [ "$PKG_MNGR" = "apt" ]
then
sudo apt-get update > /dev/null && sudo apt-get install fish
elif [ "$PKG_MNGR" = "dnf" ]
then
sudo dnf install fish
else
echo "No Package Manager configured, couldn't install"
fi
fi
gum style --border rounded --margin '1 1' --padding '1 1' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Do you want to install nikus fish config'
WANTS_SHELL_THEME=$(gum choose "Yes" "No")
if [ "$WANTS_SHELL_THEME" = "Yes" ]
then
ln -s "$SCRIPT_DIR/fish" $HOME/.config/
fi
gum style --border rounded --margin '1 1' --padding '1 1' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Do you want to install nikus shell theme' 'If you havnt installed nikus fish config you need to reference starship in your shell, by yourself'
WANTS_SHELL_STARSHIP=$(gum choose "Yes" "No")
if [ "$WANTS_SHELL_STARSHIP" = "Yes" ]
then
ln -s "$SCRIPT_DIR/starship/config.toml" $HOME/.config/starship.toml
fi
gum style --border rounded --margin '1 1' --padding '1 1' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Do you want to patch your vscodium config to use microsofts marketplace instead of open-vsx'
WANTS_SHELL_MS_MARKET=$(gum choose "Yes" "No")
if [ "$WANTS_SHELL_MS_MARKET" = "Yes" ]
then