mb-jgtools/bin/oneshot

29 lines
696 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-12-06 23:16:02 +01:00
COL=1
EXT="webp"
2021-11-10 09:56:09 +01:00
DATE=$(date +"%Y%m%d-%H%M%S")
eval $(xdotool getdisplaygeometry --shell)
2022-12-06 23:16:02 +01:00
NUMDESK=$(xdotool get_num_desktops)
DESK=0
while [[ "$DESK" -lt "$NUMDESK" ]];
do
xdotool set_desktop $DESK;
2021-11-10 09:56:09 +01:00
sleep ${SLEEP};
2022-12-06 23:16:02 +01:00
scrot -o "/tmp/desktop${DESK}.${EXT}";
DESK=$((DESK+1));
done
2021-11-10 09:56:09 +01:00
2022-12-06 23:16:02 +01:00
cd "${DESTDIR}"
montage /tmp/desktop*.${EXT} -tile "${COL}"x -geometry "${WIDTH}"x"${HEIGHT}"+4+4 workspaces_"${DATE}".${EXT}
2022-08-27 17:34:00 +02:00
2021-11-10 09:56:09 +01:00
2022-12-06 23:16:02 +01:00
rm /tmp/desktop*.${EXT}
2021-11-10 09:56:09 +01:00
2022-12-06 23:16:02 +01:00
viewnior workspaces_${DATE}.${EXT} &