I need to port a screen capture utility to Linux.
I'm not familiar with Linux. On Windows, you can get the handle of a specific window or desktop and using BitBlt in Win32 API, you can copy the image and save it to a BMP file or even convert it to Jpeg format.
On Linux, as far as I know there are different desktop environments like KDE. Which should I target for development? Or which distribution? And also, which development environment do you suggest? I do programming in C/C++.
Using Xlib to talk to the X server works the same way regardless of your desktop environment. Retrieve a list of windows from the server, work out which one you want and hence its position and size, and use XGetImage to retrieve the image data.
IDEs are a matter of taste; there are many suggestions here.
Related
I have some question about linux desktop environment.
How linux shows its desktop environment on a screen. I mean where and how its GUI frames generates and send to lcd driver? is it at kernel level? does it have any relation to frame buffer (such fb0)?
Is it possible to access the Desktop GUI of linux and write it on frame buffer to show the window environment of linux?
I have searched a lot but did not find my main answer that how linux Desktop Environment is created and shown by monitor that have been known by drivers on linux.
thank you for your attention.
In Linux there's no internal desktop or anything like that. desktop environments are just regular applications just like other applications. almost all desktop environments at their lowest level interact with another GUI library (e.g Qt, GTK, ...). then all these GUI libraries interact with lower-level software called windowing system or display server or window server.
In Unix systems most used window system is X window system ( simply called as X or X11). almost any GUI library which supports Linux, it works with X.
Wayland is another windowing system which is growing and is supposed to be a good replacement for X, because X window system is too old and have many issues. but X is used almost everywhere in Linux and other Unix based operating systems.
So if you really want to know what's going on down there, you should know linux graphics stack. as i said desktop environments are just high level applications. from windowing system (like X) to lower-level libraries and modules (KMS, DRM, ...), are what you really looking for.
KMS (kernel mode setting) works with display controller and DRM (direct rendering manager) works with graphics card and GPU. (however it's really not as simple as i explained)
I want to make a system which would get input from USB barcode scanner, validate it on remote server and display an answer (text and images).
I would use JavaFX or in-browser JS web application to grab scanner input somehow.
I'm planning to run this application on Raspberry Pi or plain PC.
Is there a way (or a special linux distribution) to ensure that system always loads the same way and starts JavaFX app or opens particular web page in browser?
e.g. no login page, NO update or other popups are shown.
Any other ideas? Thanks
...
Found an interesting solution here, where JavaFX GUI app is started from command line, without X-Server(linux graphical interface) at all.
I have recently done something similar, and it's not too hard. Obviously working on the Pi, you will want to use something like Linux and having limited hardware will mean that you should be minimising what you are running. Due to this, I would recomend that you run a light weight distro. Something like arch (which is what I used) allows you to build only what you want from the ground up without the need to find and compile everything like you do for LFS or Gentoo.
As for booting, the following two wikis will give you the details of starting the Gui without manual login:
https://wiki.archlinux.org/index.php/Automatic_login_to_virtual_console
https://wiki.archlinux.org/index.php/Start_X_at_Login
After that, it is simply a matter of putting the command to launch your program in .xinitrc.
This is one of my coding projects. I'm fairly new to linux, so I need some pointers and thoughts from you guys, before I get started. I know there exists screen sharing software already, but I want to make my own! (=
Specifically, I want to clone my laptop screen to my TV over WLAN, via a linux box that is connected to a TV through a VGA cable:
Laptop streams it's screen
Linux box reads the stream
Linux box outputs the stream into the TV (through a VGA cable)
First of all, how do I record the screen and send the stream in real time in linux?
Secondly I must write a program that reads the stream being sent. The program must listen to some port, and collect the data being streamed from the laptop. Any thoughts?
Then I must output that data in real time to the TV. Do you how any ideas on how to solve this?
Thanks!
Edit: Regarding programming languages, I'm most comfortable with python.
Sharing your screen can be done via the various flavors of VNC (ie. RealVNC, TightVNC, UltraVNC, etc.). Most of them are Open Source, you might want to:
Stick with the VNC protocol for later compatibility
Take example of how the established solutions does for screen-hooking.
In Linux, the graphics are all processed by Xorg (new version of X Server), which was developed with networking embedded. This explains why you can ssh -X into a machine, execute a graphical interface on it and see it on your remote computer. I recommend you to read about hooks on Xorg to achieve your needs.
You need a client-server topology to achieve your needs. You are not talking about any programming language you forecast to use, though. Some languages may be harder than some to start with. Furthermore, this kind of code is already really well understood under every major programming language. You should try to at least use a framework that simplifies your networking portion of the project.
Sharing a screen on the TV can be done by your video card driver in Linux. Just check on your Desktop Environment (KDE and Gnome offers video configuration panels, for example) or in your video card configuration (nVidia and ATI Linux drivers offers multiple screen support)
It seems to me like you're trying to reinvent the wheel and are not too sure about how to begin. I recommend you to begin simple with one of the already proven VNC software and see how it goes from there. If a feature is missing, you've got the source code of the server and the client, so you can continue development of these projects. Once you've got your setup working, start thinking about replacing a single piece of the puzzle by your own code, and see how it goes.
Do not expect good (full HD, for instance) video quality on your TV without some very capable CPU/GPU and a 802.11n wireless network empty of users and be ready to accept some lag for the codecs to kick in.
You should try to take as small steps as possible. If I were taking up such a project, my first step would be to try to implement a solution using standard unix tools (e.g. netcat or socat for the network part, mplayer or vlc for the playback and maybe ffmpeg for the capture)? Then, replace each component with custom-written ones if needed.
I'm looking for a really really small linux distribution or process of making my own that's sole purpose is to get an air application to launch full screen and stay there; Essentially I'm building a home kitchen computer that runs entirely as an AIR app.
I have looked into using windows xp; and windows xp embedded but they pose so many issues I figured I'd try modern linux.
I have also seen TinyCore Linux which looks interestingly small but not sure what issues that poses in regards to running AIR and "hardware" accelerated display. I've also thought about stripping down an Ubuntu installation but I'm sure somebody must have done this already; google is just failing me right now...
I'm also interested in running an "embedded" version of say android and running the air app on some arm-based hardware again; with just the AIR runtimes only - although this is less preferred as it's more complex.
I'm also hooking this up to a touch screen monitor (not yet arrived) so I'll need to hunt down or write some drivers for translating the touch events into something AIR can understand... (this was my main intention for using windows in that all the drivers will just work).
What I'm after
Minified Linux kernel with JUST the drivers for the box I need
X Display with accelerated graphics support (Doesn't have to be X if AIR can run on a frame buffer?)
Running a Full screen AIR application (simple enough)
Ability to write back to the filesystem (enough support for AIR)
SSH Access for remote control
Samba for updating the filesystem (easier to maintain the system)
Touch screen support (3M Ex III I think...)
Audio support
Don't need
Don't need any window manager or any other GUI tools unless required by AIR
Don't need any toolbars or file managers or anything; The AIR app is the "OS"
Don't need any package managers or repos
Don't need multi user or logging in; everything can just run as an unprivileged account
Don't need to
I don't mind hand crafting the filesystem and configs if that makes it easier; I'm mainly looking for a "filesystem" that is as tiny as possible that I can just plop my AIR app into and write some scripts to get it to start when the X server starts
Thanks,
Chris
Try an embedded Linux build system such as Buildroot. It can build an entire system from source, and be very lightweight. The basic system is less than 1 MB in size.
Ended up going with Tiny Core. Very tiny and quick to boot up. You can also write extensions for it and you don't have a persistent drive which allows you to just switch the thing off without worry that it's going to break something -- exactly what you need in a kitchen :-D.
My current plan is to:
Just set up a working version using Ubuntu as this is mostly supported by Adobe
Slowly strip it back and try and get as little things to start as possible on boot
Try building my own distro/package from source and selecting only the packages I need
Compile my own kernel with nearly everything turned off and just leave on the things I need
Have 4 DVI output. Seems I hopefully will have driver support on this. Details are sketchy online about supporting 4 outputs, but seems possible.
My question is from the Linux group and Virtualbox pros.... Will the seamless method of VirtualBox allow me to use all 3 of my monitors for multiscreen. I'd like to stick with Ubuntu and run Visual C# and other tools from my VirtualBox. Compiz effects are just too amazing to want Aero Glass.
What do you think, will my system be able to use the multiple monitors with VirtualBox and this graphics card? I've googled for hours and am still searching for answers.
Edit:
I tried virtualbox last night. Pretty slick, though I had an error in installing Visual C#NET. However, it wouldn't let you drag between multiple screens??? Is this something the host must resolve, or does the guest session need to have special settings for multiple monitors? Haven't been able to find anything in google supporting multiple monitors with virtualbox.
You should be able to configure your screens just fine. Don't know the exact details for an ATI setup, but you should be able to use Xinerama to create a single large virtual desktop, and then just run VirtualBox (though honestly, I prefer KVM, which runs on modern CPUs which provide native virtualization support) full-screen on one of those monitors. You would then be able to have three screens dedicated to Ubuntu, and the forth dedicated to Windows.
You might want to look into the non-Xinerama method of multiple displays. Each display is then treated as its own screen (so you'd have :0.0, :0.1, :0.2, and :0.3 for your X displays). You cannot move applications between the screens, but you get four independent desktops. I personally find that more useful than the idea of a single stretched desktop over multiple displays; when I used a laptop as my primary system, that's what I did, and when I get a second monitor for my computer, I'll likely return to that means of doing things. You'll have to investigate the specifics for such a setup with ATI, but the X server supports it, so it's just a matter of looking at your ATI driver's documentation to put the pieces together.