Update games for more options, try fix waybar
This commit is contained in:
@@ -1,27 +1,47 @@
|
||||
games = [
|
||||
"Stardew Valley",
|
||||
"steam_app_.*",
|
||||
("ffxiv*", "sf"),
|
||||
"Hollow Knight",
|
||||
("all", "Stardew Valley"),
|
||||
("initialclass", "steam_app_.*", "tile", "max"),
|
||||
("all", "ffxiv*", "sf"),
|
||||
("all", "Hollow Knight"),
|
||||
("all", "HELLDIVERS*")
|
||||
]
|
||||
|
||||
def main():
|
||||
f = open("config/games.conf", "w")
|
||||
conf: str = "# Auto generated window rules for Games\n\n"
|
||||
for game in games:
|
||||
if type(game) is tuple:
|
||||
name = game[0]
|
||||
for setting in game[1::]:
|
||||
match setting:
|
||||
case "sf":
|
||||
conf += f"windowrulev2 = stayfocused, class:({name}), title:({name})\n"
|
||||
else:
|
||||
name = game
|
||||
if type(game) is not tuple:
|
||||
continue
|
||||
|
||||
conf += f"""windowrulev2 = fullscreen, class:({name}), title:({name})
|
||||
windowrulev2 = monitor DP-3, class:({name}), title:({name})
|
||||
windowrulev2 = forceinput, class:({name}), title:({name})
|
||||
name = game[1]
|
||||
match game[0]:
|
||||
case "initialclass":
|
||||
selector = f"initialclass:({name})"
|
||||
case "title":
|
||||
selector = f"title:({name})"
|
||||
case "class":
|
||||
selector = f"class:({name})"
|
||||
case "all":
|
||||
selector = f"title:({name}), class:({name})"
|
||||
case s:
|
||||
print(f"Could not find selector for \"{s}\"")
|
||||
continue
|
||||
|
||||
for setting in game[2::]:
|
||||
match setting:
|
||||
case "sf":
|
||||
conf += f"windowrulev2 = stayfocused, {selector}\n"
|
||||
case "tile":
|
||||
conf += f"windowrulev2 = tile, {selector}\n"
|
||||
case "max":
|
||||
conf += f"windowrulev2 = maximize, {selector}\n"
|
||||
case s:
|
||||
print(f"Could not find setting \"{s}\"")
|
||||
|
||||
|
||||
conf += f"""windowrulev2 = fullscreen, {selector}
|
||||
windowrulev2 = monitor DP-3, {selector}
|
||||
windowrulev2 = forceinput, {selector}\n
|
||||
"""
|
||||
f.write(conf)
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user