mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(bootstrap): Bootstrap script for GNU/Linux without admin
This commit is contained in:
parent
cb81dc8d53
commit
8aa9daf582
12 changed files with 340 additions and 80 deletions
|
|
@ -1,62 +1,74 @@
|
|||
#!/bin/zsh
|
||||
# duti.zsh
|
||||
# Set default apps (duti)
|
||||
# The id of the app can be found by running
|
||||
# `osascript -e 'id of app "AppName"'`
|
||||
brew install --formula duti
|
||||
echo "[INFO] Setting Default Apps"
|
||||
# Markdown -> Typora
|
||||
duti -s abnerworks.Typora .md all
|
||||
duti -s abnerworks.Typora .markdown all
|
||||
# PDF -> Sioyek
|
||||
duti -s info.sioyek.sioyek .pdf all
|
||||
# Raw Text -> Neovide
|
||||
duti -s com.neovide.neovide .txt all
|
||||
# Archive -> Keka
|
||||
duti -s com.aone.keka .zip all
|
||||
duti -s com.aone.keka .rar all
|
||||
duti -s com.aone.keka .7z all
|
||||
duti -s com.aone.keka .tar all
|
||||
# Source Code Light -> Neovim
|
||||
duti -s com.neovide.neovide .gitignore all
|
||||
duti -s com.neovide.neovide .vimrc all
|
||||
duti -s com.neovide.neovide .vim all
|
||||
duti -s com.neovide.neovide .lua all
|
||||
duti -s com.neovide.neovide .py all
|
||||
duti -s com.neovide.neovide .jl all
|
||||
duti -s com.neovide.neovide .sh all
|
||||
duti -s com.neovide.neovide .c all
|
||||
# Source Code DOTNET -> VSCode
|
||||
duti -s com.microsoft.VSCode .cs all
|
||||
duti -s com.microsoft.VSCode .fs all
|
||||
duti -s com.microsoft.VSCode .fsx all
|
||||
duti -s com.microsoft.VSCode .csx all
|
||||
duti -s com.microsoft.VSCode .ps1 all
|
||||
# Source Code Web -> VSCode
|
||||
duti -s com.microsoft.VSCode .js all
|
||||
duti -s com.microsoft.VSCode .ts all
|
||||
duti -s com.microsoft.VSCode .jsx all
|
||||
duti -s com.microsoft.VSCode .tsx all
|
||||
duti -s com.microsoft.VSCode .css all
|
||||
duti -s com.microsoft.VSCode .scss all
|
||||
duti -s com.microsoft.VSCode .sass all
|
||||
duti -s com.microsoft.VSCode .vue all
|
||||
# Source Code Config -> Neovim
|
||||
duti -s com.neovide.neovide .json all
|
||||
duti -s com.neovide.neovide .yaml all
|
||||
duti -s com.neovide.neovide .yml all
|
||||
duti -s com.neovide.neovide .toml all
|
||||
duti -s com.neovide.neovide .ini all
|
||||
duti -s com.neovide.neovide .cfg all
|
||||
duti -s com.neovide.neovide .conf all
|
||||
duti -s com.neovide.neovide .kdl all
|
||||
duti -s com.neovide.neovide .xml all
|
||||
# Source Code Jupyter -> VSCode
|
||||
duti -s com.microsoft.VSCode .ipynb all
|
||||
# Source Code DotNet Project -> Rider
|
||||
duti -s com.jetbrains.rider .sln all
|
||||
duti -s com.jetbrains.rider .csproj all
|
||||
duti -s com.jetbrains.rider .fsproj all
|
||||
# Video -> IINA
|
||||
duti -s com.colliderli.iina .mp4 all
|
||||
duti -s com.colliderli.iina .mkv all
|
||||
|
||||
mkdir -p $DOTFILES/powershell_private
|
||||
# Define an associative array with file extensions and corresponding app IDs
|
||||
typeset -A app_defaults
|
||||
app_defaults=(
|
||||
# Markdown -> Typora
|
||||
.md abnerworks.Typora
|
||||
.markdown abnerworks.Typora
|
||||
# PDF -> Sioyek
|
||||
.pdf info.sioyek.sioyek
|
||||
# Raw Text -> Neovide
|
||||
.txt com.neovide.neovide
|
||||
# Archive -> Keka
|
||||
.zip com.aone.keka
|
||||
.rar com.aone.keka
|
||||
.7z com.aone.keka
|
||||
.tar com.aone.keka
|
||||
# Source Code Light -> Neovim
|
||||
.gitignore com.neovide.neovide
|
||||
.vimrc com.neovide.neovide
|
||||
.vim com.neovide.neovide
|
||||
.lua com.neovide.neovide
|
||||
.py com.neovide.neovide
|
||||
.jl com.neovide.neovide
|
||||
.sh com.neovide.neovide
|
||||
.c com.neovide.neovide
|
||||
# Source Code DOTNET -> VSCode
|
||||
.cs com.microsoft.VSCode
|
||||
.fs com.microsoft.VSCode
|
||||
.fsx com.microsoft.VSCode
|
||||
.csx com.microsoft.VSCode
|
||||
.ps1 com.microsoft.VSCode
|
||||
# Source Code Web -> VSCode
|
||||
.js com.microsoft.VSCode
|
||||
.ts com.microsoft.VSCode
|
||||
.jsx com.microsoft.VSCode
|
||||
.tsx com.microsoft.VSCode
|
||||
.css com.microsoft.VSCode
|
||||
.scss com.microsoft.VSCode
|
||||
.sass com.microsoft.VSCode
|
||||
.vue com.microsoft.VSCode
|
||||
# Source Code Config -> Neovim
|
||||
.json com.neovide.neovide
|
||||
.yaml com.neovide.neovide
|
||||
.yml com.neovide.neovide
|
||||
.toml com.neovide.neovide
|
||||
.ini com.neovide.neovide
|
||||
.cfg com.neovide.neovide
|
||||
.conf com.neovide.neovide
|
||||
.kdl com.neovide.neovide
|
||||
.xml com.neovide.neovide
|
||||
# Source Code Jupyter -> VSCode
|
||||
.ipynb com.microsoft.VSCode
|
||||
# Source Code DotNet Project -> Rider
|
||||
.sln com.jetbrains.rider
|
||||
.csproj com.jetbrains.rider
|
||||
.fsproj com.jetbrains.rider
|
||||
# Video -> IINA
|
||||
.mp4 com.colliderli.iina
|
||||
.mkv com.colliderli.iina
|
||||
)
|
||||
|
||||
# Loop through the array and set the default apps
|
||||
for ext app_id in ${(kv)app_defaults}; do
|
||||
duti -s $app_id $ext all
|
||||
done
|
||||
|
||||
unset app_defaults
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ echo "Running the setup script"
|
|||
|
||||
export DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
|
||||
|
||||
# In macOS, consider the user as sudoer by default
|
||||
export WHEEL=1
|
||||
export GUI_SETUP=1
|
||||
|
||||
|
||||
# Xcode Command Line Tools
|
||||
echo "[INFO] Installing Xcode Command Line Tools"
|
||||
|
|
@ -32,7 +36,7 @@ echo "[ACTION] Request Human Input"
|
|||
|
||||
|
||||
echo "[ACTION] Press any key to continue when xcode CLI tools are installed"
|
||||
read -n 1
|
||||
read -n 1
|
||||
|
||||
echo "[INFO] Cloning Dotfiles"
|
||||
|
||||
|
|
@ -67,15 +71,7 @@ source $DOTFILES/tools/zsh/zshrc
|
|||
|
||||
# Rime
|
||||
|
||||
echo "[INFO] Installing Rime"
|
||||
|
||||
git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git ~/Library/Rime
|
||||
cd ~/Library/Rime
|
||||
|
||||
just init
|
||||
# just install_rime
|
||||
## Rime is installed via Brewfile
|
||||
just clone_plum
|
||||
source $DOTFILES/bootstrap/components/rime.sh
|
||||
|
||||
echo "[INFO] Installing Doom Emacs"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ for src in ${(k)linkDots}; do
|
|||
echo "Linking $src to $dest"
|
||||
if [ -d "$src" ]; then
|
||||
test -d $dest && mv $dest $dest.bak
|
||||
# mkdir -p $dest
|
||||
ln -sf $src $dest
|
||||
elif [ -f "$src" ]; then
|
||||
dest_parent=$(dirname $dest)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue