summaryrefslogtreecommitdiff
path: root/appearance.lua
blob: a5d46cf95f9c7ae962e6f527125a62097b1d7128 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
-- 外观设置(对应 appearance.conf)
-- 参考 https://wiki.hypr.land/Configuring/Basics/Variables/

hl.config({
    general = {
        -- 边距
        gaps_in  = 4,
        gaps_out = { top = 8, right = 8, bottom = 8, left = 8 },
        -- gaps_out = { top = 0, right = 0, bottom = 0, left = 0 },

        -- 边框
        border_size = 1,

        -- 边框颜色
        col = {
            active_border   = { colors = { "rgba(EFEFEF32)" }, angle = 45 },
            inactive_border = "rgba(FFFFFF00)",
        },

        -- 拖动窗口边缘缩放
        resize_on_border = false,

        -- 允许撕裂
        allow_tearing = false,

        -- 布局
        layout = "dwindle", -- dwindle, master

        -- no_focus_fallback = false
    },

    decoration = {
        -- 圆角
        rounding       = 4,
        rounding_power = 5,

        -- 窗口透明度
        active_opacity   = 1.0,
        inactive_opacity = 1.0,

        -- 阴影
        shadow = {
            enabled      = true,
            range        = 4,
            render_power = 4, -- 合法范围 1-4,旧 conf 中的 5 已超出(原值被旧解析器忽略校验)
            color        = "rgba(1a1a1aee)",
        },

        -- 模糊
        blur = {
            enabled  = true,
            size     = 4,
            passes   = 3,
            vibrancy = 0.1696,
        },
    },

    -- 动画主开关
    animations = {
        enabled = true,
    },

    dwindle = {
        -- pseudotile = true -- 伪平铺的主开关,键绑定部分另有绑定
        preserve_split = true, -- 您可能想要这个
    },

    -- 参考 https://wiki.hypr.land/Configuring/Master-Layout/
    master = {
        new_status = "master",
    },

    -- 参考 https://wiki.hypr.land/Configuring/Variables/#misc
    misc = {
        force_default_wallpaper = -1,   -- 设置为 0 或 1 以禁用动漫吉祥物壁纸
        disable_hyprland_logo   = true, -- 如果为 true,则禁用随机的 hyprland 标志 / 动漫女孩背景
    },
})

-- 曲线(对应 appearance.conf 中的 bezier)
-- 参考 https://wiki.hypr.land/Configuring/Advanced-and-Cool/Animations/#curves
--          名称,            X0,   Y0,   X1,   Y1
hl.curve("easeOutQuint",   { type = "bezier", points = { { 0.23, 1 }, { 0.32, 1 } } })
hl.curve("easeInOutCubic", { type = "bezier", points = { { 0.65, 0.05 }, { 0.36, 1 } } })
hl.curve("linear",         { type = "bezier", points = { { 0, 0 }, { 1, 1 } } })
hl.curve("almostLinear",   { type = "bezier", points = { { 0.5, 0.5 }, { 0.75, 1 } } })
hl.curve("quick",          { type = "bezier", points = { { 0.15, 0 }, { 0.1, 1 } } })

-- 动画(对应 appearance.conf 中的 animation)
-- 参考 https://wiki.hypr.land/Configuring/Advanced-and-Cool/Animations/
--           名称,           开关,  速度,   曲线,            [样式]
hl.animation({ leaf = "global",        enabled = true, speed = 10,   bezier = "default" })
hl.animation({ leaf = "border",        enabled = true, speed = 5.39, bezier = "easeOutQuint" })
hl.animation({ leaf = "windows",       enabled = true, speed = 4.79, bezier = "easeOutQuint" })
hl.animation({ leaf = "windowsIn",     enabled = true, speed = 4.1,  bezier = "easeOutQuint", style = "popin 87%" })
hl.animation({ leaf = "windowsOut",    enabled = true, speed = 3.49, bezier = "linear",       style = "popin 87%" })
hl.animation({ leaf = "fadeIn",        enabled = true, speed = 1.73, bezier = "almostLinear" })
hl.animation({ leaf = "fadeOut",       enabled = true, speed = 1.46, bezier = "almostLinear" })
hl.animation({ leaf = "fade",          enabled = true, speed = 3.03, bezier = "quick" })
hl.animation({ leaf = "layers",        enabled = true, speed = 3.81, bezier = "easeOutQuint" })
hl.animation({ leaf = "layersIn",      enabled = true, speed = 4,    bezier = "easeOutQuint", style = "fade" })
hl.animation({ leaf = "layersOut",     enabled = true, speed = 1.5,  bezier = "linear",       style = "fade" })
hl.animation({ leaf = "fadeLayersIn",  enabled = true, speed = 1.79, bezier = "almostLinear" })
hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" })
hl.animation({ leaf = "workspaces",    enabled = true, speed = 1.94, bezier = "easeInOutCubic", style = "slide" })
hl.animation({ leaf = "workspacesIn",  enabled = true, speed = 3,    bezier = "easeInOutCubic", style = "slide" })
hl.animation({ leaf = "workspacesOut", enabled = true, speed = 3,    bezier = "easeInOutCubic", style = "slide" })
hl.animation({ leaf = "zoomFactor",    enabled = true, speed = 7,    bezier = "quick" })

-- 图层规则(对应 appearance.conf 中的 layerrule)
hl.layer_rule({
    name  = "blur-waybar",
    match = { namespace = "waybar" },
    blur  = true,
})
hl.layer_rule({
    name  = "blur-wofi",
    match = { namespace = "wofi" },
    blur  = true,
})