luisbocanegra / kde-material-you-colors

Automatic color scheme generator from your wallpaper for KDE Plasma powered by Material You
https://store.kde.org/p/2136963
GNU General Public License v3.0
416 stars 6 forks source link

[Feedback needed] Get colors from unsupported wallpaper plugins by taking a screenshot of the desktop view #163

Closed luisbocanegra closed 11 months ago

luisbocanegra commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, the current wallpaper information is obtained using Plasma Scripting API, but only works if the wallpaper plugin itself stores the value of the current wallpaper (like an image path or color)

Describe the solution you'd like Find a way to grab a screenshot of the desktop view

Todo

Additional context BUG:449986 - Spectacle: New capture mode: Window by properties

luisbocanegra commented 12 months ago

So there is this KWin plugin https://github.com/KDE/kwin/tree/master/src/plugins/screenshot which is used to take screenshots by Spectacle. After reading https://github.com/KDE/kwin/blob/master/src/plugins/screenshot/org.kde.KWin.ScreenShot2.xml and a bit of trial and error 😆 managed to get a POC script working 🎉

Screenshot_20231202_125941

luisbocanegra commented 11 months ago

Testing is needed to ensure this works as expected for the new release:

First clone and run the main branch

git clone https://github.com/luisbocanegra/kde-material-you-colors
export PYTHONPATH=/home/luis/projects/kde-material-you-colors/src:$PYTHONPATH
python -m kde_material_you_colors.main

Try setting different wallpaper plugins that are not supported in previous releases like "Hunyango" and it should pick the colors from it.

To control how often screenshots are taken please refer to the end of the sample configuration file https://github.com/luisbocanegra/kde-material-you-colors/blob/main/src/kde_material_you_colors/data/sample_config.conf