From 5c78cf07fcc833a5f7b7f0dde8a857446732f34b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 15 Jul 2015 18:35:52 +0200 Subject: [PATCH] naughty: use beautiful.xresources.apply_dpi for margin and border --- lib/naughty/core.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/naughty/core.lua b/lib/naughty/core.lua index f7e9a9fb3..bc6579f38 100644 --- a/lib/naughty/core.lua +++ b/lib/naughty/core.lua @@ -24,6 +24,7 @@ local bt = require("beautiful") local wibox = require("wibox") local surface = require("gears.surface") local cairo = require("lgi").cairo +local dpi = require("beautiful").xresources.apply_dpi local schar = string.char local sbyte = string.byte @@ -36,8 +37,9 @@ local naughty = {} Naughty configuration - a table containing common popup settings. @table naughty.config -@tfield[opt=4] int padding Space between popups and edge of the workarea. -@tfield[opt=1] int spacing Spacing between popups. +@tfield[opt=apply_dpi(4)] int padding Space between popups and edge of the + workarea. +@tfield[opt=apply_dpi(1)] int spacing Spacing between popups. @tfield[opt={"/usr/share/pixmaps/"}] table icon_dirs List of directories that will be checked by `getIcon()`. @tfield[opt={ "png", "gif" }] table icon_formats List of formats that will be @@ -57,8 +59,8 @@ notifications, e.g. --]] -- naughty.config = { - padding = 4, - spacing = 1, + padding = dpi(4), + spacing = dpi(1), icon_dirs = { "/usr/share/pixmaps/", }, icon_formats = { "png", "gif" }, notify_callback = nil, @@ -104,16 +106,16 @@ naughty.config.presets = { -- @tfield[opt=""] string text -- @tfield[opt] int screen Defaults to `awful.screen.focused`. -- @tfield[opt=true] boolean ontop --- @tfield[opt=5] int margin --- @tfield[opt=1] int border_width +-- @tfield[opt=apply_dpi(5)] int margin +-- @tfield[opt=apply_dpi(1)] int border_width -- @tfield[opt="top_right"] string position naughty.config.defaults = { timeout = 5, text = "", screen = nil, ontop = true, - margin = 5, - border_width = 1, + margin = dpi(5), + border_width = dpi(1), position = "top_right" }