You are not logged in.
Hello,
I am trying to run startx automatically after login (via tty). I followed the wiki at
https://wiki.archlinux.org/index.php/Xi … X_at_login
however startx is not being run upon login. Any ideas?
Edit: I should clarify, running the snippet that I have in .zlogin (also tried .zprofile) in the tty does in fact start the WM as expected.
echo $SHELL
/bin/zsh
cat ~/.zlogin
( => Update: .zlogin should not be used for this, use .zprofile instead,
see https://wiki.archlinux.org/index.php/Zs … down_files)
# Autostart X using startx after tty login.
if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VNTR -eq 1 ]]; then
exec startx
fi
cat ~/.xinitrc
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start any globally installed programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# start userspace background programs
xbindkeys & # allow custom keybindings in the X session
udiskie & # allow automatic mounting of portable drives
# set the desktop background
~/.fehbg & # restores wallpaper last set by feh
# start the window manager
exec /usr/bin/i3
Last edited by adigitoleo (2020-08-05 11:29:30)
Offline
Two ideas:
If ZROOTDIR is set, make sure that .zlogin is in that directory.
pacman -Q xorg-xinit
Offline
Ok so I verified that xorg-xinit is installed:
pacman -Q xorg-xinit
xorg-xinit 1.4.1-2
Haven't heard of ZROOTDIR before, but echo $ZROOTDIR gives nothing...
Well, I'll keep searching. Meanwhile doing startx by hand isn't all that bad. Might try if it works using bash...
Offline
Either remove the graphical target check or ensure you've actually enabled graphical target as the boot up goal: https://wiki.archlinux.org/index.php/Sy … _boot_into
Offline
Hmm, so I think the target is correct, I don't have any kernel params that set other targets, also
systemctl get-default
graphical.target
Also tried removing that check just in case, still stays in the tty.
Offline
I feel like I'm missing something obvious. I should mention that I also set up automatic login to the tty (only username not password) through getty as per:
https://wiki.archlinux.org/index.php/Ge … al_console
https://wiki.archlinux.org/index.php/Ge … sole_login
Edit: corrected link
Last edited by adigitoleo (2020-08-05 10:58:02)
Offline
OK so the wiki here:
https://wiki.archlinux.org/index.php/Zs … down_files
says that .zlogin should not be used to start graphical sessions, so I'll move back to .zprofile for startx. I do not have ZDOTDIR set, but it says that HOME is used as a fallback.
Update: tried .zprofile without the graphical target check, still no luck.
Last edited by adigitoleo (2020-08-05 11:13:49)
Offline
remove the graphical target check
Offline
Oh shoot, sorry I missed that post. The following conditional that you suggested over there works perfectly:
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
Sure it only works from tty1, but so does my autologin now that I think about it.
Cheers, closing.
Offline