ponty / pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
BSD 2-Clause "Simplified" License
499 stars 89 forks source link

Disable sound when using ImageMagick #9

Closed swrh closed 10 years ago

swrh commented 10 years ago

The ImageMagick's import command emits a beep whenever you grab an image and pyscreenshot doesn't disable it. This can be quite annoying if you have to run it frequently.

I suggest we disable it just by adding the -silent argument in the pyscreenshot/plugins/imagemagick.py file.

    def grab_to_file(self, filename, bbox=None):
        command = 'import -silent -window root '
        if bbox:
            command += " -crop '%sx%s+%s+%s' " % (
                bbox[2] - bbox[0], bbox[3] - bbox[1], bbox[0], bbox[1])
        command += filename
        EasyProcess(command).call()
ponty commented 10 years ago

Thanks!