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

Style syntax matching: Class, Name, Resource, Icon, WindowID #1162

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

ThomasAdam
Copy link
Member

@ThomasAdam ThomasAdam commented Jan 26, 2025

Historically, there was always a demand to do something radical with Styles. This change takes a small step to that by conditionally including matches on a window for its:

  • Name (WM_NAME)
  • Class (WM_CLASS)
  • Resource (WM_CLASS)
  • Icon
  • WindowID

Hence with this change it's now possible to do:

Style (Class XTerm, Name FvwmPrompt) StartShaded
Style XTerm StartIconic

Here, if a window whose Class matches XTerm, AND its Name matched FvwmPrompt, then it would be started shaded.

If any other window just had a name/class/resource of XTerm, then it would be started iconic.

@ThomasAdam ThomasAdam added the type:enhancement Augmenting an existing feature label Jan 26, 2025
@ThomasAdam ThomasAdam added this to the 1.1.2 milestone Jan 26, 2025
@ThomasAdam ThomasAdam self-assigned this Jan 26, 2025
@ThomasAdam ThomasAdam added the type:breaking Issue is not backwards-compatible and will break configs/build label Jan 27, 2025
@ThomasAdam ThomasAdam force-pushed the ta/stylev3 branch 6 times, most recently from d134ba2 to 75a6de5 Compare January 31, 2025 16:13
@ThomasAdam ThomasAdam marked this pull request as ready for review February 5, 2025 22:34
@ThomasAdam ThomasAdam force-pushed the ta/stylev3 branch 2 times, most recently from 3c0ed9d to 05de703 Compare February 6, 2025 19:51
Historically, window style matching relied on fvwm matching a window's
name or resource or class, etc., in a hard-coded order, with very little
means of being able to specify those properties.

With this change, it's now possible to specify the following attributes
a window should match against, either individually or in combination:

 - Resource
 - Class
 - Name
 - Icon
 - WindowID

For example:

  Style (Name foo, Class XTerm) Sticky

Would only make the window sticky if its name matched "foo", and its
class is "XTerm".

Existing style lines such as:

  Style foo Sticky

Still work as expected.

In addition, this change also removes the "PrintInfo style" command as
it is no longer useful with this change to styles.
@ThomasAdam ThomasAdam merged commit 3f4f035 into main Feb 6, 2025
12 checks passed
@ThomasAdam ThomasAdam deleted the ta/stylev3 branch February 6, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:breaking Issue is not backwards-compatible and will break configs/build type:enhancement Augmenting an existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant