Follow

Okay, this is kinda cool. Since the elementary blog respects prefers-color-scheme, Ephemeral has a built-in color scheme toggle, and apps like Code have dark styles… I can make screenshots in blog posts do this. :D Gonna wrap it up in a little Jekyll include.

· · Mastodon Twitter Crossposter · 6 · 18 · 24

(these screenshots were taken at different times so they’re not exact, but if we’re planning to do this, we could make sure the screenshots are pixel-perfect other than the color scheme change)

@cassidyjames Would be cool if the screenshot tool could take both light and dark screenshots at the same time

@tbernard yep, someone suggested that and I'm thinking of how to make it work. It might not be super reliable but it would be dope. We'd need a system wide dark style preference, and the app would need to support it. 😜

@tbernard @cassidyjames not possible really. You can do something like elementary does for the conceal text option, i.e. take a light screenshot, switch everything to dark, wait until animations have ended, take a dark screenshot, switch everything back. But that would fail if there's any animation.

@tbernard @cassidyjames and yes, that implies you have a way to switch things to dark.

@exalm @tbernard yeah it would work like the conceal text. And there's an experimental Gala branch that adds an API for transitioning cleanly between light and dark; I think it has (or could have) some sort of callback for when the transition is over so Screenshot could wait for that, then snap, then transition back.

@exalm @tbernard of course yes if an app manually has some slow animation or something (or otherwise does not complete within the expected time) it could get weird, but that's no different than conceal text today.

@cassidyjames @exalm @tbernard a proper way of doing this is introducing Wayland/X11 protocol extensions that ask the app to render itself in the given style and send the buffer over, without changing how the app appears to the user. Then you don't have to rely on hacks with waiting for animations to finish, etc., except using them as a fallback

I've wanted to do this for *vector* screenshots for a long time, but never got around to actually doing it

@bugaevc @cassidyjames @tbernard good point, that would indeed work, though I can already imagine nothing except GTK would ever implement it.

@exalm @cassidyjames @tbernard true, that's why you'd need a fallback for clients using other toolkits. For X11, it doesn't have to be an actual protocol between the clients and the X server; it can just be something with properties and invisible windows between the client and the compositor; though I admit I've never done anything like that on X11.

@cassidyjames @tbernard no, I mean if you have e.g. a spinner, it will be in a different position in the 2 screenshots. Or if you scroll and do a screenshot while it's still decelerating, the position would be different on the 2 images.

@cassidyjames I didn't immediately get what's going on here because it's so seamless but now I think it's great!

@cassidyjames Don't give me bad ideas for kde.org, I'm already regretting adding a dark theme because it's need more maintenance. :(

@cassidyjames would it be possible to make the browser chrome get the site colour from the meta information and adjust to match it?

@PlutoisAPlanet possibly, but I think I might have to like… run JavaScript in the frame or something? I haven't really looked into it.

@cassidyjames do you not have access to the meta of the page, similar to how you get the page title?

@PlutoisAPlanet I'm not sure. The title is a specific property in WebKit, but I don't know if WebKitGTK makes other meta tags easily available.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!