You are not logged in.

#1 2021-02-15 21:00:34

therimalaya
Member
Registered: 2019-04-11
Posts: 2

SSH problem, I think it is startx in my zshrc

When I tried to connect to Arch system through ssh, it shows me error like,

/usr/lib/Xorg.wrap: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console.

But never wanted to start X-server from remote. Since I am using xinitrc to start my i3, I think the problem is in my zshrc file from where I have tried to start.

My xinitrc where I am starting i3,

xrandr --output HDMI-0 --right-of DP-0 &
feh --no-fehbg --bg-fill --randomize '$HOME/.local/share/wallpapers' &
setxkbmap -layout no -option caps:escape &
exec picom -CG --no-fading-openclose --xrender-sync-fence &
exec i3

My .zshrc where I have am running startx,

if [[ -z $DISPLAY ]] && [[ $(tty)=/dev/tty2 ]]; then
	startx $HOME/.config/X11/xinitrc
fi

I think the problem is I am calling startx in zshrc which is also used when I access the system using ssh.

Is there any way I can startx automatically after login without using zshrc? OR is there some way out to my problem?

Offline

#2 2021-02-15 21:33:51

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: SSH problem, I think it is startx in my zshrc

.zprofile is probably more appropriate. The Wiki currently recommends something like this:

if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
  exec startx
fi

Offline

#3 2021-02-15 22:48:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: SSH problem, I think it is startx in my zshrc

.zshrc is read every time you start a shell. You don't want startx in the file. Use, as tucuxi, suggests .zprofile.

Also, read the xinitrc wiki page, yours is incomplete.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB