360 Secure SkillHub
360 安全技能中心

wsl-screenshot

核心功能:在WSL2环境中调用Windows PowerShell捕获主屏幕截图,生成带时间戳的PNG文件,保存至Windows图片目录。典型场景:用户在WSL2环境下的截图需求。输入为执行指定bash脚本,输出为截图路径,还支持将最新截图通过消息工具发送,需搭配Win10/11且PowerShell路径正确。

wxuanyuan
wxuanyuan
热度 44.19
最近更新 2026-05-11 17:38:15
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add wsl-screenshot
Metadata
name
wsl-screenshot
description
Capture screenshots from WSL by calling Windows PowerShell. Use when user wants to take a screenshot from WSL environment, or needs screenshot functionality in WSL. Works on WSL2 by invoking Windows PowerShell to capture the primary screen.

WSL Screenshot

Capture screenshots from WSL using Windows PowerShell.

Usage

Take a Screenshot

# Run the screenshot script
~/.openclaw/workspace/skills/wsl-screenshot/scripts/screenshot.sh

# Output: C:\Users\97027\Pictures\wsl_screenshot_YYYYMMDD_HHMMSS.png

Send Screenshot to User

After taking a screenshot, send it via message:

# Get the latest screenshot path
LATEST=$(ls -t /mnt/c/Users/97027/Pictures/wsl_screenshot_*.png | head -1)

# Send via message tool
message action=send media="$LATEST" caption="📸 Screenshot"

Or use direct path:

message action=send media="/mnt/c/Users/97027/Pictures/wsl_screenshot_YYYYMMDD_HHMMSS.png"

Requirements

  • WSL2 with Windows 10/11
  • PowerShell available at /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe

Resources

  • scripts/screenshot.sh - Screenshot script