You are not logged in.

#1 2020-10-08 16:12:11

kawsar
Member
Registered: 2020-09-22
Posts: 11

[Solved]No protocol specified error when running gui app from terminal

I am running awesome window manager and lightdm.

When running pavucontrol (without sudo I mean as a regular user) I get the following error.

[ka@archlinux ~]$ pavucontrol
No protocol specified
Unable to init server: Could not connect: Connection refused

(pavucontrol:2751): Gtk-WARNING **: 21:53:02.704: cannot open display: :0

Even when I run scrot, the following error shows.

[ka@archlinux ~]$ scrot
No protocol specified
Can't open X display. It *is* running, yeah? [:0]

But when I start awesome with xorg-xinit this error doesn't shows up. As I want to use Lightdm , thus I need a solution.

Last edited by kawsar (2020-10-09 09:27:16)

Offline

#2 2020-10-09 03:49:50

solskog
Member
Registered: 2020-09-05
Posts: 407

Re: [Solved]No protocol specified error when running gui app from terminal

looks like your DISPLAY environment variable wasn't setup for your X terminal emulator. how about this command?

$ DISPLAY=:0 pavucontrol

Offline

#3 2020-10-09 05:38:45

kawsar
Member
Registered: 2020-09-22
Posts: 11

Re: [Solved]No protocol specified error when running gui app from terminal

No it didn't worked.

Last edited by kawsar (2020-10-09 05:47:33)

Offline

#4 2020-10-09 06:00:00

solskog
Member
Registered: 2020-09-05
Posts: 407

Re: [Solved]No protocol specified error when running gui app from terminal

Pls output this command from your X terminal emulator:

# pacman -S pstree
$ pstree -uT 

Offline

#5 2020-10-09 06:04:57

kawsar
Member
Registered: 2020-09-22
Posts: 11

Re: [Solved]No protocol specified error when running gui app from terminal

solskog wrote:

Pls output this command from your X terminal emulator:

# pacman -S pstree
$ pstree -uT 

It seems pstree package doesn't exist.

Offline

#6 2020-10-09 06:06:43

seth
Member
Registered: 2012-09-03
Posts: 50,013

Re: [Solved]No protocol specified error when running gui app from terminal

The client tries to access :0

(pavucontrol:2751): Gtk-WARNING **: 21:53:02.704: cannot open display: :0

but is rejected

Unable to init server: Could not connect: Connection refused

Check the $XAUTHORITY environment as well as  ~/.Xauthority
Possibly also a problem w/ the hostname (output of "hostnamectl"?)

Edit: pstree is in psmisc

Last edited by seth (2020-10-09 06:08:12)

Online

#7 2020-10-09 06:10:20

solskog
Member
Registered: 2020-09-05
Posts: 407

Re: [Solved]No protocol specified error when running gui app from terminal

kawsar wrote:

It seems pstree package doesn't exist.

Sorry, should be psmisc package.

Offline

#8 2020-10-09 06:24:12

kawsar
Member
Registered: 2020-09-22
Posts: 11

Re: [Solved]No protocol specified error when running gui app from terminal

seth wrote:

The client tries to access :0

(pavucontrol:2751): Gtk-WARNING **: 21:53:02.704: cannot open display: :0

but is rejected

Unable to init server: Could not connect: Connection refused

Check the $XAUTHORITY environment as well as  ~/.Xauthority
Possibly also a problem w/ the hostname (output of "hostnamectl"?)

Edit: pstree is in psmisc

These are in my .zshrc.

export XDG_RUNTIME_DIR=/run/user/1000
export XAUTHORITY="XDG_RUNTIME_DIR"/Xauthority

and this line in my /etc/lightdm/lightdm.conf

user-authority-in-system-dir=true
[ka@archlinux ~]$ hostnamectl
   Static hostname: archlinux
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: be3055d227fb46a094ca1c2ca41374cd
           Boot ID: 937964e08cd24a73b4a1314953b52232
  Operating System: Arch Linux
            Kernel: Linux 5.4.69-1-lts
      Architecture: x86-64
[ka@archlinux ~]$ pstree -uT
systemd─┬─NetworkManager
        ├─accounts-daemon
        ├─alacritty(ka)───zsh───nvim───node
        ├─alacritty(ka)───zsh───pstree
        ├─dbus-daemon(dbus)
        ├─lightdm─┬─Xorg
        │         └─lightdm───awesome(ka)
        ├─lvmetad
        ├─polkitd(polkitd)
        ├─rtkit-daemon(rtkit)
        ├─systemd(ka)─┬─(sd-pam)
        │             ├─at-spi-bus-laun
        │             ├─dbus-daemon
        │             ├─gvfsd
        │             ├─gvfsd-fuse
        │             └─pulseaudio───gsettings-helpe
        ├─systemd-journal
        ├─systemd-logind
        ├─systemd-timesyn(systemd-timesync)
        ├─systemd-udevd
        ├─upowerd
        └─zsh(ka)───MainThread─┬─Privileged Cont
                               ├─8*[Web Content]
                               └─WebExtensions

Last edited by kawsar (2020-10-09 06:35:34)

Offline

#9 2020-10-09 06:28:05

seth
Member
Registered: 2012-09-03
Posts: 50,013

Re: [Solved]No protocol specified error when running gui app from terminal

export XDG_RUNTIME_DIR=/run/user/1000
export XAUTHORITY="XDG_RUNTIME_DIR"/Xauthority

Whatever that is, it is wrong.
Please provide some context.

Online

#10 2020-10-09 06:47:56

kawsar
Member
Registered: 2020-09-22
Posts: 11

Re: [Solved]No protocol specified error when running gui app from terminal

seth wrote:
export XDG_RUNTIME_DIR=/run/user/1000
export XAUTHORITY="XDG_RUNTIME_DIR"/Xauthority

Whatever that is, it is wrong.
Please provide some context.

From the section of lightdm in this link
Xdg base directory
and in this section it suggests to configure lightdm to configure lightdm.

Last edited by kawsar (2020-10-09 06:50:40)

Offline

#11 2020-10-09 06:50:57

seth
Member
Registered: 2012-09-03
Posts: 50,013

Re: [Solved]No protocol specified error when running gui app from terminal

a) a three year old ubuntu workaround is most likely always a shit idea
b) look closer, you missed a very important detail

Online

#12 2020-10-09 09:18:15

kawsar
Member
Registered: 2020-09-22
Posts: 11

Re: [Solved]No protocol specified error when running gui app from terminal

Reverting those changes back solves the problem .
Thank you very much for helping me .

Offline

Board footer

Powered by FluxBB