25

How can I disable the gnome-screenshot 'camera flash' animation (fade from black)? I've already disabled the camera shutter sound with sudo mv /usr/share/sounds/freedesktop/stereo/camera-shutter.oga /usr/share/sounds/freedesktop/stereo/camera-shutter-disabled.oga. There doesn't seem to be a setting for this in the Dconf editor (under /org/gnome/gnome-screenshot).

David Foerster
  • 36,900
  • 56
  • 98
  • 152
1''
  • 351
  • 3
  • 5

2 Answers2

13

Unfortunately there is no option to disable this... I was looking for working tool to grab screen for Ubuntu Focal (previously I've used scrot but it stopped to work, right now only gnome-screenshot is still dumping screen content to file but with annoying flash). So I've recompiled sources from https://github.com/GNOME/gnome-screenshot

  1. git clone https://github.com/GNOME/gnome-screenshot.git && cd gnome-screenshot
  2. In file src/screenshot-backend-shell.c replace all occurrences of TRUE, /* flash */ with FALSE, /* flash */ (you can do that with sed command: sed -i 's#TRUE, /\* flash \*/#FALSE, /\* flash \*/#' src/screenshot-backend-shell.c)
  3. Install dependencies (in my case it was meson, ninja-build, libgtk-3-dev and libhandy-1-dev)
  4. Compile project:
    • meson setup build
    • meson test -C build
  5. Enjoy your new gnome-screenshot tool without flash: ./build/src/gnome-screenshot --file out.jpg

EDIT: it may not work, if you have no gnome-screenshot installed, then it will fail with:

(gnome-screenshot:2537001): GLib-GIO-ERROR **: 23:12:03.190: Settings schema 'org.gnome.gnome-screenshot' is not installed
Trace/breakpoint trap (core dumped)

To fix this pickup one of:

  • install compiled gnome-screenshot in system with meson install -C build and just use gnome-screenshot
  • install schemas with commands:
sudo cp ./data/org.gnome.gnome-screenshot.gschema.xml /usr/share/glib-2.0/schemas/org.gnome.gnome-screenshot.gschema.xml
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
  • install gnome-screenshot with sudo apt install gnome-screenshot
ddzialak
  • 231
  • 1
    In my case I also had to install gettext – Milvintsiss Feb 23 '24 at 01:40
  • 1
    Used to use scrot as well and the only thing stopping me using gnome-screenshot was the flash. This instruction worked perfectly for Ubuntu 24.04. Thank you. – Jeff Sereno Dec 12 '24 at 03:30
  • Is this the most useful answer? Yes it is – Robert Rendell Apr 08 '25 at 19:18
  • Can you add instructions on how to add the dependencies in C? – Robert Rendell Apr 09 '25 at 15:45
  • 1
    On ubuntu it was: sudo apt install meson ninja-build libgtk-3-dev libhandy-1-dev (if failed due to unavailable servers try sudo apt update and repeat) – ddzialak Apr 09 '25 at 21:06
  • meson setup build gives me: data/meson.build:3:0: ERROR: Can not assign None to variable. then meson test -C build gives me ERROR: No such build data file as "'~/gnome-screenshot/build/meson-private/build.dat'". – Robert Rendell Apr 10 '25 at 21:05
  • Jesus, gnome has become a joke at this point. In wayland mode it's basically not possible (or at lest not trivial, like it SHOULD be) to simply take a screenshot programatically?! – olejorgenb May 11 '25 at 09:35
1

Disable Wayland

nano /etc/gdm3/custom.conf

Add an entry

WaylandEnable=false

save

service gdm3 restart