Hello, On Mon, 23 Mar 2020, Istvan Gabor wrote:
It seems "import" can do it nicely what I want to do. I have to play a little bit with it to find the window ID automatically and move the window to the top layer. If it's covered by some other window, the covered part becomes black area in the screenshot.
==== screenshooter.sh ==== ### USAGE: screenshooter.sh [DELAY [APPLICATION [TITLEPATTERN]]] delay="${1:-3}" app="${2:-firefox}" pat="${3:-${app}}" trap 'exit 0' HUP INT EXIT while true; do wid=$(wmctrl -l | awk -vPAT="$pat" 'BEGIN { IGNORECASE=1; } $(NF) ~ PAT { print $1; }' ) date=$(date +%Y%m%d-%H%M%S) wmctrl -i -a "$wid" sleep 0.2 ### you can experiment with this time, no delay ### might still give you the non-raised screenshot import -window "$wid" "${app}_screenshot_${date}.png" sleep "$delay" done ==== Hm. That only matches on $NF... WIP: https://paste.opensuse.org/84118115 HTH, -dnh -- Dann siehst du nämlich ganz genau, daß der Cursor blinkt, und er hat feuerrote tote Augen, mit denen er dich anstarrt und brüllt: ".. UND WENN DU DICH VERTIPPST, DANN FRESSE ICH DICH MITSAMT DEINEM MAUSZEIGER!!!!" [Ratti in suse-programming] -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org