-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Uli Schlachter wrote:
> Andrei Thorp wrote:
>> I wanna get my patches reviewed dammit ;)
> 
> Ok, here we go:
> 
>> Subject: [PATCH 1/4] Lib: hooks lib w/ awful timer wrapper functions
> [...]
>> diff --git a/lib/hooks/init.lua b/lib/hooks/init.lua
>> new file mode 100644
>> index 0000000..ec94102
>> --- /dev/null
>> +++ b/lib/hooks/init.lua
> [...]
>> +-- Register a timer just as you would with awful.hooks.timer.register, but
>> +-- with one slight twist: you set your regular speed, (optionally) your slow
>> +-- speed, and then your function.
>> +-- @param reg_time Regular speed for the widget
>> +-- @param slow_time Slow time for the widget
>> +-- @param fn The function that the timer should call
>> +-- @param descr The description of this function
>> +function timer.register(reg_time, slow_time, fn, descr)
>> +    if not slow_time then slow_time = reg_time * 4 end
>> +    registry[fn] = {
>> +        regular=reg_time,
>> +        slow=slow_time,
>> +        speed="regular",
>> +        running=true,
>> +        description=descr or "Undescribed timer"
>> +    }
>> +    timer.set_speed(registry[fn].speed, fn)
>> +end
> 
> [...] (BTW, is slow_time being nil handled anywhere?)

Ah, found it. I'd propose to move this into set_speed().

if want_slow_spped() then
local speed = v.slow or 4 * (v.regular or 42)
else
local speed = v.reguler or 42
end

(where 42 is a global config variable that the user can mess with)

Uli
- --
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQEcBAEBCAAGBQJKcYjdAAoJECLkKOvLj8sGCyIH/3KdKYXXCYZiRq2fniNbAxBG
V9+Fp7phweJaVMzwexLT4OsCqnHbnpzzTBINqnjQ2ftx1/KEPniJk7eHOT8v9U8h
iUE4f+vKLCxnVD8b7UXrNgKOVBM6BTAQXt26XSmTrDvWLWbEY3Gh8hGSTKTrw1rS
AneKdyXe3VxnwdNyIxHxZHS2GAUeaLK+KTXzu9XlTgqD+9X5jvhSbb8bE6Oltvda
KXxmcsYwHR2r4r2SoU/vtSpKA/9uv8SCOtGR0G086SYw4dcdkY9J7i0x2qiLwmOK
GJ5xH1hqFVfnUydawtojh3+n7vm7PvrIH3wvPP+EUStDGJZillDYTr7v8IjjhUA=
=FRDl
-----END PGP SIGNATURE-----

-- 
To unsubscribe, send mail to [email protected].

Reply via email to