You are not logged in.

#1 2013-03-17 16:32:35

geeksquads
Member
Registered: 2013-03-17
Posts: 3

What's the best way to make a custom UI?

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.

Thanks!

Offline

#2 2013-03-17 16:36:02

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: What's the best way to make a custom UI?

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?

Offline

#3 2013-03-17 17:25:18

geeksquads
Member
Registered: 2013-03-17
Posts: 3

Re: What's the best way to make a custom UI?

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?

Offline

#4 2013-03-17 17:27:20

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,471
Website

Re: What's the best way to make a custom UI?

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

Offline

#5 2013-03-17 17:33:44

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: What's the best way to make a custom UI?

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)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#6 2013-03-17 18:21:16

geeksquads
Member
Registered: 2013-03-17
Posts: 3

Re: What's the best way to make a custom UI?

@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! smile

Offline

#7 2013-03-18 01:47:23

Odaer
Member
Registered: 2010-08-14
Posts: 87

Re: What's the best way to make a custom UI?

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?

Offline

#8 2013-03-18 08:01:32

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,033

Re: What's the best way to make a custom UI?

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.

Offline

#9 2013-03-18 10:58:53

Awebb
Member
Registered: 2010-05-06
Posts: 4,346

Re: What's the best way to make a custom UI?

Have a look how it's done in XBMC, that sounds close to what you guys want to do.

Online

Board footer

Powered by FluxBB