You are not logged in.
I would like to know how to start an x11 session from the command line and then immediately run a program within that x11 session. Specifically, I would like to do something along the lines of
# startx; steam steam://open/bigpicture
but obviously, the semi-colon doesn't proceed to the next task until the current task is done so it doesn't execute "steam steam://open/bigpicture" until the X11 session is closed, causing steam to crash. I have also tried replacing the semi-colon with an "&" which I believe should hypothetically execute the second command without waiting for the first to be ended, but this also causes a problem because I believe the commands are being executed simultaneously.
# startx & steam steam://open/bigpicture
Hypothetically, I would like to create a bash file that executes the command so that I can start steam directly from the command line. I would also like to make sure that you know that this is ambiguous in regards to the program being run as I would also like to execute programs such as chromium in the same fashion.
I am running arch linux 3.6.11-1
I would like to reiterate that I do NOT want to have it run every time. I would like to log in without a graphical interface, then start a program in a X11 session all in one line of code rather than starting an X session then having to type into terminal which program I would like to run. I do not have a WM or DE installed other than the defaults when you install xorg and I would like to keep it that way.
EDIT: I have posted this as solved. I have followed what you guys have posted here and it now works perfectly for what I am trying to do. Thank you.
Last edited by fallencx (2013-01-13 23:39:56)
Offline
Is the idea to run each programme in a separate X session?
Or do you only plan to run one at a time?
man startx
man xinitCLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
I've tried using xinit, but it does not open the program. I believe this is because of the lack of window manager when you use xinit as opposed to startx. I would only like to run one program at a time.
Last edited by fallencx (2013-01-13 22:13:29)
Offline
Look at the wiki entry for xinitrc. You can run xinit with an argument, which can be parsed by xinitrc. You can use this argument to specify a program to run when you start your window manager.
https://wiki.archlinux.org/index.php/Xi … mmand_line
https://wiki.archlinux.org/index.php/Xi … e_examples
Last edited by 2ManyDogs (2013-01-13 22:37:45)
Offline
If you add the full path to an X11 app as argument to xinit, then a sole X session is created with ony that app and no wm...
E.g.
xinit /usr/bin/urxvtOffline
mhertz, that's only if you do not have a ~/.xinitrc because the systemwide default xinitrc executes the command line parameters.
Fallencx, you were directed to the right man pages, but then your very next comment indicated that you clearly had not read them. Xinit and startx are not at all different with respect to whether they start a window manager.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Trilby Yes, that is my mistake, I hadn't gotten around to reading the man pages when I posted that
And currently I do not have an ~/.xinitrc nor do I want one at the moment because I am still trying to decide on which window manager I want to use. What mhertz posted is almost exactly what I want to accomplish, the only thing I don't understand is how I pass arguments to the program that am running because steam needs the "steam://open/store" argument to work.
EDIT:
I meant to mention that when I run steam, I don't get any windows that come up.
Last edited by fallencx (2013-01-13 23:26:45)
Offline
And currently I do not have an ~/.xinitrc nor do I want one at the moment because I am still trying to decide on which window manager I want to use.
That is completely irrelevant for whether or not you'd have your own xinitrc. You are already using the system xinitrc. Having your own just allows you to customize it to do what you want. I just helped another user accomplish *exactly* what you are trying to do in another thread. But, hey, if you're sure you don't wan to do it right ...
If you decide you're willing to try doing it right, see here:
https://bbs.archlinux.org/viewtopic.php … 2#p1213962
Last edited by Trilby (2013-01-13 23:40:53)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Trilby thank you for the link on that last post. Very helpful.
Offline