9

When I need to take a screenshot using gnome-screenshot, it is disabling the delay when I use "Select area to grab".

enter image description here

Is there any way to fix this defect? Is it a defect or is it by design, and if so, why?

bgoodr
  • 1,562
  • 3
  • 20
  • 34
  • 2
    Grab the whole sceen, and then save and crop the image afterward, as a workaround? – dobey Feb 22 '18 at 16:27
  • 1
    I think "select area"+"delay" is not a very reliable way to "take screenshots of some temporary popup windows" as most of the time you are unsure where exactly the window will pop up and how big it would be. – pomsky Feb 22 '18 at 16:37
  • 2
    Trying both via the terminal gives Conflicting options: --area and --delay should not be used at the same time. You'll need to contact the developers for the reason. I can't think of one. – DK Bose Feb 22 '18 at 16:57
  • Spectacle, the screenshot tool in Kubuntu 16.04 allows you to combine the "area to grab" option and a delay. Thanks for asking the question and making me look at things more closely. – DK Bose Feb 22 '18 at 17:05
  • 1
    This GNOME bug 740089 seems to be related. They disabled it without technical reason. – N0rbert Feb 22 '18 at 22:55
  • 1
    @N0rbert Spot on. I see your comment added to that GNOME bug. So Thanks for calling my attention to it. – bgoodr Feb 24 '18 at 17:03
  • @pomsky I agree. See my non-answer using my screenshot.sh for my workaround that is similar to N0rbert's workaround. It is a non-answer because it requires another trip through Gimp-Land. – bgoodr Feb 24 '18 at 17:51

4 Answers4

5
  • It seems that GNOME developers removed this functionality from gnome-screenshot - it does not work on 14.04 LTS, 16.04 LTS, 17.10 and 18.04 LTS) - I reported:

    1. bug 1751161 to launchpad about disabled "Grab after a delay of..." in
      gnome-screenshot -i
      ;
    2. bug 1751157 to launchpad about option conflict in
      gnome-screeshot --area --delay 10
      .
  • On 16.04 LTS you can use mate-screenshot - it has delay in GUI (launched by mate-screenshot -i -a) and in terminal:

    mate-screenshot --area --delay 10
    

    but it is really ignored.

    In 16.04 LTS, 17.10 and 18.04 LTS delay is disabled when mate-screenshot ran interactively (mate-screenshot -i) - reported bug 1751245 to launchpad about this.

    In 17.10 and 18.04 LTS it works only from terminal - so I reported bug 1751141 to launchpad.

  • If you do not want to make screencast you can use the following:

    1. Open terminal and type sleep 10 && gnome-screenshot --clipboard here and click Enter;
    2. Open GIMP, paste image into it;
    3. Crop image in GIMP;
    4. Export image from GIMP to .png.
  • You can use KDE Spectacle as DK Bose suggested:

    1. Install it with sudo apt-get install kde-spectacle;
    2. Launch it from terminal with spectacle or from menu launcher.

Hope this helps.

N0rbert
  • 99,918
2

Use another app

A work around is to use a screen recorder:

screen recorder.gif

This was made with the package called Peek

After making your .gif file you can edit it to convert a single frame into a .png or .jpg image file.

  • Thanks. That is one of possibly many viable workarounds to https://bugzilla.gnome.org/show_bug.cgi?id=740089 . However, it has roughly the equivalent "finger burden" of the other alternatives mentioned so far. – bgoodr Feb 24 '18 at 17:09
2

Below is a non-answer so that I can reference it elsewhere:

This script below is my workaround to misbehaved windows that do a "root X window grab". I can call it using:

screenshot.sh -d 5 -root

and it will allow me 5 seconds to fiddle with the misbehaving X window that pops up some dynamic (transient?) window and takes a full root window screenshot.

This is a non-answer to this question, because it has extra "finger burden" to crop the resulting image file down to the area of the dynamic popup using a tool such as Gimp. I need a single-shot turn-key solution that does not require me to do the same editing operation repeatedly during my workday.

This script depends upon xwd which is provided in (all?) X11 toolkits and also convert provided by (well at least on my Ubuntu 17.10 desktop install) the graphicsmagick-imagemagick-compat package:

#!/bin/bash
# -*-mode: Shell-script; indent-tabs-mode: nil; -*-

# This seems to hang on me on the RHEL6 desktop:
#
#   gnome-screenshot --window --delay=3
#
# So use xwd + convert instead:

usage () {
  echo "USAGE: $0 [ -d DURATION ] [ -root ]"
}

DURATION="3"
TARGET=""
while [ $# -gt 0 ]
do
  if [ "$1" = "-d" ]
  then
    DURATION="$2"
    shift
  elif [ "$1" = "-root" ]
  then
    TARGET="root"
  elif [ "$1" = "-h" ]
  then
    usage
    exit 0
  else
    echo "ERROR: Unrecognized option $1"
    exit 1
  fi
  shift
done

xwdOptions=""
if [ "$TARGET" = "root" ]
then
  echo "Sleeping for $DURATION seconds so that you can reposition windows for taking screenshot of root window ..."
  xwdOptions="-root"
else
  echo "Sleeping for $DURATION seconds so that you can raise the appropriate window ..."
fi
sleep $DURATION

timestamp="$(date +%Y-%m-%d.%H-%M-%S.%Z)"
screenshot_path="$HOME/screenshot.$timestamp.png"

# Per https://askubuntu.com/questions/962848/imagemagick-identify-fails-to-identify-xwd-images#comment1542670_962848 :
xwd $xwdOptions | convert xwd:- $screenshot_path

echo
echo "SCREENSHOT:       $screenshot_path"
echo
#echo 'Alternatively, use the ImageMagick "import the_output.png" command to select a region'
bgoodr
  • 1,562
  • 3
  • 20
  • 34
1

This was finally fixed in the git version, thanks to Philipp Wolfer: Allow taking area screenshots with delay (164e779a) · Commits · Philipp Wolfer / gnome-screenshot · GitLab.

Remove the workaround that disables the timeout option

The Launchpad issue is also updated

I'm not sure which version of GNOME or Ubuntu it will appear in.

Thanks to everyone who helped along the way to get this fixed.

nealmcb
  • 3,647