X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/eb8cec907a50f3fd6df4b14ae10b910444017f92..fa1baa8997253a31c90c3ef363dbf0596b9165fd:/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