You are not logged in.
I am running Xfce 4.12 in a Slackware64 14.2 system. In my Xfce desktop I have 8 workspaces. What I would like to do is to capture a screenshot of each of those workspaces at regular intervals. I would like for this to happen automatically, from a script launched by cron.
Can this be done at all? It is of course easy enough to do a script capture by hand, but I wouldn't know how to start when it comes to doing it from a script - all the more so if it is a script to be invoked automatically.
Offline
Actually, I think I got a solution: a combination of xdotool and scrot seem to do the trick. Still, if anybody can propose a different mechanism, I would still be interested to hear about it.
Offline
Can you share the details? Is it similar to this method?
Try using wmctrl to switch to the workspace briefly, like this:
wmctrl -s 1; scrot; wmctrl -s 0
Because, from this other thread I don't see an obvious way to do it, as hidden desktops are unrendered untill seen, aren't they?
Offline
The following script works for me:
#! /bin/sh
export DISPLAY=localhost:0.0
WORKSPACES=8
CURRENT=`xdotool get_desktop`
COUNT=0
while [ $COUNT -lt $WORKSPACES ]; do
FILENAME=`date +'%Y%m%d%H%M%S'`_$COUNT.jpg
xdotool set_desktop $COUNT
scrot -q 100 -d 1 /tmp/$FILENAME
COUNT=$(($COUNT + 1))
done
xdotool set_desktop $CURRENT
Assuming that your desktop is running and you have eight workspaces, this works all right, even when invoked by cron. I don't know about wmctrl, which I don't have anyway; xdotool seems to do the same as wmctrl purportedly does.
Offline
Cool, thanks for sharing!
Offline
I had to disable my Xfce screensaver, of course, but I also had to disable the screen blanking feature that is part of X:
xset -dpms
xset s noblank
xset s off
Otherwise, when invoked from crontab, I would get snapshots of blanks screens.
Offline
[ Generated in 0.013 seconds, 7 queries executed - Memory usage: 533.5 KiB (Peak: 534.34 KiB) ]