You are not logged in.

#1 2016-06-01 11:08:56

yuvadm
Member
From: Tel Aviv-Jaffa, Israel
Registered: 2012-08-08
Posts: 102
Website

Boot directly into an X application

I'm setting up an Arch installation that should run unsupervised and whenever it boots up should auto-login as a dummy user and automatically run a specific X application. The entire scenario is similar to so-called "kiosk mode" on other devices.

Can I just setup a systemd service that will launch my X application? Do I need a DM that will auto-login before the systemd target starts? Can I just auto-login the user, use https://wiki.archlinux.org/index.php/Sy … ay_manager and stick my X executable in .xinitrc?

Curious what approaches I can use here.

Last edited by yuvadm (2016-06-01 11:13:09)

Offline

#2 2016-06-01 14:04:40

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,364

Re: Boot directly into an X application

I would run startx from your one of your Bash startup files.
Your ~/.xinitrc would pass control to your program, without a window manager, by using exec theNameOfYourProgram
When your program exits, you will fall back to the login shell.  You can make your ~/.xinitrc restart it if you need to.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2016-06-01 14:25:31

yuvadm
Member
From: Tel Aviv-Jaffa, Israel
Registered: 2012-08-08
Posts: 102
Website

Re: Boot directly into an X application

ewaller wrote:

I would run startx from your one of your Bash startup files.

Which file would that be? IIUC .bashrc or .bash_profile won't actually run unless the user actively logs in.

Offline

#4 2016-06-01 14:37:36

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: Boot directly into an X application

autologin: https://wiki.archlinux.org/index.php/Au … al_console

then startx at login: https://wiki.archlinux.org/index.php/Xi … X_at_login

.bash_profile is parsed when the user logs in, even if the login is automatic.

Then, as ewaller says, add the program you want to start to .xinitrc.

Offline

#5 2016-06-01 14:43:36

yuvadm
Member
From: Tel Aviv-Jaffa, Israel
Registered: 2012-08-08
Posts: 102
Website

Re: Boot directly into an X application

Sounds like a rather simple approach, will give it a shot. Thanks!

Offline

#6 2016-06-01 14:43:50

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,364

Re: Boot directly into an X application

Thanks 2ManyDogs, I missed the auto login step.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2016-06-01 19:05:43

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,839
Website

Re: Boot directly into an X application

My preferred approach is to simply place this line in ~/.bash_profile (with autologin enabled):

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx /usr/bin/foo

No need for ~/.xinitrc then wink


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB