nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.64k stars 1.74k forks source link

bug: Caffeine not able to connect to screen #3038

Open Tchekda opened 2 years ago

Tchekda commented 2 years ago

Is there an existing issue for this?

Issue description

When starting via the service or manually in the cmd, here is the error :

Traceback (most recent call last):
  File "/nix/store/1rbzj4r73izd3zi2vkwd8f2b8ab3qblw-caffeine-ng-3.5.1/bin/..caffeine-wrapped-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/1rbzj4r73izd3zi2vkwd8f2b8ab3qblw-caffeine-ng-3.5.1/lib/python3.9/site-packages/caffeine/main.py", line 454, in main
    main = GUI(arguments["--preferences"])
  File "/nix/store/1rbzj4r73izd3zi2vkwd8f2b8ab3qblw-caffeine-ng-3.5.1/lib/python3.9/site-packages/caffeine/main.py", line 155, in __init__
    self.__core = Caffeine(self.__process_manager)
  File "/nix/store/1rbzj4r73izd3zi2vkwd8f2b8ab3qblw-caffeine-ng-3.5.1/lib/python3.9/site-packages/caffeine/core.py", line 82, in __init__
    self._ewmh = EWMH()
  File "/nix/store/sm0s5mcfb86mz3jjjabqj5wds5nc39df-python3.9-ewmh-0.1.6/lib/python3.9/site-packages/ewmh/ewmh.py", line 70, in __init__
    self.display = _display or display.Display()
  File "/nix/store/j1w041npm5paz1rsk92bqz33c3b65hkm-python3.9-xlib-0.31/lib/python3.9/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
  File "/nix/store/j1w041npm5paz1rsk92bqz33c3b65hkm-python3.9-xlib-0.31/lib/python3.9/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/nix/store/j1w041npm5paz1rsk92bqz33c3b65hkm-python3.9-xlib-0.31/lib/python3.9/site-packages/Xlib/protocol/display.py", line 166, in __init__
    raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":1": b'Authorization required, but no authorization protocol specified\n'`

I tried with the previous version (2.4.5) but same error.

Bug appeared when I update the laptop to 22.05

Maintainer CC

@marzipankaiser @uvNikita

System information

- system: `"x86_64-linux"`
 - host os: `Linux 5.18.0, NixOS, 22.05 (Quokka), 22.05.538.d9794b04bff`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(tchekda): `"home-manager-22.05.tar.gz, home-manager-master, nixos-22.05, nixos-21.11-21.11, nixos-unstable, unstable"`
 - channels(root): `"home-manager-22.05.tar.gz, home-manager-master, nixos-22.05, nixos-hardware, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
uvNikita commented 2 years ago

Can you try to remove ~/.xauth* files from your user's home directory? I vaguely remember that it helped with errors like this.

Tchekda commented 2 years ago

Can you try to remove ~/.xauth* files from your user's home directory? I vaguely remember that it helped with errors like this.

I removed ~/.Xauthority but still same error

stale[bot] commented 1 year ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.