#!/bin/bash # progname: dwm_print # version: 0.2 # author: mt # last modified: 2012/02/03 if [ "$1" == "--help" ] || [ "$1" == "-help" ]; then echo "Usage: $0 [Options]" echo "Options: " echo " --root : capture root window" echo " --help: print this message" echo fi umask 077 date=`date '+%Y_%m_%d-%H_%M_%S'` if [[ "$1" == "--root" || "$1" == "-root" ]]; then # root window xwd -root | convert - screen_${date}.jpg else # only selectionated window xwd | convert - window_${date}.jpg fi