21 lines
421 B
Bash
Executable File
21 lines
421 B
Bash
Executable File
#!/bin/sh
|
|
# 截图保存到文件并复制到剪贴板
|
|
# 用法: screenshot [full|area]
|
|
|
|
dir=~/Pictures/Screenshots
|
|
mkdir -p "$dir"
|
|
file="$dir/$(date +%Y%m%d_%H%M%S).png"
|
|
|
|
if [ "$1" = "area" ]; then
|
|
grim -g "$(slurp)" "$file"
|
|
else
|
|
grim "$file"
|
|
fi
|
|
|
|
if [ -f "$file" ]; then
|
|
wl-copy < "$file"
|
|
notify-send -a 截图 "已保存并复制到剪贴板" -i "$file"
|
|
else
|
|
notify-send -a 截图 "截图失败"
|
|
fi
|