aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/misc/vars.lua
blob: 7a5f9c8f349bc4ed95fc6cf891d3d3f1f80481b4 (plain)
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
local gears = require "gears"
local xresources = require "beautiful.xresources"
local x_col = xresources.get_current_theme()
local dpi = xresources.apply_dpi
local wibox = require "wibox"

local v = {}

v.notif_timeout = 3

v.anim_duration = 0.15
v.anim_intro = v.anim_duration / 2

function v.shape(cr,w,h)
    gears.shape.rounded_rect(cr,w,h,dpi(4))
end

v.border_width = dpi(1.5)

v.padding = dpi(4)
v.big_padding = dpi(8)

v.text_font = "Fira Code Nerd Font Mono Medium"
v.symbol_font = "Symbols Nerd Font:style=1000-em"
v.font_size = 8
v.font = v.text_font .. " " .. v.font_size

local char_width, char_height = wibox.widget {
    widget = wibox.widget.textbox,
    text = "a"
}:get_preferred_size_at_dpi(screen[1].dpi)

v.char_height = char_height
v.char_width = char_width

v.bar_size = dpi(16)

v.button_size = dpi(12)

v.colors = {
    fg = x_col.foreground,
    bg = x_col.background,

    black = x_col.color0,
    red = x_col.color1,
    green = x_col.color2,
    yellow = x_col.color3,
    blue = x_col.color4,
    pink = x_col.color5,
    cyan = x_col.color6,
    white = x_col.color7,

    bright = {
        black = x_col.color8,
        red = x_col.color9,
        green = x_col.color10,
        yellow = x_col.color11,
        blue = x_col.color12,
        pink = x_col.color13,
        cyan = x_col.color14,
        white = x_col.color15,
    },

    dim = {
        fg = "#8893a5",
        bg = "#20262e"
    }
}

-- taken from https://github.com/bew/dotfiles/blob/ab9bb1935783f7a31ef777b1d7e26d53f35df864/gui/wezterm/cfg_utils.lua
v.mods = setmetatable({ _SHORT_MAP = { C = "Control", S = "Shift", A = "Mod1", M = "Mod4" } }, {
    __index = function(self, key)
        local resolved_mods = {}
        for i = 1, #key do
            resolved_mods[i] = self._SHORT_MAP[key:sub(i, i)]
        end
        return resolved_mods
    end
})

return v