ArtsyMacaw / wlogout

A wayland based logout menu
MIT License
681 stars 33 forks source link

Change icon colourscheme on the fly #48

Closed Ay1tsMe closed 7 months ago

Ay1tsMe commented 7 months ago

I'm using pywal for wlogout and I've imported the .css file so I can call the colour scheme variables that pywal generates. But I want to be able to change the colour scheme of the icons.

Is there a way to change the colour schemes of the icons with css or do I have to manually change them in the folder path

ArtsyMacaw commented 7 months ago

There's no direct way to edit the color of the images from the style.css. You can generate new icons every time you want to change their color using an ImageMagick command like sudo convert '/usr/share/wlogout/assets/*.svg' -transparent white -fill '#d4bff9' -colorize 100 -density 1000 -resize 512x512 -set filename:fn '%[basename]' '/usr/share/wlogout/icons/%[filename:fn].png'

ArtsyMacaw commented 7 months ago

Actually, I'm not entirely sure how pywal works, but you could possibly use the svg files by adding a fill property to them. For example change lock.svg to contain <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve" fill="#d4bff9"> Then you could import the .svg into pywal and have it edit the color there.