vault backup: 2026-01-05 13:03:55
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
|
||||
release token:
|
||||
```
|
||||
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
|
||||
```
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
api:
|
||||
secret_WggiGblW3PayQXirTeOCrS9FTsQ5EWGWHjInmNcvJdv
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
Here is the **definitive, consolidated guide** for setting up Playwright on **Arch Linux (WSL)**.
|
||||
|
||||
This summary skips the trial-and-error we just went through and provides the "Happy Path" to get everything working in one go.
|
||||
|
||||
---
|
||||
|
||||
### 📋 Prerequisites
|
||||
* **WSL 2** (Recommended).
|
||||
* **Proxy (Optional):** If you are behind a proxy, remember to use `sudo -E` to preserve environment variables.
|
||||
|
||||
---
|
||||
|
||||
### 🚀 Step 1: System Prep & Node.js
|
||||
First, ensure your package database is fresh (fixes 404 errors) and install Node.js.
|
||||
|
||||
```bash
|
||||
# Update system and install Node.js/npm
|
||||
# Use -E if you have https_proxy set in your shell
|
||||
sudo -E pacman -Syu nodejs npm
|
||||
```
|
||||
|
||||
### 📦 Step 2: Install System Dependencies (The Critical Step)
|
||||
**Do not** use `npx playwright install-deps` (it fails on Arch). Instead, install these packages manually. This list includes all the X11, Graphics, and Network libraries required by Chromium, Firefox, and WebKit.
|
||||
|
||||
```bash
|
||||
sudo -E pacman -S --needed \
|
||||
git \
|
||||
nss \
|
||||
nspr \
|
||||
libdrm \
|
||||
alsa-lib \
|
||||
mesa \
|
||||
gtk3 \
|
||||
at-spi2-core \
|
||||
pango \
|
||||
cairo \
|
||||
gdk-pixbuf2 \
|
||||
libx11 \
|
||||
libxcomposite \
|
||||
libxdamage \
|
||||
libxext \
|
||||
libxfixes \
|
||||
libxrandr \
|
||||
libxcursor \
|
||||
libxi \
|
||||
libxrender \
|
||||
libxcb \
|
||||
freetype2 \
|
||||
fontconfig \
|
||||
ffmpeg
|
||||
```
|
||||
|
||||
### 🛠️ Step 3: Initialize Playwright
|
||||
Set up your project and download the browser binaries (these are separate from the system libs above).
|
||||
|
||||
```bash
|
||||
# Create project directory
|
||||
mkdir my-tests && cd my-tests
|
||||
|
||||
# Initialize (Select TypeScript/JavaScript as preferred)
|
||||
npm init playwright@latest
|
||||
|
||||
# If prompted to "Install Playwright browsers", select True.
|
||||
# If you need to install them manually later:
|
||||
npx playwright install
|
||||
```
|
||||
|
||||
### ✅ Step 4: Run Tests
|
||||
You are now ready to run.
|
||||
|
||||
```bash
|
||||
npx playwright test
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 💡 Troubleshooting Cheat Sheet
|
||||
|
||||
| Issue | Solution |
|
||||
| :------------------------ | :-------------------------------------------------------------------------------- |
|
||||
| **`install-deps` fails** | **Ignore it.** It only supports Ubuntu. Use the `pacman` command in Step 2. |
|
||||
| **`libxxx.so not found`** | You are missing a package. Use `pkgfile libxxx.so` to find the Arch package name. |
|
||||
| **404 Errors (Pacman)** | Your mirrors are out of sync. Run `sudo pacman -Syu` to refresh. |
|
||||
| **Browser won't launch** | Ensure `nspr` and `nss` are installed (included in Step 2). |
|
||||
| **GUI/Headless issues** | If visual mode fails, try `xvfb-run npx playwright test`. |
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
变量隐藏 [[Scope and Shadowing - Rust By Example]]
|
||||
@@ -0,0 +1,173 @@
|
||||
|
||||
To set up **Oh My Posh** with **Zsh** on **Debian 12**, follow these steps to install the necessary components and configure your terminal prompt.
|
||||
|
||||
## Installation Steps
|
||||
|
||||
### 1. Download the Oh My Posh Binary
|
||||
First, you need to download the Oh My Posh binary suitable for Linux. Open your terminal and run the following command:
|
||||
|
||||
```bash
|
||||
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
|
||||
```
|
||||
|
||||
### 2. Set Executable Permissions
|
||||
Make the downloaded binary executable:
|
||||
|
||||
```bash
|
||||
sudo chmod +x /usr/local/bin/oh-my-posh
|
||||
```
|
||||
|
||||
### 3. Create a Directory for Themes
|
||||
You need a directory to store your themes. Create it using:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.poshthemes
|
||||
```
|
||||
|
||||
### 4. Download Themes
|
||||
You can download predefined themes from the Oh My Posh repository. For example, to download the latest themes, run:
|
||||
|
||||
```bash
|
||||
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
|
||||
```
|
||||
|
||||
Unzip the downloaded file:
|
||||
|
||||
```bash
|
||||
unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
|
||||
```
|
||||
|
||||
Then, clean up by removing the zip file:
|
||||
|
||||
```bash
|
||||
rm ~/.poshthemes/themes.zip
|
||||
```
|
||||
|
||||
### 5. Update Your Zsh Configuration
|
||||
Now, you need to configure your Zsh shell to use Oh My Posh. Open your `.zshrc` file in a text editor:
|
||||
|
||||
```bash
|
||||
nano ~/.zshrc
|
||||
```
|
||||
|
||||
Add the following line at the end of the file to initialize Oh My Posh with a specific theme (replace `alien` with your preferred theme name):
|
||||
|
||||
```bash
|
||||
eval "$(oh-my-posh --init --shell zsh --config ~/.poshthemes/alien.omp.json)"
|
||||
```
|
||||
|
||||
### 6. Apply Changes
|
||||
After saving and closing the `.zshrc` file, apply the changes by running:
|
||||
|
||||
```bash
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
## Additional Configuration
|
||||
|
||||
### Install a Nerd Font (Optional)
|
||||
For better aesthetics, install a Nerd Font that supports icons used by Oh My Posh. You can download fonts like **Meslo** or **Fira Code** from their respective repositories and install them on your system.
|
||||
|
||||
### Set Terminal Font
|
||||
Finally, ensure that your terminal emulator is configured to use the newly installed Nerd Font for optimal display of icons and symbols.
|
||||
|
||||
By following these steps, you will have successfully set up Oh My Posh with Zsh on Debian 12, enhancing your terminal's appearance and functionality.
|
||||
|
||||
Citations:
|
||||
[1] https://dev.to/karleeov/wsl-arch-setup-for-oh-my-posh-51pa
|
||||
[2] https://www.reddit.com/r/NixOS/comments/1ge1gwn/how_to_set_ohmyposh_settings/
|
||||
[3] https://ohmyposh.dev/docs/installation/linux
|
||||
[4] https://www.librebyte.net/en/cli-en/oh-my-posh-a-beatifull-prompt-for-your-shell/
|
||||
[5] https://www.youtube.com/watch?v=nGHgyPLi7UM
|
||||
[6] https://calebschoepp.com/blog/2021/how-to-setup-oh-my-posh-on-ubuntu/
|
||||
[7] https://www.linux.org/threads/need-help-finalizing-oh-my-posh-bash-terminal.52617/
|
||||
|
||||
|
||||
|
||||
.zshrc
|
||||
```
|
||||
#go lang
|
||||
export GOROOT=/usr/local/go
|
||||
export GOPATH=/home/windy/go-lang
|
||||
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||
|
||||
eval "$(oh-my-posh --init --shell zsh --config ~/.poshthemes/powerlevel10k_modern.omp.json)"
|
||||
|
||||
|
||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||
|
||||
|
||||
# Zinit setup and plugin management
|
||||
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
||||
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
|
||||
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
||||
source "${ZINIT_HOME}/zinit.zsh"
|
||||
|
||||
# Load essential annexes (non-turbo mode for annex functionality)
|
||||
zinit light-mode for \
|
||||
zdharma-continuum/zinit-annex-as-monitor \
|
||||
zdharma-continuum/zinit-annex-bin-gem-node \
|
||||
zdharma-continuum/zinit-annex-patch-dl \
|
||||
zdharma-continuum/zinit-annex-rust
|
||||
|
||||
# Load Zeno plugin with keybindings
|
||||
zinit ice lucid depth"1" blockf
|
||||
zinit light yuki-yano/zeno.zsh
|
||||
|
||||
if [[ -n $ZENO_LOADED ]]; then
|
||||
bindkey ' ' zeno-auto-snippet
|
||||
bindkey '^m' accept-line
|
||||
bindkey '^i' zeno-completion
|
||||
bindkey '^g' zeno-ghq-cd
|
||||
bindkey '^r' zeno-history-selection
|
||||
bindkey '^x' zeno-insert-snippet
|
||||
fi
|
||||
|
||||
# Load additional Zsh plugins
|
||||
zinit ice wait"0"; zinit light zsh-users/zsh-completions
|
||||
autoload -Uz compinit && compinit
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
||||
zstyle ':completion:*:default' menu select=1
|
||||
|
||||
zinit light zsh-users/zsh-syntax-highlighting
|
||||
zinit light zsh-users/zsh-autosuggestions
|
||||
zinit light Aloxaf/fzf-tab
|
||||
|
||||
# FZF configuration
|
||||
zi ice from"gh-r" as"program"
|
||||
zi light junegunn/fzf
|
||||
|
||||
# Auto-suggestions styling
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=244"
|
||||
|
||||
# History settings
|
||||
HISTFILE=~/.zsh-history
|
||||
HISTSIZE=100000
|
||||
SAVEHIST=1000000
|
||||
HISTDUP=erase
|
||||
setopt appendhistory sharehistory hist_ignore_space hist_ignore_all_dups
|
||||
setopt hist_save_no_dups hist_ignore_dups hist_find_no_dups
|
||||
setopt inc_append_history share_history
|
||||
|
||||
# Zsh options for usability
|
||||
setopt AUTO_CD
|
||||
setopt AUTO_PARAM_KEYS
|
||||
|
||||
# Completion and FZF styling
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*' menu no
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
||||
|
||||
# Load additional plugins with default keys
|
||||
zinit pack"default+keys" for fzf
|
||||
|
||||
# Ensure Zinit autocompletion
|
||||
autoload -Uz _zinit
|
||||
(( ${+_comps} )) && _comps[zinit]=_zinit
|
||||
|
||||
# Consolidate PATH with deduplication
|
||||
export PATH=$(echo "/run/current-system/sw/bin:/usr/local/bin:/usr/local/sbin:$PATH" | tr ':' '\n' | awk '!seen[$0]++' | tr '\n' ':' | sed 's/:$//')
|
||||
|
||||
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user