Colonial-Dev/satpaper

$XDG_CURRENT_DESKTOP is not defined with systemd

Closed this issue · 5 comments

[2023-10-20T19:23:20Z INFO  satpaper] Timestamp has changed!
[2023-10-20T19:23:20Z INFO  satpaper] Fetching updated source and compositing new wallpaper...
[2023-10-20T19:23:21Z INFO  satpaper::slider] Stitching tiles...
[2023-10-20T19:24:08Z INFO  satpaper::slider] Compositing...
[2023-10-20T19:24:08Z INFO  satpaper::slider] Resizing source image...
[2023-10-20T19:24:20Z INFO  satpaper::slider] Generating destination image...
[2023-10-20T19:24:20Z INFO  satpaper::slider] Compositing source into destination...
[2023-10-20T19:24:20Z INFO  satpaper::slider] Compositing complete.
[2023-10-20T19:24:22Z INFO  satpaper::slider] Output saved.
Error: An error occurred in the wallpaper updating loop

Caused by:
    0: Failed to get XDG_CURRENT_DESKTOP environment variable
    1: environment variable not found

What's your desktop environment? This could either be a bug in your shell or an unsupported DE - there are fixes for both.

I use i3vm on archlinux
if I run the command in cli I am not in trouble it is only with the systemd service

This sounds more like a bug with your distro or setup. XDG_CURRENT_DESKTOP should already be defined.

Also, i3 support isn't bundled, so just setting XDG_CURRENT_DESKTOP isn't enough. Are you using the --wallpaper-command option?

yes, ok
service file:

[Unit]
Description=Run Satpaper on login.

# You should adjust these values as needed/preferred.
[Service]
Environment=SATPAPER_SATELLITE=meteosat10
Environment=SATPAPER_RESOLUTION_X=2256
Environment=SATPAPER_RESOLUTION_Y=1504
Environment=SATPAPER_DISK_SIZE=94
Environment=SATPAPER_TARGET_PATH=/tmp/wall
Environment=SATPAPER_WALLPAPER_COMMAND="feh --bg-scale"
Environment=XDG_CURRENT_DESKTOP=i3

ExecStart=/home/neptunium/.cargo/bin/satpaper
Restart=on-failure
RestartSec=5
; StandardOutput=append:/home/neptunium/.satpaper.log
; StandardError=append:/home/neptunium/.satpaper.log

[Install]
WantedBy=default.target

Ah, I think I see the issue now.

The check for --wallpaper-command should come before it tries to read XDG_CURRENT_DESKTOP - that way it doesn't error if you're using something unsupported with wonky environment variable handling.

I'll push an update shortly to fix that.