aboutsummaryrefslogtreecommitdiff
path: root/dot_config/hypr/executable_games.py
blob: 3d59232a573d9bc5bd7646b87c087929fc1a89ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/python3

games = [
    ("all", "Stardew Valley"),
    ("ic", "steam_app_.*", "tile", "max"),
    ("all", "ffxiv*", "sf"),
    ("all", "Hollow Knight"),
    ("all", "HELLDIVERS*"),
    ("all", "CS", "tile", "max"),
    ("title", "Warhammer 40.000: Darktide", "tile", "max")
]

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 not tuple:
            continue

        name = game[1]
        match game[0]:
            case "ic":
                selector = f"match:initial_class \"{name}\""
            case "title":
                selector = f"match:title \"{name}\""
            case "class":
                selector = f"match:class \"{name}\""
            case "all":
                selector = f"match:title \"{name}\", match:class \"{name}\""
            case s:
                print(f"Could not find selector for \"{s}\"")
                continue

        for setting in game[2::]:
            match setting:
                case "sf":
                    conf += f"windowrule = stay_focused on, {selector}\n"
                case "tile":
                    conf += f"windowrule = tile on, {selector}\n"
                case "max":
                    conf += f"windowrule = maximize on, {selector}\n"
                case s:
                    print(f"Could not find setting \"{s}\"")
 

        conf += f"""windowrule = fullscreen on, {selector}
windowrule = monitor DP-3, {selector} 
windowrule = allows_input on, {selector}\n
"""
    f.write(conf)
    f.close()


if __name__ == "__main__":
    main()