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.
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.