anufrievroman / waypaper

GUI wallpaper manager for Wayland and Xorg Linux systems
https://anufrievroman.gitbook.io/waypaper
GNU General Public License v3.0
396 stars 27 forks source link

TypeError: Parameters to generic types must be types. Got ['none', 'swaybg', 'swww', 'feh', 'wallutils', 'hyprpaper', 'mpvpaper']. #88

Closed om4r932 closed 2 weeks ago

om4r932 commented 1 month ago

Hi everyone,

I was trying to use Waypaper with swaybg but when i launch with Hyprland, it shows me nothing (a black screen with my widgets on), and when i tried with the CLI, it got me this error : TypeError: Parameters to generic types must be types. Got ['none', 'swaybg', 'swww', 'feh', 'wallutils', 'hyprpaper', 'mpvpaper']

Can you help me please PS : Sorry for my bad English, i'm French

anufrievroman commented 1 month ago

Salut! Was there anything else surroundings this error, like numbers of lines etc? Maybe you could screenshot the whole error?

P.s. looks like you're using the latest unrealized git version, maybe try a more stable version from pipx or AUR (waypaper), it might work then.

om4r932 commented 1 month ago

Sorry, i didn't sent you the whole error, here's the full error report :

Traceback (most recent call last): File "/home/omar/.pyenv/versions/3.9.13/bin/waypaper", line 5, in <module> from waypaper.__main__ import run File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/site-packages/waypaper/__main__.py", line 10, in <module> from waypaper.app import App File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/site-packages/waypaper/app.py", line 11, in <module> from waypaper.changer import change_wallpaper File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/site-packages/waypaper/changer.py", line 5, in <module> from waypaper.config import Config File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/site-packages/waypaper/config.py", line 12, in <module> from waypaper.options import FILL_OPTIONS, SORT_OPTIONS, SWWW_TRANSITION_TYPES, BACKEND_OPTIONS File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/site-packages/waypaper/options.py", line 11, in <module> IMAGE_EXTENSIONS: Dict[BACKEND_OPTIONS, List[str]] = { File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/typing.py", line 277, in inner return func(*args, **kwds) File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/typing.py", line 837, in __getitem__ params = tuple(_type_check(p, msg) for p in params) File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/typing.py", line 837, in <genexpr> params = tuple(_type_check(p, msg) for p in params) File "/home/omar/.pyenv/versions/3.9.13/lib/python3.9/typing.py", line 166, in _type_check raise TypeError(f"{msg} Got {arg!r:.100}.") TypeError: Parameters to generic types must be types. Got ['none', 'swaybg', 'swww', 'feh', 'wallutils', 'hyprpaper'].

I first tried the waypaper one but it gets me the same error, that's why i'm on the git one

anufrievroman commented 1 month ago

Thank you. It's a strange typing error I've never seen before... I noticed you're using somewhat old python version 3.9, could you try to update your system to something more modern like 3.13? Not sure if that will fix it, but it might be the reason.

om4r932 commented 4 weeks ago

Thank you, changing my Python version to a recent version (3.12.7) fixed my problem. But i stil have another one, it won't start up at boot/login (reminder: I'm using Hyprland) and it worked when i enter myself the "waypaper --restore" command

anufrievroman commented 4 weeks ago

Good. So to make it set the wallpaper in Hyprland, you'd need to put exec-once=waypaper --restore into your hyprland config. Is it there? To clarify, waypaper does not really "start" on login, it just issues a command to restore the wallpaper as it was set in the config. So there might be some reasons why this command fails, for example if your wallpaper is on virtual drive that is not yet started in the boot sequence or something like that.

CalfMoon commented 3 weeks ago

Hey, although changing the version fixed the error i think it was caused because of this, IMAGE_EXTENSIONS: Dict[BACKEND_OPTIONS, List[str]] = here the dict is given the key type BACKEND_OPTIONS but BACKEND_OPTIONS is not a type its a list. I get a error from my LSP, but since its pyton it runs anyway. I thought about fixing it the last time i worked on the project but i thought it wouldn't matter much.

om4r932 commented 3 weeks ago

Finally, the wallpapers are showing up after a reboot but now i've got another error (yes, again....)

Now, it won't show my wallpaper but some default wallpapers (for Hyprland i guess...)

I did my config.ini on my home directory (on ~/.config/waypaper/config.ini) :

[Settings]
folder = /home/omar/Images/Wallpapers
fill = Fill
backend = swaybg
subfolders = False
wallpaper = /home/omar/Images/Wallpapers/bg.png

I also tried to do it manually (with parameters and exec-once parameter) :

exec-once = waypaper --folder /home/omar/Images/Wallpapers --wallpaper /home/omar/Images/Wallpapers/bg.png --backend swaybg --fill fill

anufrievroman commented 3 weeks ago

This one is a bit hard to diagnose, many things might be off. Since some default wallpaper is loading, it means that some other wallpaper deamon is launching, which is strange if that is not in your hyprland config. You can remove hyprpaper from the system if you're not really using it, it might make things easier. Also, could you try to just run waypaper --restore in a terminal and tell us if there are some lines printed in the terminal after that command and if wallpaper changes?

om4r932 commented 3 weeks ago

So, i already got rid of hyprpaper and when i do waypaper --restore it doesn't print anything important (sent command to set wallpaper was set by swaybg and 2024-10-28 14:31:07 -) and it did change the wallpaper (what i wanted)

anufrievroman commented 3 weeks ago

Good, but then what is the remaining problem? When you say "it won't show my wallpaper but some default wallpapers" do you mean in the list of wallpapers in GUI? It should show the folder you specified or a default Pictures directory. Are you sure the path is correct? Sorry if I still don't fully understand the problem, please give more details :)

anufrievroman commented 2 weeks ago

Any further help is required with this issue?