1

I want to set up i3 automatically start on a specific one of my three screens (all connected to one Nvidia card). This has proved more difficult than expected.

  • My first choice was to just set that specific screen (HDMI) to be the main screen via GRUB options. However, it seems that is not possible with proprietary Nvidia drivers, which I need to use. So I gave up on that and only included it here as background. https://forums.developer.nvidia.com/t/can-i-choose-which-monitor-is-primary-as-in-gets-the-tty-login-for-gt710/197021

  • My second choice is to just startx automatically at boot and have it start i3 on the screen of my choice. I have already configured X screens so that I can address my displays like :0.0, 0.1, 0.2.

  • At first I tried to get i3 on the display of my choice by DISPLAY=:0.2 startx, but obviously that doesn't work because the displays have not yet been assigned as X has not yet started.

  • I thought I would try specifying the display by modifying the script that invokes i3, which I expected to be /etc/X11/xinit/xinitrc. However I see nothing about i3 there, or in any of the other places I expected to find it such as /etc/profile or /etc/X11/Xsession. Grepping inside /etc/X11 and my home folder for exec i3 yielded nothing. So where is i3 actually being invoked when I run startx?

  • Next, I tried DISPLAY=:0.2 sudo xinit i3. That opens up i3 on the main display, but with with an xterm window for the i3 process. If I quit this window, i3 closes. So this it wastes screen space on a window that I won't interact with.

So my questions are:

  1. How do I start i3 with a command and have it open with the same result as when I run startx?
  2. Where can I find the command which startx uses to invoke i3?

Solution (but not answer)

I get the desired effect by creating ~/.xinitrc with DISPLAY=0.2 exec i3. However I am still curious how i3 was being invoked before. I would rather have made this change there. And why does i3 need to be started with exec instead of xinit?

3
  • X startup is very flexible, but this can make it complicated to figure out. Do you have a ~/.xsession file? Do you have a ~/.startxrc file? Start with the manual page for startx and look at the files it references. See if /usr/bin/x-session-manager exists and if so does it link to /etc/alternatives. Typically you have a session manager started by startx as the client and it will start your window manager (i3 in your case). Commented Dec 4, 2021 at 0:43
  • @icarus no, I have neither of them. That's what is bothering me. I cannot find theexec i3 command in any of the usual suspects. Commented Dec 4, 2021 at 0:55
  • Perhaps /etc/X11/xinit/xinitrc is looking a var called WINDOWMANAGER which sets it, and it is being set via /etc/profile.d/profile.sh. Commented Dec 4, 2021 at 11:17

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.