From 0cae2d0fd989cb41e280dfeff812abb3e397d980 Mon Sep 17 00:00:00 2001 From: gwbeip Date: Sun, 14 Jun 2026 21:54:13 +0800 Subject: [PATCH 1/2] chore(nushell): remove risky and redundant aliases --- nushell/modules/pj_aliases.nu | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/nushell/modules/pj_aliases.nu b/nushell/modules/pj_aliases.nu index 28da11b..e033543 100644 --- a/nushell/modules/pj_aliases.nu +++ b/nushell/modules/pj_aliases.nu @@ -19,21 +19,6 @@ export alias moon = curl wttr.in/Moon export alias quote = curl https://api.quotable.io/random | from json | get content export alias dadjoke = curl -H "Accept: application/json" https://icanhazdadjoke.com/ | from json | get joke -# --- Git --- -export alias g = git - -# --- Navigation & Shell --- -export alias c = clear -export def reload [] { exec nu } -export def edit [] { ^$env.EDITOR ($env.NU_POLYJUICE_PATH | path join 'nu_polyjuice.nu') } - -# --- File system --- -export alias tree = ls **/* - -# --- Network --- -export alias myip = curl -s ifconfig.me -export def ports [] { ^netstat -ano | lines | where {|row| $row | str contains 'LISTENING'} | str trim } - # --- System --- export def df [] { if (which ^df | is-not-empty) { From b6923d4f35c3f2d00092cf366bc4d2e3b32dc790 Mon Sep 17 00:00:00 2001 From: gwbeip Date: Mon, 15 Jun 2026 19:39:59 +0800 Subject: [PATCH 2/2] refactor: remove hardcoded personal identifiers from tracked files --- README.md | 2 +- wsl/config_new_archlinux_in_wsl.md | 22 +++++++++++----------- zsh/zshenv | 15 ++++++++++++--- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 84a9ce7..aa6ae51 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Required software: `git`; `fzf`; `zoxide`; `python`; `starship` ```shell -git clone https://gitea.meip.work/gwbeip/TerminalPolyjuice.git $HOME/.TerminalPolyjuice +git clone $HOME/.TerminalPolyjuice cd $HOME/.TerminalPolyjuice/zsh zsh polyjuice.sh install_ohmyzsh config_starship check ``` diff --git a/wsl/config_new_archlinux_in_wsl.md b/wsl/config_new_archlinux_in_wsl.md index d1afc0b..458b41f 100755 --- a/wsl/config_new_archlinux_in_wsl.md +++ b/wsl/config_new_archlinux_in_wsl.md @@ -1,11 +1,11 @@ # Configure New Archlinux in WSL -## Add user `gwb` +## Add user `` ```shell cd pacman -Syu -useradd -m gwb +useradd -m ``` run @@ -16,11 +16,11 @@ to set a password for `root` run ```shell -passwd gwb +passwd ``` -to set a password for user `gwb` +to set a password for user `` -## Add user `gwb` into group `sudo` +## Add user `` into group `sudo` ```shell pacman -S sudo @@ -29,7 +29,7 @@ pacman -S vim edit `/etc/sudoers` uncomment `%wheel ALL=(ALL:ALL) ALL` ```shell -usermod -aG wheel gwb +usermod -aG wheel ``` ## Install and configure `ZSH` @@ -41,12 +41,12 @@ pacman -S fzf pacman -S zoxide pacman -S starship pacman -S python -su gwb +su cd -git clone https://gitea.meip.work/gwbeip/TerminalPolyjuice.git $HOME/.TerminalPolyjuice +git clone $HOME/.TerminalPolyjuice chsh -s /bin/zsh exit -su gwb +su cd mkdir .config cd $HOME/.TerminalPolyjuice/zsh @@ -55,7 +55,7 @@ zsh polyjuice.sh install_ohmyzsh config_starship check add the contents in `$HOME/.TerminalPolyjuice/zsh/zshenv` into `$HOME/.zshenv` -# Set `gwb` as default user +# Set `` as default user ```shell -wsl --manage archlinux --set-default-user gwb +wsl --manage archlinux --set-default-user ``` diff --git a/zsh/zshenv b/zsh/zshenv index cd317cb..1c7bc13 100644 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -1,7 +1,16 @@ # "[interop] appendWindowsPath=false" in /etc/wsl.conf is setted -# Append VSCode on Windows into PATH so that vscode can be used in WSL -export PATH=$PATH:'/mnt/c/Users/gwbei/AppData/Local/Programs/Microsoft VS Code/bin/' -export PATH=$PATH:'/mnt/c/Users/gwbei/AppData/Local/Programs/Zed/bin/zed' +# Dynamically resolve Windows-side program paths (avoids hardcoding usernames) +if [[ -n "$WSLENV" ]]; then + _win_user=$(cmd.exe /c "echo %USERNAME%" 2>/dev/null | tr -d '\r\n') + if [[ -n "$_win_user" ]]; then + _win_home="/mnt/c/Users/$_win_user" + _vscode_bin="$_win_home/AppData/Local/Programs/Microsoft VS Code/bin" + _zed_bin="$_win_home/AppData/Local/Programs/Zed/bin" + [[ -d "$_vscode_bin" ]] && export PATH="$PATH:$_vscode_bin" + [[ -d "$_zed_bin" ]] && export PATH="$PATH:$_zed_bin" + fi + unset _win_user _win_home _vscode_bin _zed_bin +fi # Language and encoding related export LC_ALL=C.UTF-8