Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'DESKTOP_SESSION' #52

Closed
asimovc opened this issue Jun 6, 2024 · 4 comments
Closed

KeyError: 'DESKTOP_SESSION' #52

asimovc opened this issue Jun 6, 2024 · 4 comments

Comments

@asimovc
Copy link

asimovc commented Jun 6, 2024

I get this error when i test a wallpaper and wal cant generate the files with colors

(pywal16) [user@tux ~/pywal16]$ wal -n -i ~/Wallpapers/wallhaven-5gp7j8_1920x1080.png 
[I] image: Using image wallhaven-5gp7j8_1920x1080.png.
[I] theme: Set theme to _home_hellboy_Wallpapers_wallhaven-5gp7j8_1920x1080_png_9_dark_None_None_2774760_1.1.0.json.
[I] colors: Found cached colorscheme.
Traceback (most recent call last):
  File "/home/user/pywal16/bin/wal", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/pywal16/lib/python3.12/site-packages/pywal/__main__.py", line 244, in main
    parse_args(parser)
  File "/home/user/pywal16/lib/python3.12/site-packages/pywal/__main__.py", line 216, in parse_args
    sequences.send(colors_plain, to_send=not args.s, vte_fix=args.vte)
  File "/home/user/pywal16/lib/python3.12/site-packages/pywal/sequences.py", line 93, in send
    if os.environ["DESKTOP_SESSION"] == "plasma":
       ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 685, in __getitem__
KeyError: 'DESKTOP_SESSION'
@eylles
Copy link
Owner

eylles commented Jun 6, 2024

huh so that is a direct consequence of #51

what distro and desktop environment are you on?

cc @Acetylsalicylsaeure

@asimovc
Copy link
Author

asimovc commented Jun 8, 2024

My distro is Gentoo and i'm not using any desktop environment, i just use a compositor window manager called dwl.

@eylles
Copy link
Owner

eylles commented Jun 8, 2024

the os.environ expects the variable DESKTOP_SESSION to exist and have some value even if empty, should have catched that back before merging the pr, i guess you really cannot assume any env var to be set by the user session.

@eylles
Copy link
Owner

eylles commented Jun 8, 2024

fixed in 8aad28a

@asimovc asimovc closed this as completed Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants