You are not logged in.

#1 2022-02-07 16:10:02

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Discord doesn't open links with startx, but does with LightDM

Hi,

Discord refuses to open any links whatsoever, no prompt, no web browser, no error, everything seems ok, but links just won't open.

I am using bspwm.
As mentioned xdg-utils package is installed.
I made sure that xdg-open works fine and double-checked and set my default web browser with xdg-settings. Also tried another browser, nothing helped.
I tried the arch-electron version of Discord from AUR but no luck there.
I enabled and checked the developer tools console for errors or some hints but again no luck.

Sometimes it works when I run discord from the terminal like this: "strace discord", but it is really strange because like I said only sometimes, I've been starting and quitting discord like a madman, I have no idea what's going on, nothing suspicious in journalctl output.

I do not know what to do anymore, it is extremely annoying.
It used to work just fine for a long time, I'm clueless as to what caused or is still causing this behavior.

Thanks for any suggestions.

Last edited by Filip62 (2022-02-27 13:20:27)

Offline

#2 2022-02-07 16:44:01

ishaanbhimwal
Member
Registered: 2022-01-21
Posts: 48
Website

Re: Discord doesn't open links with startx, but does with LightDM

Try running the following:

xdg-mime default firefox.desktop x-scheme-handler/http
xdg-mime default firefox.desktop x-scheme-handler/https

Also there was a similar issue of discord crashing due to absence of a notification daemon.

Offline

#3 2022-02-07 18:53:45

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

Thank you, but it didn't help.

Btw, yeah I also faced the issue of discord crashing/freezing without a notification daemon running but I fixed that a long time ago.

Last edited by Filip62 (2022-02-07 19:01:53)

Offline

#4 2022-02-25 08:24:31

vetu104
Member
Registered: 2018-07-02
Posts: 4

Re: Discord doesn't open links with startx, but does with LightDM

I also have this issue.

Links in Discord do open if firefox was already running. If firefox was not running, clicking a link spawns the xdg-open and firefox processes, but doesn't create a firefox window. In this state, it is also impossible to launch firefox at all until both those processes are killed.

This behaviour happens if X was launched via startx, but everything works as expected if I use LightDM instead. So I'm guessing there's something wrong with my session setup with xinit?

$ 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 some nice 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

[ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile
export XDG_SESSION_TYPE=x11
export XDG_CURRENT_DESTOP=i3
exec i3

Offline

#5 2022-02-25 13:24:22

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

I think we do have the same problem.

I also just use startx, altough Discord was opening links a few months/weeks ago only with startx.

I didn't notice the spawned processes before. But they indeed appear. https://imgur.com/a/FhBi4kD

Offline

#6 2022-02-25 13:46:01

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

Running

 sh /usr/bin/xdg-open https://archlinux.org 

in the terminal works without a problem though.

Last edited by Filip62 (2022-02-25 13:46:17)

Offline

#7 2022-02-27 12:56:22

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

You are right, Discord does indeed open links when I use LightDM.

I am not sure what causes this behavior. I replaced my

.xinitrc

contents with the contents of

/etc/lightdm/Xsession

(changing the exec line of course), but that did not fix the issue.

Offline

#8 2022-02-27 15:10:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,309

Re: Discord doesn't open links with startx, but does with LightDM

Post your previous xinitrc, try "xinit" instead of "startx" and compare the outputs of "printenv" for the session started w/ xinit and the one started by lightdm - notably $DBUS_SESSION_BUS_ADDRESS

Online

#9 2022-02-27 15:31:15

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

My previous .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 some nice 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

[ -e $HOME/.profile ] && . $HOME/.profile

exec bspwm

Xinit did not help, same results.

Xinit env https://termbin.com/2lnj
LightDM env https://termbin.com/zifr

$DBUS_SESSION_BUS_ADDRESS looks the same.

Offline

#10 2022-02-27 15:50:12

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,309

Re: Discord doesn't open links with startx, but does with LightDM

There're some $PATH differences but they don't look significant enough (double entries, slightly changed order, cargo-crap)
Leaves interesting

+DESKTOP_SESSION=bspwm
+XDG_SESSION_DESKTOP=bspwm
-XDG_SESSION_TYPE=tty
+XDG_SESSION_TYPE=x11
+XAUTHORITY=/home/filip/.Xauthority
+XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0

My money is on the first two, I don't think it's the authority location (check "xauth info"), XDG_SEAT_PATH would be weird and XDG_SESSION_TYPE really really dumb.
Try to export the relevant variables to discord (or for DESKTOP_SESSION=bspwm & XDG_SESSION_DESKTOP=bspwm: the session) and see what happens…

Online

#11 2022-02-27 16:49:02

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

I am sorry, I'm not sure I understand what you mean by:

seth wrote:

(or for DESKTOP_SESSION=bspwm & XDG_SESSION_DESKTOP=bspwm: the session)

but I have the same results with this:

env DESKTOP_SESSION=bspwm XDG_SESSION_DESKTOP=bspwm XDG_SESSION_TYPE=x11 XAUTHORITY=/home/filip/.Xauthority XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 discord

Offline

#12 2022-02-27 17:04:42

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,309

Re: Discord doesn't open links with startx, but does with LightDM

Export the two in your xinitrc as we don't know which element of the IPC would test them (if that's the problem)

Online

#13 2022-02-27 17:44:32

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

So I did this:

seth wrote:

Export the two in your xinitrc as we don't know which element of the IPC would test them (if that's the problem)

and the result was same still.

I even tried exporting them before running xinit, and another try was right before I exec bspwm.

Also didn't help.

Offline

#14 2022-04-20 16:18:31

LunarLambda
Member
Registered: 2021-08-02
Posts: 50

Re: Discord doesn't open links with startx, but does with LightDM

Been having the exact same issue for months too now. Any new ideas?

Offline

#15 2022-04-20 18:39:05

Filip62
Member
From: Slovakia
Registered: 2020-10-24
Posts: 36

Re: Discord doesn't open links with startx, but does with LightDM

Unfortunately, no. I've started using LightDM.

Offline

#16 2022-05-06 23:09:37

Fazzi
Member
Registered: 2021-12-11
Posts: 10

Re: Discord doesn't open links with startx, but does with LightDM

This issue is happening with me too sadly. It's really annoying, but installing a display manager doesn't exactly fix the underlying issue. I would like to use xinit, and I'm not ready to give it up so quickly.

Offline

#17 2022-05-07 06:26:29

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,309

Re: Discord doesn't open links with startx, but does with LightDM

If firefox was not running, clicking a link spawns the xdg-open and firefox processes, but doesn't create a firefox window. In this state, it is also impossible to launch firefox at all until both those processes are killed.

Running
sh /usr/bin/xdg-open https://archlinux.org
in the terminal works without a problem though.


There's going to be somehting™ relevant in your shell rc (bashrc, zshrc) that you do get from the interactive shell and lightdm (which iirc uses your shell to login) but not xinit.
Replacing the shebang in ~/.xinitrc will NOT help, but you could compare

tr '\0' '\n' < /proc/$(pidof i3)/environ

With

printenv

in the interactive shell.

Online

#18 2022-09-03 04:31:55

vetu104
Member
Registered: 2018-07-02
Posts: 4

Re: Discord doesn't open links with startx, but does with LightDM

This behaviour has changed a bit, now the firefox window does open, but in an unusable state. Doesn't render contents and doesn't respond to inputs. I was thinking if discord depends on the systemd-logind session type to be something else than "tty"?

loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}')

As far as I know, this cannot be changed if startx is used. It is set to "x11" when a display manager is used instead.

Offline

#19 2022-09-03 06:34:30

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,309

Online

#20 2022-10-08 15:10:08

Phlimy
Member
Registered: 2021-03-03
Posts: 1

Re: Discord doesn't open links with startx, but does with LightDM

vetu104 wrote:

This behaviour has changed a bit, now the firefox window does open, but in an unusable state. Doesn't render contents and doesn't respond to inputs.

Same problem here.

I have applied the patched mentioned there. Indeed it set my logind session type as "x11" while using startx (as per `loginctl show-session 1`), however the issue persists. So that's probably not the cause.

I don't want to use a display manager just for this issue hmm

Offline

#21 2022-10-08 15:43:45

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,309

Re: Discord doesn't open links with startx, but does with LightDM

https://bbs.archlinux.org/viewtopic.php … 3#p2024683

The most common cause of "I use startx and my session is weird" is actually the missing logind integration in your xinitrc.

Online

#22 2023-04-19 09:10:03

vetu104
Member
Registered: 2018-07-02
Posts: 4

Re: Discord doesn't open links with startx, but does with LightDM

https://bbs.archlinux.org/viewtopic.php?id=284906

In that thread they concluded that this was a bug in firefox and will be fixed in version 114. I've fixed it in the meanwhile by redirecting stdout and stderr to a file in my .xinitrc.

[ -f ~/.local/share/xorg/stdout ] && mv ~/.local/share/xorg/stdout ~/.local/share/xorg/stdout.old
[ -f ~/.local/share/xorg/stderr ] && mv ~/.local/share/xorg/stderr ~/.local/share/xorg/stderr.old

exec awesome 1>~/.local/share/xorg/stdout 2>~/.local/share/xorg/stderr

Offline

Board footer

Powered by FluxBB