X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f5700be12b68f73d20e26a7293881707897d8f04..5f1fd821a0ebbb2d61cb3c382ca199d109e4bbd8:/helpers.lua diff --git a/helpers.lua b/helpers.lua index 50254c1..8eed10f 100644 --- a/helpers.lua +++ b/helpers.lua @@ -144,6 +144,16 @@ end -- {{{ Misc +-- check if an element exist on a table +function helpers.element_in_table(element, tbl) + for _, i in pairs(tbl) do + if i == element then + return true + end + end + return false +end + -- iterate over table of records sorted by keys function helpers.spairs(t) -- collect the keys