Screenshots avec ImageMagick

Ce qui suit en script

#!/bin/bash 
time=$(date +%s)
import -window root /home/user/Images/$1$time.jpg
echo "Capture d'écran enregistrée dans /home/user/Images/$1$time.jpg"

ensuite, un alias dans .bash_aliase

alias screenshot='/home/user/Documents/screenshot.sh'

Il suffira, en console, de faire

screenshot image1

Pour prendre une capture de l'écran intitulé “image1” suivi du timestamp. L'écho sert surtout à se rappeler où c'est stocké, il n'y a pas de vérification ; ce script pourrait être amélioré mais il fait son job. Le timestamp évite d'écraser une précédente capture d'écran avec le même nom.