Some fancy decors and a color-picker

edit: I guess I’ll put it on Sourceforge. Busy weekend, it’ll be up in a few days.
I have this collection of decors, and I’ve made a tool that lets you pick two colors from your screen wallpaper and use them in titlebars in a couple of simple themes. Some of the decors don’t make much sense unless you see the wallpaper they were designed to go with, but they demonstrate some configs anyway. I’ve got it all in a tarball with a readme. I suppose I could release it on Sourceforge but not sure that’s the best way to distribute it.


Picker

When ready, I will post it on different Linux distros with the link to this topic. You can also post it on Box-Look.org for FVWM Themes.

Okay I did it. It’s called FvwmDecorDemos

We’ll see if people can fit it into their configuration easily.

I downloaded it. A lot of work is done, looks interesting.

Thanks very much for your help!

I did a test. The decor change works fine with a minor edit. Did not yet test the color-picker.

In the instruction… “In one of your menus”… add + sign.

+ "Decors" Popup FancyDecors

Example in my menu:

## Background Menu
DestroyMenu BGMenu
AddToMenu   BGMenu "WALLPAPERS" Title
+ "Decors" Popup FancyDecors
+ "BgPanels%$[micon]/wallpaper.png%" Popup BGPanel

Here is one suggestion to make it easier to select/view the decors with a small thumbnail (24x50) in the menu… example Blue Wing"

FvwmDecorBlueWing-tmb

A new folder, example /thumbnail (24x50 image of each decor)

SetEnv mimg $[HOME]/.fvwm/FvwmDecorDemos/thumnail
+ "Blue Wing%$[mimg]/blue-wing24x50.xmp%" Function SwitchDecor blue_wing.decor

Forgot to mention, the script lines of FvwmDecor.sys which runs the decor script, look like this with ImagePath and Read commands.

FvwmDecor.sys

ImagePath $[HOME]/.fvwm/FvwmDecorDemos/images:+

Read $[HOME]/.fvwm/FvwmDecorDemos/Decor/decor-setup.fvwm
Read $[HOME]/.fvwm/FvwmDecorDemos/Decor/menuDecors.fvwm

I made thumbnails as you suggested. I put them in the same directory with the buttons though. I rearranged things so that almost all the files are in a subdirectory, which will make it cleaner to drop into a config. I also moved a couple of lines to the setup file so the user doesn’t have to bother with them. I like the thumbnails myself; I was just too lazy to do it. :-) Releasing as version 1.1 on Sourceforge.

1 Like

Great improvement including decor-setup.fvwm in the root folder for users to modify. Also, there is a choice not to decorate the menu by not loading the menuDecors.fvwm script.

The color-picker cannot get it to work in the terminal.

$ tclsh pixelcapture.tcl 
invalid command name "wm"
    while executing
"wm geometry . 300x200"
    (file "pixelcapture.tcl" line 18)

Glad you like it.

You need to invoke wish, not tclsh, for the GUI tool. You should be able to just type “./pixelcapture.tcl” though, since the script starts with a #!. It should have retained executable permission. I’ll check again. Sometimes SVN loses the executable status.

Installed tk package and the GUI tool appears. After picking the active and inactive colors, it gives a stdout error.
stdout-error

error writing "stdout": broken pipe
error writing "stdout": broken pipe
    while executing
"puts "Function PlainDecor $decor $colorpair(active) $colorpair(inactive)""
    invoked from within
".controls.applyquit.apply invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 22)
    invoked from within
"tk::ButtonUp .controls.applyquit.apply"
    (command bound to event)

I am not familiar with .tlc files and wish. If it works for you, then I am missing something.

Maybe the FvwmCommandS module died, or got confused about its socket. I heard it isn’t very robust, and I had that happen when I accidentally had two instances of the color picker running. There’s nothing special about tcl/tk (well, except sensible people hate it but the EDA industry is unusual that way for reasons) but FvwmCommandS (does the S stand for socket, or server?) is trying to capture its stdout. and it looks like something happened to the socket. I’d kill and restart Module FvwmCommandS, after all possible instances of pixelcapture have been killed. If you ran the pixelpicker from the command line, it would output a command like “Function PlainDecor plain #d9d9d9 #000000” which is what FvwmCommandS is supposed to intercept and execute.

Without using the FvwmCommandS but terminal command ./pixelcapture.tcl that works fine and gives the output Function PlainDecor plain #d9d9d9 #6e8c85. Can it be used?

EDIT
To use Bash, awk and sed. Make a variable of the output of column 4 (print $4) and 5 (print $5), and then edit (sed) decor-setup.fvwm line 91 and 92.

active=$(awk '{ print $4 }' output.txt
inactive=$(awk '{ print $5 }' output.txt

The color picker is invoked like this
Exec $[DecorDemoHome]/pixelcapture.tcl $0 | FvwmCommand -c

So it’s just piping the output string to FvwmCommandS, which has a socket for it, or should. It needs to be started in the StartFunction with “Module FvwmCommandS”

It occurs to me that I’m running fairly conservative versions of fvwm2. FvwmCommand seems to be a rather obscure feature. It took me awhile to hunt it down. If you’re using fvwm3, maybe it’s not working? I’ll try compiling fvwm3 to investigate.

Screenshot 2023-05-14 at 8.28.59 AM
Screenshot 2023-05-14 at 9.25.11 AM

I edited my previous post at the same time you posted… take a look.

So you avoid FvwmCommand entirely this way? I’ll give it a try.

Oops, that gets us back to where I started. The problem isn’t getting the output, it’s WAITING for the output. So even if we write to a file, something has to detect when the file exists and then find some way to asynchronously process it. I started with a PipeRead, but that’s TOO blocking - it hangs the whole window manager. Hence FvwmCommand. Have to take a break now, back tomorrow.

I got fvwm3 to compile on my Linux Mint, and – sure enough - my pixelcapture thing doesn’t work. If you paste its output into the console, it does.

I think the thing to do is file a bug against FvwmCommand
I filed a bug on fvwm3 at github.

Good, thanks.
For the time being it requires two steps to do the color-picker. 1) Exec $[DecorDemoHome]/pixelcapture.tcl and 2) to add the output in PickColorsFromBG function.

I have a similar case with another script. To make it look like “this is how it works”, I will embed the pixelcapture.tcl in a FvwmButton with one button. Ask the user to select the colors and then click the button that adds the output and runs the function.

Huh, that’s an interesting solution. I thought I would have to re-write it in FvwmScript. I think it could be done, but after looking at that language I don’t want it to be me :-)