mb-jgtools/bin/oneshot

29 lines
686 B
Plaintext
Raw Normal View History

2021-11-10 09:56:09 +01:00
#!/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)
2022-08-27 17:34:00 +02:00
COLUMNS="1"
2021-11-10 09:56:09 +01:00
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.png";
desk=$((desk+1));
done
cd ${DESTDIR}
2022-08-27 17:34:00 +02:00
montage /tmp/desktop*.png -tile ${COLUMNS}x${dnum} \
-geometry ${WIDTH}x${HEIGHT}+4+4 workspaces_${DATE}.png
2021-11-10 09:56:09 +01:00
rm /tmp/desktop*.png
viewnior workspaces${DATE}.png &