LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-11-2018, 05:52 PM   #16
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749

Sorry - The last post is a manual technique, but the OP appears to want an unattended scriptable solution.
 
Old 04-12-2018, 03:32 AM   #17
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
Sorry - The last post is a manual technique, but the OP appears to want an unattended scriptable solution.
Yes, exactly. I don't want to perform any mouse clicks on a window to take the screenshot of it, I just want to pass its id to a screenshot taking tool. Again, it should happen in another workspace, not the active one, fully in background. And it should not interfere with the currently active workspace or any windows from it.
 
Old 04-12-2018, 06:10 AM   #18
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
The problem is that when window is in another workspace, it's not displayed so its pixels are not in current display memory. At this point no screenshot can be made until you switch to the workspace when window resides and the pixel are drawn to the screen
 
Old 04-12-2018, 08:11 AM   #19
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
The problem is that when window is in another workspace, it's not displayed so its pixels are not in current display memory. At this point no screenshot can be made until you switch to the workspace when window resides and the pixel are drawn to the screen
I can understand this. But since the window is still alive, its content must be somewhere in memory, no?
 
Old 04-12-2018, 09:33 AM   #20
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Data content yes but to get a graphical view you have to draw lines, colors, points etc on screen
I mean screenshot programs don't draw from evaluated data, they copy screen pixels in a file
 
Old 04-12-2018, 10:48 AM   #21
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Screen capture programs assume that they need to access the active buffer.
So in my dual monitor setup I can access the active buffer on the alternate display.
With a single screen, the only method that I can conceive that could create an alternative active buffer would be to use Xnest to create a second Xserver.
I have played with Xnest, but cannot offer any advice for this use case.
 
Old 04-12-2018, 11:30 AM   #22
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Another idea would be to put the window temporarly in the same workspace but under a background image which would give the illusion of a non visible window
 
Old 04-12-2018, 08:54 PM   #23
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Just got this to work on my little netbook.
I started a nested session running Windowmaker with
Code:
exec xinit /usr/bin/wmaker -- /usr/bin/Xephyr :1 -screen 1000x500
and then I could capture a screenshot from that session from a terminal in another workspace with
Code:
import -display ':1.0' -window 0x1000013 ~/Desktop/wsnapshot.png
 
Old 04-12-2018, 11:59 PM   #24
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
Just got this to work on my little netbook.
I started a nested session running Windowmaker with
Code:
exec xinit /usr/bin/wmaker -- /usr/bin/Xephyr :1 -screen 1000x500
and then I could capture a screenshot from that session from a terminal in another workspace with
Code:
import -display ':1.0' -window 0x1000013 ~/Desktop/wsnapshot.png
Very interesting, could you please test if it works the opposite way? I mean, run the screenshot software in Xephyr and see if you can capture a screen from main session. I will definitely test this too soon, but I'm concerned since I've read that running apps like OpenGL ones in Xnest/Xephyr may have performance penalties. So perhaps it's possible to run the screenshot software in another session, not the app that generates window that needs to be screenshotted.
 
Old 04-13-2018, 08:36 AM   #25
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
From my quick testing, it does not work the opposite way unless the window to be captured is in the same workspace.
I can do
Code:
import -display :1 -window 0xe00013 ~/Desktop/test1.png
from a terminal in a separate workspace on the primary display to capture a window in the Xephyr session
but
Code:
import -display :0 -window 0x2200058 ~/Desktop/test2.png
from a terminal in the Xephyr session only works if the window to be captured from the primary display is in the same workspace as the Xephyr session.
The attached screenshot may clarify.
Attached Thumbnails
Click image for larger version

Name:	snapshot.png
Views:	20
Size:	133.1 KB
ID:	27437  
 
Old 04-13-2018, 09:31 AM   #26
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
@FlinchX, just curious did you try the commands in post #2 ?
 
Old 04-13-2018, 09:52 AM   #27
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
@FlinchX, just curious did you try the commands in post #2 ?
It's my highest priority pet project for this weekend, hopefully I will provide feedback until the weekend is over, on your suggestion and the one about using Xephyr. Sometimes it takes a few days, but I value the help I get in this forum and I always try to provide feedback to people who spend their time trying to help me. You can see it from my post history.
 
Old 04-13-2018, 11:14 AM   #28
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
No problem, I was wondering if it could work (not having the possibility to test it myself)
 
Old 04-13-2018, 11:27 PM   #29
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
Maybe make window sticky, then unstick it with wmctrl?
Not tested (wmctrl not installed here)
Code:
wmctrl -i -r <window id> -b add,sticky
import -window <window id> window_image.png
wmctrl -i -r <window id> -b remove,sticky
second step throws an error, just like when I ran it before, without making the window sticky:

Code:
$ wmctrl -i -r 0x01800003 -b add,sticky
$ import -window 0x01800003 screen.jpg
import: unable to read X window image `0x01800003': Resource temporarily unavailable @ error/xwindow.c/XImportImage/4983.
import: missing an image filename `screen.jpg' @ error/import.c/ImportImageCommand/1287.
 
Old 04-14-2018, 08:05 AM   #30
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Ok, it's seems dwm doesn't support sticky feature. I was worth a try though

And what about (say window is on workspace 2 and you work on workspace 1
Code:
wmctrl -i -r <window id> -t 1
import -window <window id> window_image.png
wmctrl -i -r <window id> -t 2
You may want to use wmctrl -d to verify workspaces numbers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Login window not visible on wakeup. Lubuntu 14.04 wolfson Linux - Desktop 1 02-13-2015 08:50 AM
batch mode mmhs Linux - Newbie 1 09-04-2012 02:51 AM
Running ‘top’ with ‘Irix mode’ off in batch mode alexz1011 Linux - Software 1 10-02-2009 03:29 PM
How to customize KDE so that a window is visible only in one desktop rockor Linux - Desktop 1 08-20-2009 08:38 PM
Using top in batch mode neothephoenix Linux - Server 5 06-09-2007 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration