Compare commits

..

2 Commits

2 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Quit All Apps
# @raycast.mode silent
# @raycast.packageName System
# Optional parameters:
# @raycast.icon 🛑
# Documentation:
# @raycast.description Quits all running applications.
tell application "System Events"
set allApps to application processes whose background only is false
repeat with appProc in allApps
set appName to name of appProc
try
tell application appName to quit
end try
end repeat
end tell

46
sh/open-ruten-remote-vscode.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open Ruten Remote VSCode
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🖥️
# @raycast.packageName @kevisual/raycast
# Documentation:
# @raycast.description SSH to Ruten host, fuzzy select a project with fzf, then open it in VSCode Remote
# @raycast.author abearxiong
# @raycast.authorURL https://raycast.com/abearxiong
FZF_BIN="fzf"
RUTEN_HOST=ruten-dev
if [[ -z "$RUTEN_HOST" ]]; then
osascript -e 'display alert "Ruten Host 为空" message "请先运行 Set Ruten Host 脚本设置远程地址"'
exit 1
fi
CMD="ssh '$RUTEN_HOST' 'find /workspace/projects /workspace/docker -maxdepth 1 -type d 2>/dev/null' | $FZF_BIN --prompt='Ruten Remote > ' | xargs -I{} open 'vscode://vscode-remote/ssh-remote+${RUTEN_HOST}{}'"
osascript <<OSASCRIPT
tell application "iTerm"
activate
try
set newWindow to (create window with default profile)
tell newWindow
tell current session
write text "$CMD"
end tell
end tell
on error
tell current window
create tab with default profile
tell current session
write text "$CMD"
end tell
end tell
end try
end tell
OSASCRIPT