Difference between revisions of "Talk:Xinit"

From ArchWiki
Jump to: navigation, search
(/etc/profile.d/locale.sh: Close)
(.xinitrc redirection: new section)
 
Line 56: Line 56:
 
::Thanks Lahwaacz. But (a) so the age of a file is based on it's creation time, not update time. OK, i did not know that. (b) about the startx exit code, i am not sure that it will correctly set if i edit something wrong in ~/.xinitrc which make GUI session crash
 
::Thanks Lahwaacz. But (a) so the age of a file is based on it's creation time, not update time. OK, i did not know that. (b) about the startx exit code, i am not sure that it will correctly set if i edit something wrong in ~/.xinitrc which make GUI session crash
 
::: I just tried to change the resolution of X (xrandr...) and ~/.local/share/xorg/Xorg.0.log updated and get the new timestamp [[User:Triplc|Triplc]] ([[User talk:Triplc|talk]]) 21:36, 20 April 2016 (UTC)
 
::: I just tried to change the resolution of X (xrandr...) and ~/.local/share/xorg/Xorg.0.log updated and get the new timestamp [[User:Triplc|Triplc]] ([[User talk:Triplc|talk]]) 21:36, 20 April 2016 (UTC)
 +
 +
== .xinitrc redirection ==
 +
 +
Currently it point to [[Xinit]]. It would be better if the link pointed to the section related to it, [[Xinit#xinitrc]]. --[[User:AlonsoLP|AlonsoLP]] ([[User talk:AlonsoLP|talk]]) 09:10, 14 October 2018 (UTC)

Latest revision as of 09:10, 14 October 2018

Running "Notes" Section

The two sets of notes at the bottom of xinitrc#Configuration should be condensed in some way. The first five bullet points all concern which tty X is running on. I could create this as its own subsection, and contain the information there, though I am not entirely convinced that this is necessary/appropriate/needed on this page at all. Would it be more appropriate to merge the relevant sections into the Xorg article, perhaps? Pid1 (talk) 00:30, 26 July 2015 (UTC)

First of all, the first 4 points are inaccurate. Back in 2013, this was indeed handled by the default /etc/X11/xinit/xserverrc, which contained
#!/bin/sh
if [ -z "$XDG_VTNR" ]; then
  exec /usr/bin/X -nolisten tcp "$@"
else
  exec /usr/bin/X -nolisten tcp "$@" vt$XDG_VTNR
fi
Now it contains only
#!/bin/sh
exec /usr/bin/X -nolisten tcp "$@"
This will be more work than it seemed, we should investigate... Nevertheless, startx handles the vt parameter, but plain xinit doesn't, so I'd say the note is perfectly suitable for this page.
-- Lahwaacz (talk) 08:17, 26 July 2015 (UTC)
Thanks for the insights. I will cross-reference the documentation with what is provided here, and update accordingly. Pid1 (talk) 13:01, 26 July 2015 (UTC)
I've split this off into a new Running section. I think this section should be split into startx and xinit subsections and explain the details of using xinit in a way that is not a block of notes Ziusudra (talk) 00:19, 11 February 2016 (UTC)

propose to add to automatic startx

When combine automatic startx + automatic login to console, it may come to infinite loop/crash if (a) ~/.xinitrc goes wrong somewhere, after editing; or (b) after pacman -Syyu and Xorg crash. I propose to check if the last GUI session (startx session) really last long before start a new one.

if [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then
	if [[ -f /tmp/login-check-startx.flag ]]; then
		rm /tmp/login-check-startx.flag
		echo -e "\nFile '/tmp/login-check-startx.flag' found, maybe the last GUI session did not last long!\n"
		## do nothing, start automatic console login
	else
		touch /tmp/login-check-startx.flag
		( sleep 120; rm /tmp/login-check-startx.flag ) &
		exec startx
	fi
fi
## Change '/tmp/login-check-startx.flag' to '$HOME/login-check-startx.flag' if you want that check also valid after reboot.

Triplc (talk) 20:42, 20 April 2016 (UTC)

You might do that without the temporary file by simply looking at the age of the log file:
if [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then
	if [[ ! -e ~/.local/share/xorg/Xorg.0.log || $(find ~/.local/share/xorg/Xorg.0.log -mmin +2) != "" ]]; then
		exec startx
	fi
fi
Or even more simply, don't exec startx, check its return code and drop to interactive shell on errors:
if [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then
	startx && exit
fi
-- Lahwaacz (talk) 21:10, 20 April 2016 (UTC)
Thanks Lahwaacz. But (a) so the age of a file is based on it's creation time, not update time. OK, i did not know that. (b) about the startx exit code, i am not sure that it will correctly set if i edit something wrong in ~/.xinitrc which make GUI session crash
I just tried to change the resolution of X (xrandr...) and ~/.local/share/xorg/Xorg.0.log updated and get the new timestamp Triplc (talk) 21:36, 20 April 2016 (UTC)

.xinitrc redirection

Currently it point to Xinit. It would be better if the link pointed to the section related to it, Xinit#xinitrc. --AlonsoLP (talk) 09:10, 14 October 2018 (UTC)