Agent Skills
› rokartur/BetterCmdTab
› marketing-screenshots
marketing-screenshots
GitHub自动化捕获BetterCmdTab面板截图,用于网站轮播、README或广告。通过修改配置隐藏桌面图标,使用脚本和CGEvent触发截图,自动裁剪并转换为WebP/JPEG格式,同时确保系统状态完整恢复。
触发场景
需要生成BetterCmdTab面板的营销图片
请求网站轮播图或README中的软件界面截图
安装
npx skills add rokartur/BetterCmdTab --skill marketing-screenshots -g -y
SKILL.md
Frontmatter
{
"name": "marketing-screenshots",
"description": "Capture the switcher layouts for the site carousel, README or ads. Use when asked for BetterCmdTab screenshots or marketing images."
}
The user's desktop is live state: their wallpaper, icons and windows stay as they are, and every setting you change is restored at the end.
- Ask which Desktop (Space) to shoot on. Shoot there, on the wallpaper it already has; the user picks the wallpaper, never you.
- Back up
~/.config/bettercmdtab/config.json, then sethideFromScreenSharingtofalse(withtruethe panel never lands in a capture). Switch layouts withlayoutMode(list,iconDock,windowPreview) throughjqon that file; the app reloads it live. - Hide desktop icons:
defaults write com.apple.finder CreateDesktop false && killall Finder. - Put the capture run in one script and start it with
nohup … &. Switching Spaces kills processes attached to your shell, so a foreground run dies with it. The script opens the panel with a held ⌘Tab chord (CGEvent), runsscreencapture -x, and writes a done-file; poll for that file. - Restore: the config backup,
CreateDesktop truepluskillall Finder, the original Space. - Crop centred on the panel with equal top and bottom margins; grid and list crop tighter than preview. Use
magickfor the crop. - Write
web/public/screenshots/{list,grid,preview}.jpg(2000 px wide, JPEG q82) and the matching.webp(cwebp -q 80); the carousel loads the WebP,site.webmanifestandweb/src/routes/__root.tsxthe JPEG. When the size changes, update theaspect-[…]class inweb/src/routes/index.tsxandsizesinweb/public/site.webmanifest.
Done when all three images are written, read back and checked for clipping and desktop icons, and the user's config, desktop icons and Space are back as they were.
版本历史
- 3df8c68 当前 2026-10-18 19:36


