我正在運行 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