xyproto / wallutils

:city_sunset: Utilities for handling monitors, resolutions, wallpapers and timed wallpapers
BSD 3-Clause "New" or "Revised" License
463 stars 17 forks source link

sync /dev/stderr: invalid argument #4

Closed michaelKurowski closed 5 years ago

michaelKurowski commented 5 years ago

I'm getting Could not set wallpaper: sync /dev/stderr: invalid argument while attempting to set a wallpaper.

sway version 1.0-rc1-170-g076257a9 (Mar 11 2019, branch 'master')

wayland 1.17.0-1

xyproto commented 5 years ago

Thanks for reporting! I'll try to reproduce the issue.

Was setwallpaper called from within .config/sway/config or on the command line?

xyproto commented 5 years ago

Added two calls to Sync() before calling Exit. Please test if the master branch now works for you.

michaelKurowski commented 5 years ago

It was being called from command line. I'll check if current master works within next 2 days.

xyproto commented 5 years ago

Great, thanks for testing.

michaelKurowski commented 5 years ago

Ok so I'm at commit c7f5b94e7da9e943b0fc33e59b4b26cc16e11f70, and I still get the same error while seting wallpaper.

xyproto commented 5 years ago

I am unable to reproduce the issue.

What are the steps to reproduce this?

Am I correct in assuming that you start sway, then launch a terminal emulator (which one?) and then run something like:

setwallpaper /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png

Then the wallpaper changes, and then you get the error message?

It could be the terminal emulator, since the error is related to /dev/stderr.

Versions

Thanks!

xyproto commented 5 years ago

I think I found the issue. The error message may appear if setwallpaper can not find a method for changing the wallpaper, and if feh is also not installed.

If you tell me which desktop environment or window manager are you using, I will add support for it.

Please confirm that the error is gone in latest master of wallutils.

michaelKurowski commented 5 years ago

I've got the latest sway sway version 1.0

uname -r -> 5.0.4-arch1-1-ARCH I use sway on wayland

go version go1.12.1 linux/amd64

The issue remains

michaelKurowski commented 5 years ago

Checking for the latest master

michaelKurowski commented 5 years ago

Ok it now outputs Could not set wallpaper: Found no working method for setting the desktop wallpaper, but isn't sway supported?

xyproto commented 5 years ago

Thanks for testing. Sway is supported, but /usr/bin/swaymsg must be installed.

What is the output from which swaymsg on your system?

michaelKurowski commented 5 years ago

which swaymsg -> /usr/bin/swaymsg

xyproto commented 5 years ago

Also, is one of these true on your system?

michaelKurowski commented 5 years ago

Also swaymsg -v -> swaymsg version 1.0

xyproto commented 5 years ago

What does env | grep -i sway say?

michaelKurowski commented 5 years ago
  1. echo $SWAYSOCK -> /run/user/1000/sway-ipc.1000.913.sock
  2. echo $GDMSESSION outputs nothing
  3. echo $XDG_SESSION_DESKTOP outputs nothing
  4. echo $XDG_CURRENT_DESKTOP outputs nothing
  5. env | grep -i sway -> I3SOCK=/run/user/1000/sway-ipc.1000.913.sock SWAYSOCK=/run/user/1000/sway-ipc.1000.913.sock
xyproto commented 5 years ago

Thanks.

I'm baffled and mystified by this. If SWAYSOCK is defined and sway and swaymsg exists, I don't see why it fails to run swaymsg to set the desktop wallpaper.

Here is the relevant code: https://github.com/xyproto/wallutils/blob/master/sway.go#L19

xyproto commented 5 years ago

I'm also using Sway, btw, and it seems to work here.

xyproto commented 5 years ago

Found the issue! Fix coming up in 3..2...

xyproto commented 5 years ago

Please try with the latest master.

michaelKurowski commented 5 years ago

Works! Thank you, dude!

xyproto commented 5 years ago

I changed:

hasE("SWAYSOCK") && (containsE("GDMSESSION", "sway") || containsE("XDG_SESSION_DESKTOP", "sway") || containsE("XDG_CURRENT_DESKTOP", "sway"))

to

hasE("SWAYSOCK") || (containsE("GDMSESSION", "sway") || containsE("XDG_SESSION_DESKTOP", "sway") || containsE("XDG_CURRENT_DESKTOP", "sway"))

Since having SWAYSOCK set should be good enough indication that sway is running.

I assume you are not launching sway from any particular desktop manager, like gdm.

xyproto commented 5 years ago

Thanks for testing!

michaelKurowski commented 5 years ago

I just run it from terminal after logging in