Skip to content

Span image over all monitors. #39

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

Closed
FF-AntiK opened this issue Oct 3, 2022 · 8 comments · Fixed by #82
Closed

Span image over all monitors. #39

FF-AntiK opened this issue Oct 3, 2022 · 8 comments · Fixed by #82
Labels
enhancement New feature or request

Comments

@FF-AntiK
Copy link

FF-AntiK commented Oct 3, 2022

Would it be possible to allow an image to be spanned over multiple monitors?
I could try to implement this myself. I would just need a hint, where in the code the image is drawn on a specific output.
I gues I would just need to split the image data into n chunks and then send them to the appropriate outputs.

@LGFae LGFae added the enhancement New feature or request label Oct 3, 2022
@LGFae
Copy link
Owner

LGFae commented Oct 3, 2022

I think this would actually be pretty difficult with the way we organized the code. Let me think about it a little.

@FF-AntiK
Copy link
Author

FF-AntiK commented Oct 4, 2022

For now I just split the image manually and then send the chunks to the appropriate monitor with swww, which works good enough.
The only thing I might have to consider with this approach is, that the animation isn't synced on both monitors. Do you think it would be possible to allow sending both images to their corresponding outputs in one command, to make sure the animation starts at the same time on both outputs?

Or maybe you could implement an option to sync the current frame number of the gif on all outputs?

@FF-AntiK
Copy link
Author

Any news on this? I'm very happy with my solution so far. But syncing the frame numbers on both monitors would still be very nice. Sometimes they are out of sync because they wont start exactly the same time.

@LGFae
Copy link
Owner

LGFae commented Oct 18, 2022

Syncing is precisely the problem. I am actually surprised it works sometimes at all! I am thinking of adding an option --span-all, or something like that, that will allow you to send one image meant to spawn across all monitors. Then we can synchronize everything only in this specific case.

I am thinking of adding barriers for the animation threads in this case, but I still need to flesh out all the details . There's also some other things that I will probably get to first, such as #42 and #37 (since they are simpler), and reviewing PR 44 (since it might change some stuff inside animation).

Unfortunately, I will remain very busy at least until early December, so I've been working slowly on everything, and I think this particular request will still take a while :(

@FF-AntiK
Copy link
Author

No problem! I'm happy you consider this at all ;-)
For now I'll use this little startup script:

#!/bin/sh
if [ -z "$1" ]
then
	IMG=$(ls -d ~/Pictures/wallpapers/* | shuf -n 1)
else
	IMG=$(realpath "$1")
fi

WIDTH=$(identify -format '%[fx:w/2]' "$IMG"'[0]')
HEIGHT=$(identify -format '%[fx:h]' "$IMG"'[0]')

convert "$IMG" -coalesce -repage 0x0 -crop "$WIDTH"x"$HEIGHT"+0+0 +repage /tmp/left.gif
convert "$IMG" -coalesce -repage 0x0 -crop "$WIDTH"x"$HEIGHT"+"$WIDTH"+0 +repage /tmp/right.gif

swww init
swww img -f Nearest -o DP-3 /tmp/left.gif
swww img -f Nearest -o HDMI-A-1 /tmp/right.gif

As I said, sometimes it's out of sync, but then I run the script again until both GIFs seem synced. At least they don't drift away from each other as far as I can tell ;-)

@LGFae
Copy link
Owner

LGFae commented Dec 4, 2022

Hey @FF-AntiK, just as an update, since #57 greatly simplifies the daemon's code, just syncing the updates should actually become relatively simple.

Splitting the image ourselves however, will still take a little longer.

It took a while, but we are getting there!

@FF-AntiK
Copy link
Author

FF-AntiK commented Dec 5, 2022

Thank you very much for working on this!

I think while syncing the gif frame numbers on multiple displays is a good idea (but should be opt in, I think), the image splitting should be up to the user and must not be implemented in swww.

The image splitting can become a bit complicated when the user has monitors with different screen sizes and/or aspect ratios. Also there are plenty of different positioning schemes I could think of...

@LGFae LGFae mentioned this issue Feb 8, 2023
@LGFae LGFae closed this as completed in #82 Feb 12, 2023
@AdsonCicilioti
Copy link

I stumbled upon the lack of this functionality and when searching I found this issue.

It's a shame we don't see this functionality yet. I'll have to make do with the trick of splitting the image.

Unfortunately, currently, we still don't have any tool for Wayland WM/composers that does this, so I'm glad that swww is already on the way to having it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants