Map framebuffer into an X window - linux

Is there any easy hack or existing application that shows an existing framebuffer device (eg. like /dev/fb0 in an X window? So it would be possible to monitor multiple framebuffer applications simultaneously or peek on them from time to time without leaving the desktop.

Isn't x11vnc supposed to be able to do that?
x11vnc -rawfb map:/dev/fb0#1024x768x32

Related

How does Xorg manage multiple monitors if there's only one framebuffer?

X manages to display different things on each display even though if you write a frame to /dev/fb0 it will be identical on all displays connected to that GPU. What does X do differently than the framebuffer? Does it bypass the frame buffer?

Can I attach screen after system restart?

I used to create a screen and use vim to trace source code.
I usually use the commands to create, detach and attach a screen to keep my vim status.
$ screen -S vim_src1
[CTRL+a] d to detach the screen
$ screen -r vim_src1
However, screen status will be killed after system restart.
Can I attach screen after system restart?
After a system restart there is no screen session to attach. You can certainly create a new session.
A screen session that you could attach has been running since you detached it. A system restart kills all of the processes (including those running in screen).
In desktop environments, you may see occasional support for saving "session" state. Doing that relies upon each application to save its state when asked, e.g., on system shutdown. That can be workable for large GUI applications (which are designed to handle events). But in contrast, screen is mostly used for shell applications where this is done rarely.
Rather than require each application to save/restore itself, it is conceivable that the operating system could be designed to do this. But that does not appear to be the case for the systems we are using.
Further reading:
How to Automatically Remember Running Applications from Your Last Session in Ubuntu 14.04
How can I keep restore for apps in Lion without having session restore when I log in?
I can interpret your answer in a few ways, because I'm not 100% certain what your objective is. I'll try to give the two most obvious options I'm aware of.
You can configure your screen session with ~/.screenrc so it always launches the same with, with labels and for screens, and it will even launch applications for you. For example:
defutf8 on
caption always "%{= kK} %{K}%-w%{+b w}%51>%n %t%{= K}%+w%<%-=%{= kK} me#localhost | %{w}20%y-%m-%d %{w}%0c:%s %{-}"
shelltitle '$|$'
defscrollback 10000
termcap xterm|xterms|xs ti=\E7\E[?47l
terminfo xterm|xterms|xs ti=\E7\E[?47l
startup_message off
screen -t vim 0 vim $HOME/todo.txt
screen -t ipython 1 ipython
screen -t finch 2 finch
screen -t mutt 3 mutt
screen -t top 4 top
chdir $HOME/Repos/git
screen -t CL 5
screen -t git 6
If you actually want to be able to save a session that you're in you might consider using screen-session.
https://github.com/skoneka/screen-session
Session saver currently supports saving of: layouts, scrollbacks,
titles, filters and is able to restart programs run in windows. It
recognizes regular, group and zombie windows. Currently there is no
support for serial and telnet window types. By default, session saver
also tries to save Vim sessions using ":mksession" and ":wviminfo".
Session saver accesses important data by directly reading /proc
filesystem and sorts processes by parent pid. There is almost no
"stuffing" of commands into windows (except when saving Vim sessions)
so there is no interaction with programs itself.
During session loading, every new window starts with
screen-session-primer (a small C program) which displays a list of
processes and asks user what to do: whether to start none, some or all
of window's processes or directly starts programs provided
"--force-start [win_num]" option was used.

Embedded Linux with Standalone application

I want to make Linux Os which run only one application as a full screen without showing any Login window at start up or title-bar and minimize/maximize/close button.
Is there any way to do this? It's Embedded platform and I already build Linux os for it and I also have application.
In the nutshell - X System is extremely flexible.
When you system starts up, it does the following steps:
Loads and runs the Kernel (and related initrd, if any, but it's irrelevant)
Starts init (process 1)
Starts system services, networking, etc.
Starts X server
Starts Window Manager (the application responsible for resizing windows etc)
Starts your application.
What you need to do, is to first disable GUI login and session (easiest to disable X) - you'll be able to log in through the console terminal (You can always access it with Ctrl-Alt-F1)
Then, launch something along the lines of
X &
DISPLAY=:0 ./yourapp.exe
If your app can handle making itself fullscreen, that would be it.
Add this to your startup scripts and you're there.
More explanation
The purpose of the Window Manager.. is to manage windows. It's that simple :)
Basically, there are 3 components of your typical X session.
X Server - the piece of software that provides an abstraction layer around the hardware (GPU drivers, Keyboard, Mouse, Touchscreen, etc). It has a concept of windows - areas where X Clients can draw into.
X Clients - Everything else. Your software, if it draws something, is likely one. So is the web browser, etc. The connect to the X Server, and draw.
Window Manager - A special type of an X Client, this piece of software provides the ability to control the windows on your screen. It often draws window decorations (minimize, maximize buttons), sometimes draws a taskbar, etc.
You are free to mix and match them entirely as you please. Simpler, minimalisting window managers, such as my ratpoison which I prefer for many prototype embedded systems only have the notion of fullscreen windows, and can switch between fullscreen apps (think Windows 8 Metro). Others draw window decorations, and allow overlapping and cascading windows.
Since developing a Window Manager is a simple and modular task, there are literally hundreds to chose from. You also can choose not to use one at all, at which point your windows have to self-manage (you'll not be able to move them around by default). Many applications respect the -geometry 1920x1080+0+0 parameter, telling them to open a window in 1920x1080 resolution at the 0,0 corner - effectively fullscreen.

Access to a monitor not containing the desktop

On a computer with multiple monitors where the desktop is not shown on one of them, is there any way to draw on that monitor from a program?
Reasoning: I need to display a variable image full-screen on a separate monitor, without the user being able to disturb the screen with the mouse or without being able to shift windows on top of my image. Example: a computer has one monitor and one projector connected; the monitor shows a "normal" desktop and the projector shows the generated image (say, a color gradient).
The first use would be on Win7, but if a portable solution exists, an X11 solution under Linux would also be nice.
On Linux this is easy using xvfb, a virtual framebuffer. The command is:
Xvfb :1 -screen 0 1600x1200x32
You can run programs on the virtual screen by setting the environment variable DISPLAY=:1
The best part is the user doesn't even have to worry about interfering with the mouse or keyboard. Very useful for testing.
Under Linux, you can also run a second X session on the extra monitor
Xorg :1 -config /path/to/xorg_1.conf
But you'd need to write a xorg_1.conf configuration file to feed in.

linux qt change monitor refresh frequency

i am using openGL to improve the performance on the target.
i would like to know if there is a way to change monitor refresh frequency (from qt or linux) to match the application.
Qt does not wrap that functionality. You would need to access X directly, via XCB (or Xlib, but XCB is to be preferred) and the XRandR extension.
However, these days refresh rate is typically limited by the output device, as LCD screens often only operate in the 60Hz-75Hz range.

Resources