2

I want to get user's default screenshooter application. Like, in a fresh install Ubuntu, it is gnome-screenshot, or in Xubuntu it is xfce4-screenshooter. Or maybe Distro A's screenshooter is imagemagick's import, I don't know.

How can I check this?

I'm trying to test whether the user has a screenshooter, a screen capture utility. If so, I'll use it and capture screen, for example.

How can I accomplish this?

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407

2 Answers2

3

To get the name of the default screenshot tool from terminal you can use the following command:

gsettings get org.compiz.integrated command-screenshot

Otherwise, this Q&A may help you.

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
0

On the different Ubuntu flavors you can use the following command to get the name of the default screenshooter application:

egrep -l -H "(applets-screenshooter|snapshot)" /usr/share/applications/* | grep -oP "^.*/\K(.*?)(?=\.desktop)"

This command looks for desktop applications with the snapshot keyword or the applets-screenshooter icon and outputs only the desktop file name (without the extension).

To use the output for example in a bash script:

$ screenshooter="$(egrep -l -H "(applets-screenshooter|snapshot)" /usr/share/applications/* | grep -oP "^.*/\K(.*?)(?=\.desktop)")"
$ echo $screenshooter
gnome-screenshot