#!/usr/bin/env bashworkspaces=$1filename=$2if [ -z "$workspaces" ] || [ -z "$filename" ]; then echo "Error: Missing arguments."else current=`wmctrl -d | grep '*' | cut -d' ' -f1` for workspace in `seq 0 $((workspaces-1))`; do wmctrl -s $workspace sleep 1 scrot /tmp/desktop-$workspace.png done montage -geometry +0+0 -tile ${workspaces}x1 /tmp/desktop-*.png ${filename} rm /tmp/desktop-*.png wmctrl -s $currentfi