快速上手
安装与合成器配置
从 AUR、crates.io 或 GitHub Releases 安装 Shotori,配置桌面启动项,并在 niri、Hyprland、sway 等 Wayland 合成器中绑定快捷键。
Shotori 是纯 Rust 编写的 Wayland 原生截图工具,底层基于 zwlr-screencopy-v1 与 wlr-layer-shell-v1 协议,整套界面由 gpui-kit 在 GPU 上直接手绘渲染。
环境要求
- Wayland 合成器:需实现
zwlr-screencopy-v1协议——已在 niri 与 Hyprland 上日常深度实测,并兼容 sway、river、labwc、Wayfire、KWin、COSMIC 等 wlroots 系合成器。(不支持 GNOME Mutter 与 X11。) xdg-desktop-portal:用于调起系统“另存为”文件对话框(主流桌面发行版均默认预装;若开启直接保存则连对话框都可跳过)。- 通知守护进程 (可选):
mako、dunst、swaync等标准org.freedesktop.Notifications服务。
安装方式
Arch Linux (AUR)
AUR 包提供预编译二进制,并自动完成桌面启动器入口(.desktop)与应用图标安装:
paru -S shotori
# 或使用 yay:
yay -S shotori
crates.io (Cargo)
使用稳定版 Rust 工具链(Edition 2024)从源码构建(Release 配置会自动剥离符号表以减小体积):
cargo install shotori
GitHub Releases
也可直接前往 GitHub Releases 下载最新预编译二进制压缩包,解压后将 shotori 放入 PATH(例如 ~/.local/bin/shotori)。
安装桌面图标与启动器入口(手动安装时)
托盘与通知图标已直接内嵌在二进制中,开箱即用。若通过 cargo install 或压缩包手动安装,且希望在应用启动器(如 fuzzel、rofi、walker)中看到 Shotori,可在源码或发行包目录执行:
sh scripts/install-desktop.sh
脚本默认安装到 ~/.local/share,无需 root 权限。发行版打包者可执行:
DESTDIR="$pkgdir" sh scripts/install-desktop.sh /usr
绑定合成器快捷键
将 Shotori 绑定到顺手的全局快捷键即可随时唤起:
niri (~/.config/niri/config.kdl)
binds {
Mod+Shift+S { spawn "shotori"; }
Print { spawn "shotori" "full" "--screen" "--clipboard"; }
Mod+Print { spawn "shotori" "gui" "--window" "--tool" "arrow"; }
}
Hyprland (~/.config/hypr/hyprland.conf)
bind = SUPER SHIFT, S, exec, shotori
bind = , Print, exec, shotori full --screen --clipboard
bind = SUPER, Print, exec, shotori gui --window
sway (~/.config/sway/config)
bindsym $mod+Shift+s exec shotori
bindsym Print exec shotori full --screen --clipboard
可选常驻系统托盘
在桌面自启动中加入 shotori tray,即可通过 StatusNotifierItem 协议常驻 Waybar、KDE Plasma 或 GNOME AppIndicator 托盘:
shotori tray
左键点击托盘图标即可发起截图,右键菜单可直接打开图形化设置窗口。
接下来请阅读五分钟上手了解完整截图工作流。