XRootGIF icon indicating copy to clipboard operation
XRootGIF copied to clipboard

A way to target a specific monitor ?

Open HommeDeGout opened this issue 5 years ago • 4 comments

Hello ! I love your program, it's the best way I've found to put a sweet animated gif on my desktop. I have a small problem, though : The command lines option allows me to target a specific display and a specific screen, but on my dual monitor setup, randr only sees one screen : Screen 0, and there also seem to be only one display : 0:0 . Is there anything I could to to get a different picture on each screen using "HDMI1" and "DP3", or an animated picture only on one of my screens ?

Thank you :)

HommeDeGout avatar Apr 24 '19 19:04 HommeDeGout

Hey, I'm glad you like it and thanks for your request! Currently it's not possible to use different gifs on different monitors (at least when they share the same root pixmap). Due to Randr it's normal to have only one X-Display, because your monitors share one. But it seems like a nice feature, so i guess I'll work on it next :)

jroeger23 avatar Apr 24 '19 20:04 jroeger23

Multiple wallpapers on Xorg in general is difficult, however many workarounds exist, one method that hydrapaper for example uses is to combine the 2 images. So if you have 2 1080p monitors, and 2 wallpaper's that are 1920x1080, it'll combine the two images to form one mega wallpaper that is 3840x1080.

You can make that kind of wallpaper by hand pretty easily. Such as with this command in ffmpeg: ffmpeg -i left.gif -i right.gif -filter_complex hstack output.gif If you're monitors have different resolutions or they aren't side by side, then it's probably better to use a video editor such as shotcut or kdenlive to make the gif.

Once you have the mega gif, you can simply run this command: xrootgif --scale-across-monitor output.gif And badda bing badda boom, you have an animated wallpaper for each monitor, roughly. And surprisingly, it isn't demanding at all to run. (A testament to how good the code is imo)

I have no idea how hard that would be to implement a combine gif feature in xrootgif itself, so if anyone was wondering how to do it, there you go.

Edit: Forgot to mention, that both gifs have to be the exact same framerate, and the exact same time length

Charadon avatar Jun 07 '20 21:06 Charadon

I have no idea how hard that would be to implement a combine gif feature in xrootgif itself, so if anyone was wondering how to do it, there you go.

I found some approaches in my git stashes, but to be honest the architecture of xrootgif is not quite suitable for such extensions.

Another consideration is, that the merging of two gifs (with n and m frames) might result in many (also redundant) frames (worst-case n*m frames if n is co-prime to m)

So overall this would be possible but might not end up that smooth.

Note: Sadly I abandoned this project over the last year, but I might continue it as soon as the time comes

jroeger23 avatar Jun 08 '20 15:06 jroeger23

Yeah, sadly animated background per screen is an insanely difficult thing to do, with the only easy way being to run an mpv instance on each monitor, but that uses a ton of resources to do that, not to mention it's prone to bugs.

Even on windows, with the proprietary Wallpaper Engine, i'm pretty sure it's not possible to do multi-monitor animated backgrounds on that either.

Only way this would be easily possible is if Wayland in the future added some kind of feature (if they haven't already) that allowed multiple backgrounds, I say Wayland because xorg is in pure maintenance mode and will most likely never receive another feature update again.

Charadon avatar Jun 08 '20 16:06 Charadon