我正在运行 Fedora 25,我需要拍摄一些特定的屏幕截图,因此我了解到快门是一个很棒的工具。遗憾的是我由于某种原因无法使用它。每当我尝试截图时,结果都是这样:
答案1
答案2
我还经常使用快门来制作和轻松重命名屏幕截图,并且很遗憾看到它在 Fedora 27 中被 Wayland 破坏。
gnome-screenshot 是一个非常有用的实用程序,可以在 Fedora-wayland 中制作屏幕截图。它可以很容易地用于在 Wayland 中创建 Shutter 的解决方法,如下所示:
1)创建附加脚本shut.sh和grabname.sh。
2)使它们可执行(chmod +x)并将它们保存在现有的命令路径中,以便可以从命令行调用它们,例如。在 /usr/bin 中。我倾向于将自定义脚本保存在 /usr/local/bin 中,但这必须使用 visudo 添加到默认路径。
3)现在,当您运行 shutdown.sh 时,将出现一个光标。使用它绘制一个矩形,终端将弹出,询问您新文件的名称(grabname.sh)。您可以在文件名中使用空格。然后它会询问您是否要在文件前添加 yyyymmdd (y) 前缀。按回车键或其他任何键可以跳过前缀。
4) 您重命名的文件保存在 /my/temp/location 中
5)将其另存为 shutdown.sh :
#!/bin/sh
# START shut.sh
# This script calls gnome-screen shot in Wayland to take a rectangular screenshot
# resulting png is saved to /my/temp/location
# script then calls a second script (grabname.sh) which asks you for a filename to give the grab with the option to prefix current date if you want
# make sure both scripts are in a relevant executable path for your kernel eg. /usr/bin etc.
# You can allocate shut.sh to a hot key in settings and make screengrabs via a hotkey.
gnome-screenshot -a -f /my/temp/location/grabcache.png
gnome-terminal -e "bash grabname.sh"
# END shut.sh
抢名.sh
#!/bin/sh
# START grabname.sh
# Previous script shut.sh calls gnome-screen shot in Wayland to take a rectangular screenshot
# resulting png is saved to /my/temp/location
# This script (grabname.sh) asks you for a filename to give the grab with the option to prefix current date if you want
# * spaces are allowed in filenames *
# make sure both scripts are in a relevant executable path for your kernel eg. /usr/bin etc.
# set -x
IFS=$'\n'
read -p "Name for grab? " grab
while true; do
read -p "Append date yyyymmdd (y or anything else for no) ?" yn
case $yn in
[Yy]* ) ap=$(date +%Y%m%d_%H%M_)
break;;
* ) echo -e "\n\e[0;34mNot prefixing date...\e[0m\n"; ap="";break;;
esac
done
echo $ap$grab
cp /my/temp/location/grabcache.png /my/temp/location/"$ap$grab".png
nautilus /my/temp/location
# END grabname.sh