开发者

How to start a gtk application after booting up without logging in?

开发者 https://www.devze.com 2022-12-08 19:15 出处:网络
I have got a gtk application. I want it to start automatically when I boot up the system, such that instead of getting usual login screen, my application greets the user.

I have got a gtk application. I want it to start automatically when I boot up the system, such that instead of getting usual login screen, my application greets the user.

My application is a sort of cash dispensing application. So user should not even see the login screen of linux. Whenever machine in boot up, after loading services and all that, my application should appear on the screen. One should not have to put any password or login in anyway to start that application.

Now so far I have tri开发者_开发百科ed the following but all in vain.

I put the command in my /etc/rc.local file /home/EXE/cashier Then rebooted machine in run level 5. But nothing happens. I get the usual login screen. Other programs that do not involve any gui or gtk, they are automatically started in this manner but not the gtk application.

Then I put xint /home/EXE/cahier and later xint /home/EXE/./cashier

But they too didn't work. When I looked into details, I found out that "An Xserver is already running on screen 0, cannot open other server" or something like that.

Then I tried booting into run level 3, this time it worked. xint /home/EXE/.cachier

But in run level 3, the font and icon sizes are smaller. Moreover some windows do not cover the whole screen.

Now I will really appreciate a way to run my application in run level 5, without showing login screen automatically.

Regards

Edit Currently, the application is running on fedora core 2


This is more a question about linux distribution startup than it is about Gtk applications. The specifics are going to depend on your distribution, but the essence is:

  • Disable the gdm facility, which is normally responsible for spawning your X server.

  • Run xinit (not "xint") to start the server manually. This takes a client as its argument. It may work to run your Gtk application directly (it needs to be smart enough to position and size itself instead of relying on a window manager), but more likely you will want to pick a window manager to run it in. The easiest way to do this is via script that you pass to xinit.

0

精彩评论

暂无评论...
验证码 换一张
取 消