31

After a recent update of my LMDE, the gnome-screenshot tool started making an annoying camera shutter noise every time a screenshot is taken. This is both annoying and startling (especially if you happen to be wearing earphones when taking the screenshot).

I checked the man page of gnome-screenshot` but there were no relevant options. How can I take silent screenshots?

5
  • 4
    cameras have to make that sound so you don't illegally make upskirt photos with them. gnome devs are just complying with the law.
    – cas
    Commented Oct 4, 2013 at 1:04
  • @CraigSanders after all, Gnome is designed for tablets right?
    – terdon
    Commented Oct 4, 2013 at 1:07
  • some very bad people have been known to use tablets.
    – cas
    Commented Oct 4, 2013 at 1:10
  • That is total nonsense. Since when did video cams have a shutter speed? All top cameras also have a silent mode (including flash).
    – RichieHH
    Commented Apr 23, 2017 at 15:16
  • Note that gnome-screenshot is not the same as the screenshot functionality that comes with GNOME Shell, launched by pressing the PrintScreen button or by launching Screenshot in the Activities overview.
    – Flimm
    Commented Jul 17, 2023 at 15:40

5 Answers 5

25

I found the solution here. The sound played is /usr/share/sounds/freedesktop/stereo/camera-shutter.oga. So simply renaming that file stops it from being played:

sudo mv /usr/share/sounds/freedesktop/stereo/camera-shutter.oga \
    /usr/share/sounds/freedesktop/stereo/damn-camera-shutter.oga

That's it, next time you take a screenshot, it will be done in silence.

6
  • There isn't a tool for this?
    – slm
    Commented Oct 3, 2013 at 1:47
  • @slm not that I could find. The other suggestion on the linked forum post was to edit the code and recompile. The edit was minimal but I'd rather not get into that.
    – terdon
    Commented Oct 3, 2013 at 1:52
  • 1
    This appears to be the only option. WTF?
    – slm
    Commented Oct 3, 2013 at 13:15
  • 3
    Thank god for you, sir. I hate hate hate that sound and hate even more there is no option anywhere to disable it. I would be lost without this answer.
    – lsh
    Commented Dec 16, 2014 at 15:51
  • 4
    Strangely doesn't work on ubuntu 16
    – Wboy
    Commented May 10, 2017 at 5:45
24

The other solution1 has some inconveniences:
- it requires root access
- it's a global change so it affects all users
- upgrading sound-theme-freedesktop restores the file

For the record, the proper way to do it (and avoid all of the above) is via a custom sound theme that disables2 the default sound file used by gnome-screenshot (the name of the file is screen-capture.oga corresponding to the screen-capture event - hardcoded in gnome-settings-daemon and gnome-screenshot).
Create the custom theme directory:

mkdir -p ~/.local/share/sounds/__custom

create the .disabled file:

touch ~/.local/share/sounds/__custom/screen-capture.disabled

add the index.theme:

cat << 'EOF' > ~/.local/share/sounds/__custom/index.theme
[Sound Theme]
Name=__custom
Inherits=freedesktop
Directories=.
EOF

set __custom as default theme name:

gsettings set org.gnome.desktop.sound theme-name '__custom'

Or, if you're using Cinnamon:

gsettings set org.cinnamon.desktop.sound theme-name '__custom'

and enjoy the silence...


1: Yeah, I know it's actually my solution but at the time of posting it on the arch forums I was just being lazy...

2: A pseudo file format ".disabled" is used for disabling sounds in a theme that inherits from another theme. If the sound lookup algorithms detects a file with the suffix ".disabled" it shall immediately terminate the lookup logic and consider the sound not available. All files with ".disabled" suffix should be of length zero.

3
  • 3
    Doesn't work on Ubuntu Mate 19.04
    – user298742
    Commented May 24, 2019 at 19:36
  • 1
    Doesn't work on GNOME Shell 3.36.8 Commented Mar 23, 2021 at 1:31
  • here the more modern variant: reddit.com/r/gnome/comments/udjdi9/… In gnome-control-center under sounds switch to any alarm sound other than the current one and switch back. This will ensure the directory structure and files needed for the next step are created. Then run: touch ~/.local/share/sounds/__custom/screen-capture.disabled touch ~/.local/share/sounds/
    – soloturn
    Commented Feb 11, 2023 at 5:41
6

Renaming the shutter sound file is OK, but probably won't work if you don't have root access to the system. Here's an alternative approach:

#!/bin/bash
volume=$(amixer sget Master | awk -F '[],[,%]'  '/%/{print $2 }')
amixer sset Master 0
gnome-screenshot
amixer sset Master "$volume"%

What this script does is remember volume percentage, set volume temporarily to 0, take screenshot, and once gnome-screenshot process exits, the volume is restored back to original percentage.

The advantage of this approach is that it is flexible and can be customized to suit your needs. This script can be bound to PrntScr button, or to custom shortcut.

Tested on Ubuntu 16.04 LTS

3
  • Should I add this script to the .bashrc? Where is it supposed to be added? How can I bind it to my custom shortcut of Super key + Shift + s to achieve screenshot of a dragged area on the screen.
    – Porcupine
    Commented Jan 22, 2018 at 19:47
  • 1
    @Nikhil Add this to custom shortcuts in GUI settings, depending on the desktop environment you use. The .bashrc is for shell settings only, GUI stuff doesn't belong there. Commented Jan 22, 2018 at 20:23
  • And interesting hack... could definitely be helpful for some. For me, though, it's a bit of a deal-breaker that this mutes the whole system during this time -- the point (for me) is that I want to be able to keep listening to other things without being annoyed by the screenshot sound.
    – lindes
    Commented Nov 4, 2022 at 21:45
3

When using Gnome tools, the best might be to use Gnome settings with it. Muting "system sounds" in sound settings makes it quiet, and it is not global, and from gnome-44 onwards also selecting a "none" for the sound theme has the same effect: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6376

or, from https://www.reddit.com/r/gnome/comments/udjdi9/remove_screenshot_capture_sound/:

In gnome-control-center under sounds, switch to any alarm sound other than the current one, and switch back. This will ensure the directory structure and files needed for the next step are created. Then run:

touch ~/.local/share/sounds/__custom/screen-capture.disabled
touch ~/.local/share/sounds/
2
  • This is the current correct answer; all the above are out of date and/or complex.
    – kiko
    Commented Mar 7, 2023 at 17:08
  • Thanks, works. For the record, it is absolutely insane that Gnome makes this classic camera snapshot sound fx the default and NO clear way to change it for a decade. That sound will make you seem like a total creeper in a cafe setting! Super embarrasing; the geniuses made it sound like iPhone's classic camera snapshot which everyone knows and associates with PHONES so immediately people assume you're taking photos and god forbid you're behind someone when it goes off.
    – Derrick
    Commented May 28 at 6:16
2

Same code as above but with a slight change to work in ubuntu (adding the -D pulse to select the device, and removing the speech marks on the volume variable. This works for me on Ubuntu 20.04 (create a file in your home dir, make it executable, create a keyboard shortcut in gnome settings to run the script)

#!/bin/bash
volume=$(amixer -D pulse sget Master | awk -F '[],[,%]'  '/%/{print $2 }')
amixer -D pulse sset Master 0
gnome-screenshot
amixer -D pulse sset Master $volume%
1
  • 2
    That doesn't disable the sound, really. It only provides a way of taking a screenshot without the sound. However, the gnome-screenshot command still makes sound when used, so this is only helpful for the specific case of assigning a shortcut to this script.
    – terdon
    Commented Jun 24, 2021 at 11:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .