Hello ArchLinux Community!
A friend and I have started a project to create a custom UI. Our goal is to launch a custom UI at startup and be as streamlined as possible. Our first steps was to install a base install of ArchLinux with an X Server. (We initially tried to use Wayland, but that epically failed...(couldn't get that working for the life of me, although it would be awesome if we could, to test out)).
We are currently writing code using C++ and libraries like SDL and OpenGL to write our UI application. We want the UI to be launched when the computer is turned on, so I'm thinking we can just write a .service file for systemd to handle launching X and our program before any login occurs. (I'm currently trying to figure out how all the systemd stuff works, but that's not really a concern at the moment.) We're not sure if programming with these libraries are what we should be doing, but it's just something we are someone familiar with. We are open to better solutions if you can suggest one.
It's our first time dabbling in so much linux and without a desktop environment(or any type of windows manager) to run application off of. I would like to know if you guys think we are going about the problem the right way, or should we change our methods before we dig ourselves in too deep. Please offer your suggestions and comments. They are greatly appreciated.
I think you need to be more specific in what you mean by UI. I am assuming you are talking about writing your own window manager, but it is not totally clear from your post. If that is indeed the case, I am not sure why you think it would be different from starting any other window manager "when the computer is turned on".
Can you elaborate a bit more?
Think Kiosk interface... Big buttons, very graphically and user-friendly for a touchscreen (not that we are using touchscreens or anything).
The way we are going about it, we will have no windows(or just one window if you count the main application) that will take up the entirety of the screen all the time. From my understanding, window managers are usually started after login... but we want to start the application before login (which, I guess would be more similar to a display manager :-P ). Please correct me if I'm wrong.
Does that clarify things?
What does this UI you have in mind, have to do?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
I don't know what all the talk of "logging in" is. There has to be a log in - it could be automatic, and it could be to the root account, but some account will be "logged in".
You say window managers are started after login - but so is X, but you say you want to use X.
Pardon me for saying it, but it doesn't sound like you are remotely qualified for doing what you say you want to do. I'm all for helping people learn, but learn to walk before you run.
If you are going to dive into this, forget all the loggin in crap, and just write the UI. I recently wrote something that sounds like what you are describing - it was about a 50 line "window manager" that just put some 'buttons' (Just rectangles with text) on the root window. Then it watched for button presses, and ran the appropriate commands when those buttons were clicked.
This was for an idiot proof implementation of a hardware/software package I had put together for a specific use. The users were not going to be up to speed on how to log in, run programs, etc - so all they had to do was hit the power button, wait for the buttons to show up, then click the appropriate one for the task that day.
All that is needed for this is Xlib. You can also see tinyWM as a great example to start with.
Last edited by Trilby (2013-03-17 17:37:19)
@Unia - Currently, we only need it to display information both graphically and using audio to the user. It will pulling data from online and elsewhere to show the user. It will most likely take in mouse and keyboard input to interact with the user. In the future, I could see the UI launching other full screen applications... in which case, we may need some kind of windows manager... We may also try some kind of touchscreen as most kiosks do.
@Trilby - Thanks for your input! When I was talking about logging in, I was generally thinking about a regular interactive login. I agree that I may not be totally experienced in this field, but I wasn't expecting to know much starting out. This project is something a friend and I thought would be cool to do, so we are starting out with what we know (C++, SDL, OpenGL,...).
The project that you're describing does some very similar to what we are doing. I'm not too familiar with Xlib, but the general process(from a quick googling) seems very similar to what we have been doing in C++ already. ;-) I'll look into Xlib and tinyWM some more and start getting familiarized with them. I'm not sure if it's a better than what we have going right now(C++, SDL...), but I'll try drafting something up to compare results. Thanks again!
If anyone else has suggestions, please share them! It's our first time creating something like this and I don't expect it to be super easy, but I'm sure it will be a fun adventure to explore, create, and learn!
if no windowmanagement is needed is'nt the easiest solution write a regular graphical program and start it with <exec foo> in .xinitrc as usual? As long it not have any pop up window and stuff it should work?
Yeah, if it's running in kiosk mode, you won't need a window manager. You can either start the application via .xinitrc or via Systemd directly; it shouldn't make much of a difference. You will need it to run under a user, particularly a user with not many permissions. True, the user will just be running your program in kiosk mode but better safe than sorry.
As for what to use, use what you know. As problems arise, you'll seek out new solutions and learn in the process. If you try to dump everything you know in favor of something someone tells you on the internet is better, your process and motivation will halt. I think SDL should be fine. Another option would be Clutter, which I find to be pretty intuitive.