waypaper icon indicating copy to clipboard operation
waypaper copied to clipboard

Waypaper not working on NixOS

Open mylinuxforwork opened this issue 7 months ago • 13 comments

Installed waypaper on NixOS. When starting waypaper from the command line, I get the following error messages:

❯ waypaper
Traceback (most recent call last):
  File "/nix/store/pxm7i541l4cc7hqj99r1jagm7b03v5mc-waypaper-2.6/bin/.waypaper-wrapped", line 6, in <module>
    from waypaper.__main__ import run
  File "/nix/store/pxm7i541l4cc7hqj99r1jagm7b03v5mc-waypaper-2.6/lib/python3.13/site-packages/waypaper/__main__.py", line 10, in <module>
    from waypaper.app import App
  File "/nix/store/pxm7i541l4cc7hqj99r1jagm7b03v5mc-waypaper-2.6/lib/python3.13/site-packages/waypaper/app.py", line 12, in <module>
    from waypaper.changer import change_wallpaper
  File "/nix/store/pxm7i541l4cc7hqj99r1jagm7b03v5mc-waypaper-2.6/lib/python3.13/site-packages/waypaper/changer.py", line 9, in <module>
    from waypaper.config import Config
  File "/nix/store/pxm7i541l4cc7hqj99r1jagm7b03v5mc-waypaper-2.6/lib/python3.13/site-packages/waypaper/config.py", line 9, in <module>
    from waypaper.options import FILL_OPTIONS, SORT_OPTIONS, SWWW_TRANSITION_TYPES, BACKEND_OPTIONS
  File "/nix/store/pxm7i541l4cc7hqj99r1jagm7b03v5mc-waypaper-2.6/lib/python3.13/site-packages/waypaper/options.py", line 10, in <module>
    MONITOR_OPTIONS: List[str] = [m.name for m in get_monitors()]
                                                  ~~~~~~~~~~~~^^
  File "/nix/store/qgdzyyvcf8ibwbv5m1j55dff64j5l599-python3.13-screeninfo-0.8.1/lib/python3.13/site-packages/screeninfo/screeninfo.py", line 32, in get_monitors
    raise ScreenInfoError("No enumerators available")
screeninfo.common.ScreenInfoError: No enumerators available

Any idea how to fix this. Is there a package missing?

Thanks in advance.

mylinuxforwork avatar Sep 03 '25 13:09 mylinuxforwork

Hmm, looks like another weird error with screeninfo library 🫤 We have recently made some guarding against screeninfo nonsense in the git version but not at this place. I think it should be so that it defaults to All monitors should any issue arise.

Anyways, is it recent or it was always like that?

anufrievroman avatar Sep 03 '25 14:09 anufrievroman

Hmm, looks like another weird error with screeninfo library 🫤 We have recently made some guarding against screeninfo nonsense in the git version but not at this place. I think it should be so that it defaults to All monitors should any issue arise.

Anyways, is it recent or it was always like that?

I am currently preparing the ML4W Dotfiles for nix. And waypaper is the only component that's currently not working.

Also tried to install it with pipx. Was able to intall all dependencies to compile but can't fix this error.

❯ pipx install waypaper
Fatal error from pip prevented installation. Full pip output in file:
    /home/raabe/.local/state/pipx/log/cmd_2025-09-03_16.20.50_pip_errors.log

pip seemed to fail to build package:
    PyGObject

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    ../cairo/meson.build:31:12: ERROR: Dependency "cairo" not found, tried pkgconfig
    error: metadata-generation-failed

Error installing waypaper.

mylinuxforwork avatar Sep 03 '25 14:09 mylinuxforwork

For this error that some people experience, some reported that installing cairo-gobject-devel or cairo-devel might help. In any case, it seems to be issue with cairo library

anufrievroman avatar Sep 03 '25 14:09 anufrievroman

Yes. Found this recommendation already but wasn't able to find the packages on Nix. Will check again.

mylinuxforwork avatar Sep 03 '25 15:09 mylinuxforwork

I just reimplemented monitor detection in such a way that screeninfo is not imported by default and swww and hyprpaper backends don't use it, so hopefully it will partly resolve this issue.

anufrievroman avatar Sep 25 '25 08:09 anufrievroman

I just reimplemented monitor detection in such a way that screeninfo is not imported by default and swww and hyprpaper backends don't use it, so hopefully it will partly resolve this issue.

Great. Thanks you.

mylinuxforwork avatar Sep 25 '25 09:09 mylinuxforwork

By the way, I noticed that on NixOS, waypaper is already 2 versions old in the stable. @Prince213 @totalchaos05 Could you please update on occasion? Thanks a lot for the package!

anufrievroman avatar Oct 01 '25 11:10 anufrievroman

Sorry about that, I don't check github as often as I should. Was there another dependency issue that needed to be fixed or should I just update the package?

TotalChaos05 avatar Oct 02 '25 06:10 TotalChaos05

The current PR for the package update is https://github.com/NixOS/nixpkgs/pull/447914

TotalChaos05 avatar Oct 02 '25 06:10 TotalChaos05

No, there are no dependency issues, I think. There's strange behavior with the screeninfo library, but it doesn't look like something we can fix. Thank you very much for your work!

anufrievroman avatar Oct 02 '25 07:10 anufrievroman

I patched this in #176. I also opened a PR in nixpkgs a few days ago that has the fix included.

scottmckendry avatar Oct 02 '25 18:10 scottmckendry

@mylinuxforwork waypaper v2.7 is now available in the nixos-unstable channel. You shouldn't get this error anymore.

scottmckendry avatar Oct 07 '25 20:10 scottmckendry

@mylinuxforwork waypaper v2.7 is now available in the nixos-unstable channel. You shouldn't get this error anymore.

Thanks. I will test.

mylinuxforwork avatar Oct 08 '25 07:10 mylinuxforwork