Skip to content

Support for initialTitle and initialClass in windowrulev2 #4128

Description

@zjeffer

Description

Spotify has recently received an update that changes the title based on the song that is currently playing.
This causes my windowrulev2 regex to stop working whenever a song plays:

windowrulev2 = opacity 0.90 override 0.90 override, title:^(Spotify( Premium)?)$

If I pause the song, the opacity goes back to 0.90. If I play the song again, my opacity automatically goes back to 1.


To fix this, it would be great if initialTitle and initialClass could also be used to match windows.
For instance, these are the properties for a spotify window when a song is playing:

class: 
title: Artist - Song
initialClass: 
initialTitle: Spotify Premium

When a song isn't playing, title is Spotify Premium.
I tried this:

windowrulev2 = opacity 0.90 override 0.90 override, initialTitle:^(Spotify( Premium)?)$

Sadly, this doesn't seem to work, I get the red bar up top with message: Config error at line 18 [...] Invalid rulev2 syntax: initialTitle:^(Spotify( Premium)?)$.

(Also, for some reason, if I try it with initialtitle (without capital T), it has the same behaviour as title, and doesn't show a config error? I assume you're matching something with .*title:, because asdftitle also works lol)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions