dots/.config/awesome/misc/vars.lua

82 lines
1.8 KiB
Lua

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