fix(zsh): Some WSL glitches and migration

This commit is contained in:
js0ny 2024-12-01 05:44:40 +00:00
parent 567c8d1b3b
commit 1416ae4f05
3 changed files with 15 additions and 9 deletions

View file

@ -1,4 +1,8 @@
#! /bin/bash
# $DOTFILES/bootstrap/set_symblink_unix.bash
# Date: 2024-12-01
# Author: contact@js0ny.net
# Set symbolic links for Unix-like systems
mkdir -p $XDG_CONFIG_HOME/conda $XDG_CONFIG_HOME/git $XDG_CONFIG_HOME/ideavim $XDG_CONFIG_HOME/markdownlint $XDG_CONFIG_HOME/pip $XDG_CONFIG_HOME/neovide $XDG_CONFIG_HOME/powershell $XDG_CONFIG_HOME/vscode $XDG_CONFIG_HOME/NuGet $XDG_CONFIG_HOME/vim $XDG_CONFIG_HOME/tmux $XDG_CONFIG_HOME/npm $XDG_CONFIG_HOME/readline $XDG_CONFIG_HOME/ipython
mkdir -p ~/.config/zellij # Not support XDG_CONFIG_HOME but same directory
# mkdir -p $WAKATIME_HOME
@ -22,6 +26,7 @@ ln -sf $DOTFILES/common/zellij.config.kdl ~/.config/zellij/config.kdl
# $DOTFILES/tools
ln -sf $DOTFILES/tools/ipython $XDG_CONFIG_HOME/ipython
ln -sf $DOTFILES/tools/nvim $XDG_CONFIG_HOME/nvim
ln -sf $DOTFILES/tools/zsh/common.zshrc $XDG_CONFIG_HOME/zsh/.zshrc
if [ $(uname) = "Darwin"]; then
mkdir -p ~/.config/karabiner $XDG_CONFIG_HOME/skhd $XDG_CONFIG_HOME/yabai $XDG_CONFIG_HOME/sketchybar

View file

@ -1,12 +1,13 @@
# $DOTFILES/platforms//zshrc
# $DOTFILES/platforms/wsl/zshrc
# Date: 2024-12-01
# Author: contact@js0ny.net
# Sourced by user's zshrc if is WSL 在用户的 zshrc 中被引用WSL 特定配置
# Entry point in $DOTFILES/tools/zsh/common.zshrc (入口点)
# TODO: Test on WSL
### Variables ###
export IS_WSL=true
export ARCHFLAGS="-arch x86_64"
source $DOTFILES/wsl/winterop.zsh
source $DOTFILES/platforms/wsl/winterop.zsh
### Misc ###

View file

@ -1,5 +1,5 @@
# $DOTFILES/tools/zsh/mod/navi.zsh
# Date: 2024-11-30
# Date: 2024-12-01
# Author: contact@js0ny.net
# Sourced by user's zshrc 在用户的 zshrc 中被引用
@ -19,13 +19,13 @@ eval "$(zoxide init zsh)"
# Absolute navigation #
alias dotfiles="cd $DOTFILES && ls"
# TODO: Test on WSL
if [ "$IS_WSL" = true ]; then # IS_WSL is defined in $DOTFILES/platforms/wsl/zshrc
alias dt="cd /mnt/c/Users/$(whoami)/Desktop && ls"
alias doku="cd /mnt/c/Users/$(whoami)/Documents && ls"
alias down="cd /mnt/c/Users/$(whoami)/Downloads && ls"
winuser=$(whoami.exe | cut -d'\' -f2 | tr -d '\r')
alias dt="cd /mnt/c/Users/$winuser/Desktop && ls"
alias doku="cd /mnt/c/Users/$winuser/Documents && ls"
alias down="cd /mnt/c/Users/$winuser/Downloads && ls"
alias src="cd /mnt/d/Source"
alias one="cd /mnt/c/Users/$(whoami)/OneDrive"
alias one="cd /mnt/c/Users/$winuser/OneDrive"
alias gdrive="cd /mnt/g"
else
alias dt="cd $HOME/Desktop && ls"