X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/8d37b9a1e4521a220f20ce2e1414f656aa3a5015..4c9f01221f1b105f43a2338db60f321da8fee87c:/helpers.lua diff --git a/helpers.lua b/helpers.lua index a8c4cd7..c42ce61 100644 --- a/helpers.lua +++ b/helpers.lua @@ -1,15 +1,17 @@ --[[ - - Licensed under GNU General Public License v2 - * (c) 2013, Luke Bonham - * (c) 2010-2012, Peter Hofmann - + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + --]] local debug = require("debug") -local rawget = rawget + +local capi = { timer = timer } local io = { open = io.open } +local rawget = rawget -- Lain helper functions for internal use -- lain.helpers @@ -28,7 +30,7 @@ end -- }}} --- {{{ Read the first line of a file or return nil. +-- {{{ Read the first line of a file or return nil function helpers.first_line(f) local fp = io.open(f) @@ -44,12 +46,12 @@ end -- }}} --- {{{ Timer maker +-- {{{ Timer maker helpers.timer_table = {} function helpers.newtimer(name, timeout, fun, nostart) - helpers.timer_table[name] = timer({ timeout = timeout }) + helpers.timer_table[name] = capi.timer({ timeout = timeout }) helpers.timer_table[name]:connect_signal("timeout", fun) helpers.timer_table[name]:start() if not nostart then