Skip to content

Instantly share code, notes, and snippets.

@RealTong
Created March 20, 2024 16:30
Show Gist options
  • Select an option

  • Save RealTong/bda18931ad1ae9ef1388f59cea490469 to your computer and use it in GitHub Desktop.

Select an option

Save RealTong/bda18931ad1ae9ef1388f59cea490469 to your computer and use it in GitHub Desktop.
Using Raycast scripts fix chinese
#!/usr/bin/env bash
# Add spaces between Chinese and English, number or symbols.
#
# Dependency: This script requires the `https://www.npmjs.com/package/pangu` package.
# Install it via `pip install pangu` or `pnpm install -g pangu` or `npm install -g pangu`.
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Fix Chinese
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 📝
# @raycast.packageName Pangu
# Documentation:
# @raycast.description Add spaces between Chinese and English, number or symbols.
# @raycast.author RealTong
# @raycast.authorURL https://raycast.com/RealTong
# 用户剪切板的数据就是输入
input=$(pbpaste)
if [ -z "$input" ]; then
echo "剪切板没有数据"
exit 1
fi
output=$(/Users/realtong/Library/pnpm/pangu -t "$input")
if [ -z "$output" ]; then
echo "输出为空"
exit 1
fi
echo $output | pbcopy
echo "已复制到剪切板"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment