nthnd / hypr-empty

MIT License
39 stars 4 forks source link

Multiple workspaces in 1 components statement #7

Closed alttabber closed 8 months ago

alttabber commented 8 months ago

If the config file looks like this:

[[components]]
workspaces = ["5", "6", "7", "8", "9"]
command = "rofi"
args = ["-show", "drun" ]

[[components]]
workspaces = ["1", "2"]
command = "alacritty"

hypr-empty will spawn alacritty in workspaces "1" and "2", and rofi -show drun in workspaces "5" to "9".

The workspace field is no longer supported.

DanteDragan commented 8 months ago

workspaces = ["5", "6", "7", "8", "9"]

Does language support such syntaxes workspaces = ["5-9"]?

alttabber commented 8 months ago

workspaces = ["5", "6", "7", "8", "9"]

Does language support such syntaxes workspaces = ["5-9"]?

They're exact matches for a strings, not numbers, so that won't work: it'll be interpreted as the literal string 5-9. Maybe I could change it into a regex match, but I'm not experienced with Rust and I still have to see what the program's author has to say about this. It has to be some sort of string matching since Hyprland supports naming workspaces.

Also, I feel like that going full regex to match 3 workspaces with the name known ahead of time is a bit overkill.

nthnd commented 8 months ago

Hey, thanks for this! I've switched away from hyprland and am not able to test this but I'm sure it works fine.