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?

2 Answers 2

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.

2
  • 1
    So simple, +1 for gsettings Sep 30, 2014 at 17:59
  • is this global? i mean, universal. uhm... is this valid in gnome only? Oct 20, 2014 at 7:33
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
2
  • 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? Sep 30, 2014 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. Sep 30, 2014 at 17:54

You must log in to answer this question.

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