mb-jgtools/bin/oneshot

29 lines
696 B
Bash
Executable File

#!/bin/bash
# Based on: https://askubuntu.com/questions/211750/taking-screenshots-of-all-or-specific-virtual-desktops-workspaces-or-windows
SLEEP="5"
DESTDIR=$(xdg-user-dir PICTURES)
COL=1
EXT="webp"
DATE=$(date +"%Y%m%d-%H%M%S")
eval $(xdotool getdisplaygeometry --shell)
NUMDESK=$(xdotool get_num_desktops)
DESK=0
while [[ "$DESK" -lt "$NUMDESK" ]];
do
xdotool set_desktop $DESK;
sleep ${SLEEP};
scrot -o "/tmp/desktop${DESK}.${EXT}";
DESK=$((DESK+1));
done
cd "${DESTDIR}"
montage /tmp/desktop*.${EXT} -tile "${COL}"x -geometry "${WIDTH}"x"${HEIGHT}"+4+4 workspaces_"${DATE}".${EXT}
rm /tmp/desktop*.${EXT}
viewnior workspaces_${DATE}.${EXT} &