Just sets GAP_* constants within script.lua with others

This commit is contained in:
Samuel FORESTIER 2019-03-29 22:33:27 +01:00
parent e6d89ff9eb
commit 2ea8608abe
2 changed files with 12 additions and 5 deletions

@ -5,13 +5,11 @@
local SimpleConkyScript = require('script')
-- Here we'll try to get the screen definition to adjust the Conky position on the desktop
-- Here we'll try to get the screen definition and gaps to adjust the Conky surface on the screen.
local WIDTH, HEIGHT = SimpleConkyScript.get_screen_definition()
------------------------------------------------------------------------------------------
local GAP_X, GAP_Y = SimpleConkyScript.get_gaps()
--------------------------------------------------------------------------------------------------
-- Set your gaps here
GAP_X, GAP_Y = 10, 10
---------------------
conky.config = {
alignment = 'top_left',

@ -6,6 +6,9 @@ local signal = require('posix.signal')
-----------------------------------------------------------------------------------------
-- Little gaps between screen borders and Conky surface.
local GAP_X, GAP_Y = 10, 10
-- Width of the two 'columns' which will contain all the elements
local COLUMNS_WIDTH = 310
@ -224,6 +227,12 @@ function SimpleConkyScript.get_screen_definition()
end
-- Another one little function to retrieve the gaps set within this module !
function SimpleConkyScript.get_gaps()
return GAP_X, GAP_Y
end
-- The IPv6 addresses are too long for this column size, here is a function to make them "stream" on the screen.
local function _stream_ipv6_address(address)
local quantum = string.len(address) / 2