Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FvwmBacker example #41

Merged
merged 1 commit into from
Apr 27, 2024
Merged

FvwmBacker example #41

merged 1 commit into from
Apr 27, 2024

Conversation

rasatpc
Copy link
Contributor

@rasatpc rasatpc commented Apr 19, 2024

FvwmBacker use and advance example.

Copy link
Contributor

@somiaj somiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, here are some comments to clean up the page a bit.

Comment on lines 31 to 35
{% fvwm2rc %}
AddToFunc InitFunction I Module FvwmBacker
{% endfvwm2rc %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to run modules from InitFunction, they need to be launched each time. Add this to StartFunction. In general the use of InitFunction is discouraged, instead use Test (Init) Command in the StartFunction, as done in the default-config.

Comment on lines 59 to 61
Colorset 23 Pixmap $HOME/.fvwm/images/email-thumb.png
Colorset 28 Pixmap $HOME/.fvwm/images/work-thumb.png
Colorset 25 Pixmap $HOME/.fvwm/images/misc-thumb.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use $[FVWM_USERDIR]/images/... instead.

Comment on lines 82 to 83
*FvwmBacker: Command (Desk 0, Page 0 0) Exec exec fvwm-root $HOME/.fvwm/images/web-tiled.png
*FvwmBacker: Command (Desk 0, Page 1 0) Exec exec fvwm-root $HOME/.fvwm/images/web-tiled.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is overkill, you are setting the exact same image for all pages, so just remove the , Page X Y bit. See above comment, just add a small comment stating that it is possible to control each pages, but this example doesn't need that.

Comment on lines 94 to 95
## Load
Module FvwmBacker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good practice to wrap this into the StartFunction.

Comment on lines 20 to 22
You can use the FvwmPager to move from screen to screen through each virtual
desktop set. Now that you can move easily between the desktops you can further
personalize them by giving them individual background colors.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence and mentioning FvwmPager here is a bit awkward to me. I do like that you link to it in the example below, and show that you can make the pager and the desktop match. But up here, there is no need to mention the pager, just focus on this can be used to run commands to set backgrounds on desk and/or page changes.

Comment on lines 37 to 49
{% fvwm2rc %}
*FvwmBacker: Command (Desk 0) Exec exec fvwm-root $HOME/background-mono.png
*FvwmBacker: Command (Desk 1) Exec exec fvwm-root $HOME/wallpaper-nature.jpg
{% endfvwm2rc %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add another example to state that, not only can FvwmBacker give each desktop a unique look, it can also be used to change the background for each Page as well, and then provide some examples.

@rasatpc
Copy link
Contributor Author

rasatpc commented Apr 21, 2024

All comments are updated.

Copy link
Contributor

@somiaj somiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, still a few small things I noticed (some of the configs woudln't work as written). Also you may want to comment about adding both FvwmPager and FvwmBacker to the StartFunction in your eample.

Comment on lines 32 to 35
*FvwmBacker: Command (Desk 2) Exec exec fvwm-root $HOME/wallpaper-nature.jpg
{% endfvwm2rc %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fvwm-root would fail with a .jpg image here.

Comment on lines 39 to 42
*FvwmBacker: Command (Desk 2, Page 1 1) $HOME/wallpaper-nature.jpg
{% endfvwm2rc %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example wouldn't work, first you need to run some program to set the background, such Exec exec fvwm-root. And if you are going to use $HOME, at least use $[HOME].

@rasatpc
Copy link
Contributor Author

rasatpc commented Apr 21, 2024

I will test each sample.

FvwmBacker to the StartFunction in your example.

I did a test and added in default config. Doesn't work in 1.1.1, and also not in earlier fvwm versions (1.0.6)

DestroyFunc StartFunction
AddToFunc   StartFunction
+ I Test (Init) InitBackground
+ I Module FvwmButtons RightPanel
+ I Module FvwmEvent EventNewDesk
+ I Module FvwmMFL
+ I Module FvwmBacker

With FvwmConsole..... Module FvwmBacker works fine.

@rasatpc
Copy link
Contributor Author

rasatpc commented Apr 22, 2024

Workable correction, all are tested on default config, including feh for jpg image.

@somiaj
Copy link
Contributor

somiaj commented Apr 22, 2024

@rasatpc StartFunction only runs right after the initial configuration file is parsed, so it is preferred to run stuff at start from there, so the configuration file is full read before doing anything.

Since you are testing from FvwmConsole, it won't work with StartFunction, since you have already finished initialization, when testing you'll just want to launch the module. But if your goal is for something to copy/paste into their config file then restart fvwm, StartFunction is preferable.

Comment on lines 32 to 35
*FvwmBacker: Command (Desk 2) Exec exec feh $[HOME]/wallpaper-nature.jpg
{% endfvwm2rc %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am always torn if we should use feh in examples or not, as this isn't default, and users may have other tools to choose. Probably fine to use feh here, but then there is no reason to use fvwm-root, mixing them may only lead to confusion as to why one is used on .png and one is used on .jpg. I would stick to a single option in the configuration example, then maybe add a comment about how fvwm-root only supports .xpm, .png, and .svg, and a tool like feh would support more image formats and allow you setting wallpapers per monitor (which fvwm-root cannot do).

Comment on lines 97 to 103
*FvwmBacker: Command (Desk 3) Exec exec fvwm-root $[FVWM_USERDIR]/images/misc.png
{% endfvwm2rc %}

{% fvwm2rc %}
AddToFunc StartFunction I Module FvwmPager 0 3
{% endfvwm2rc %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is little reason to seperate this into two different highlight blocks, just use a single block for this, maybe put a # Start Modules when fvwm starts. Note you also need to add FvwmBacker to this, otherwise it won't run and the configuration won't do anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before Example, it says.... "changes will not be implemented until you instruct Fvwm to update the screens
during the initialization:
AddToFunc StartFunction I Module FvwmBacker

Or, better to say it again?

About, StartFunction, I will post on forum.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the StartFunction does is well documented, this does not need to be posted on the forums. Read the manual page or https://www.fvwm.org/Wiki/Config/Functions/StartFunction/.

@rasatpc
Copy link
Contributor Author

rasatpc commented Apr 22, 2024

I found the reason why AddToFunc StartFunction I Module FvwmBacker or by adding + I Module FvwmBacker directly to function StartFunction, does not work on my config system.
It only works when all functions, modules, etc. run in one config. In my system (Kise and myExt), all run as individual small configs (scripts). For StartFunction to work, I have to add the command somewhere. This is why I don't use StartFunction except for InitBackground.

Tomorrow, I will correct the comments.

@somiaj
Copy link
Contributor

somiaj commented Apr 22, 2024

That sounds like an error with how you are setting things up. You should load all your configurations from a central config file, so you can use the StartFunction appropriately. But the StartFunction is run after fvwm has finished its initialization of the configuration file it read, if you do pass this off to other tools, yes you are correct it won't work.

@somiaj
Copy link
Contributor

somiaj commented Apr 22, 2024

Note, it is not as you said about a 'single config file', StartFunction still functions correctly if you split your config up into multiple conig files. Maybe think about your design a bit more, but that is beyond the scope of this PR. I think it is just best we recommend adding things like modules to StartFunction as that is appropriate for most users who put this into their config file and restart.

FvwmBacker use and advance example.

FvwmBacker correction

FvwmBacker  true correction

FvwmBacker more corrections
@rasatpc
Copy link
Contributor Author

rasatpc commented Apr 23, 2024

This PR is ready.

@rasatpc
Copy link
Contributor Author

rasatpc commented Apr 24, 2024

The StartFunction problem was in my system. It took some time to trace the bug.
Now, everything is working fine.

@somiaj
Copy link
Contributor

somiaj commented Apr 27, 2024

I am going to merge this. I have a few more minor updates I'll just add on top of this.

@somiaj somiaj merged commit 7e8e658 into fvwmorg:main Apr 27, 2024
@rasatpc
Copy link
Contributor Author

rasatpc commented Apr 27, 2024

Thanks, it looks great.

@rasatpc rasatpc deleted the pr-backer branch April 27, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants