You are not logged in.

#1 2017-07-10 12:10:11

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,932
Website

@o9000, tint2 and average desktop/wallpaper color in var?

@ o9000; Would it be hard to implement something like:
- background color should be an average wallpaper/background color + user defined variation (for example 10% darker) < edit, better: get average color into $var which can be used to define colors, like 'background_color = $var 50'

This

convert senn.jpg -resize 1x1 -format '%[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]' info:-
#65,103,194

seems to produce similar results as that ^ link and gpicks tools/pallete from image.

Other interesting possibilities for user would be to make some math on RGB/HSL/.... of that $var, like $var + #33XXXX would make image reder.

p.s. In any case variables for storing colors would be nice (unless that is already possible somehow?).

- maybe: if position is top then there should be a slight transparent feather going into background, to bottom in this case (p.s. Actually that would be more complicated, all sides are possible)

A little script.

--- Mod edit ---

Sorry @bronto, I had to take out the "$" symbol in the thread title. It was messing up my conky forum atomfeed!

conky: unknown variable '$var'

Last edited by damo (2017-07-12 22:43:19)

Online

#2 2017-07-10 15:02:59

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 761

Re: @o9000, tint2 and average desktop/wallpaper color in var?

To me that sounds awesome as tint2 will change the color of the panel whenever wallpaper is changed. Customizing the changes in the tint2 config or running a script be great too.


Real Men Use Linux

Offline

#3 2017-07-10 16:49:22

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: @o9000, tint2 and average desktop/wallpaper color in var?

Interesting idea.

A bit similar to a suggestion from another user, to compute the average task icon color and use it in the background or borders. That can make text-only themes a bit easier to use.

He actually implemented this feature for himself and contributed the patch, but it is not ready for inclusion yet.

The problem is getting the design right, as I try hard to avoid deprecating features. So it needs to be well thought before inclusion.

But this summer I have little time to work on this. Maybe in the fall.

Offline

#4 2017-07-12 22:23:21

jmc
tint3 maintainer
Registered: 2017-05-22
Posts: 9
Website

Re: @o9000, tint2 and average desktop/wallpaper color in var?

It's somewhat tricky to get right...
Would this be something that needs to be updated every time the contents of the root window change? What if it changes frequently (e.g., animated wallpaper)?

The linked issue is different in that there's no confusion on the resulting color and it would basically never change after the initialization.

Rather than adding this logic to tint2, what about having an external script compute the target color and update a snippet of tint2 configuration somewhere on your filesystem that you can later import as a background from the main config?

As an example, you would have a main ~/.config/tint2/tint2rc config file which would look something like:

# this will import background 1
@import average-background.tint2rc

# rest of your config file here
# ...

And a script that you can run when you change wallpaper (or at xinit time, up to you) would compute the average pixel value and dump it as a background config snippet to ~/.config/tint2/average-background.tint2rc.

Last edited by jmc (2017-07-12 22:25:46)

Offline

#5 2017-07-13 06:36:21

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,932
Website

Re: @o9000, tint2 and average desktop/wallpaper color in var?

jmc wrote:

It's somewhat tricky to get right...
Would this be something that needs to be updated every time the contents of the root window change? What if it changes frequently (e.g., animated wallpaper)?

Thinking about it, it could change based on user defined path to an image, could be wallpaper or some user mixed color mess. It could only change on startup.

Is that import statement possible right now?

And a note to my future self; script should also have min, max brightness logic of some sort, limiter. Also picking multiple colors for use with gradients.

Last edited by brontosaurusrex (2017-07-13 06:49:53)

Online

#6 2017-07-13 07:45:08

jmc
tint3 maintainer
Registered: 2017-05-22
Posts: 9
Website

Re: @o9000, tint2 and average desktop/wallpaper color in var?

I added that to tint3 some time ago, I believe it wouldn't be too hard to add to tint2 as well.

Offline

#7 2017-07-13 09:08:49

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: @o9000, tint2 and average desktop/wallpaper color in var?

Import statements are not possible now in tint2. While back porting that feature to tint2 is not hard, implementing tint2conf support is not so easy. I don't plan to do that soon, if at all.

But jmc is right, changing wallpapers would make this tricky and possibly inefficient. Maybe it's not a good idea to add it to tint2 after all.

There are scripts and programs that automate theming tint2/openbox/gtk, maybe it would be a more useful feature for one of them.

Offline

Board footer

Powered by FluxBB