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?


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.

|improve this answer|||||
  • 1
    So simple, +1 for gsettings – Sylvain Pineau Sep 30 '14 at 17:59
  • is this global? i mean, universal. uhm... is this valid in gnome only? – user1652575 Oct 20 '14 at 7:33

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
|improve this answer|||||
  • I'm sure that my default screenshoter is Shutter. Even like this, your answer give me another two default screenshooters (gnome-screenshot and xfce4-screenshooter). How can be this possible? To have two default screenshooters? – Radu Rădeanu Sep 30 '14 at 17:10
  • @RaduRădeanu Actually I assumed that my command had to be run on a fresh installation. I then checked the .desktop files of gnome-terminal, KSnapshot and xfce4-screenshooter. As shutter is not installed by default I didn't check it. Of course if you install xfce4-screenshooter on stock ubuntu it will also match hence the two results. – Sylvain Pineau Sep 30 '14 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.