From d3ae7475fa1c1d813ada8c406513a6172dfef339 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Fri, 27 Mar 2020 16:05:10 +0100 Subject: [PATCH] Scale wibar and font based on dpi --- theme.lua | 6 ++++-- widgets.lua | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/theme.lua b/theme.lua index 27ecd5a..36e2dc5 100644 --- a/theme.lua +++ b/theme.lua @@ -1,11 +1,13 @@ -- {{{ Main + +local awful = require("awful") theme = {} theme.wallpaper = "~/.wallpaper" -- }}} -- {{{ Styles -theme.fontface = "Dina" -theme.fontsize = 8 +theme.fontface = "Menlo for Powerline" +theme.fontsize = math.floor(awful.screen.focused().dpi / 8) theme.font = theme.fontface .. " " .. theme.fontsize -- {{{ Colors diff --git a/widgets.lua b/widgets.lua index 24e4072..018cd0c 100644 --- a/widgets.lua +++ b/widgets.lua @@ -41,12 +41,12 @@ local function setup() leftwibar[s] = awful.wibar({ position = "left", screen = s, - width = 18 + width = math.floor(s.dpi / 5) }) rightwibar[s] = awful.wibar({ position = "right", screen = s, - width = 18 + width = math.floor(s.dpi / 5) }) -- {{{ create containers