aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2013-03-08 23:33:30 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2013-03-08 23:33:30 -0500
commit708ca4356f4ebdf0af16fed833f2510236bd6f97 (patch)
treea2615bcca64458373980ef4e6261145e3dffa5a3
parent0280ad6dacb68b5b7431b05855b0226454c3b34c (diff)
Only consider visible directories in _USERHOME/themes/ as themes; core/gui.lua
-rw-r--r--core/gui.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/gui.lua b/core/gui.lua
index 0f856c58..e6ccb9aa 100644
--- a/core/gui.lua
+++ b/core/gui.lua
@@ -226,11 +226,15 @@ end
function gui.select_theme()
local themes, themes_found = {}, {}
for theme in lfs.dir(_HOME..'/themes') do
- if not theme:find('^%.%.?$') then themes_found[theme] = true end
+ if not theme:find('^%.') then themes_found[theme] = true end
end
if lfs.attributes(_USERHOME..'/themes') then
- for theme in lfs.dir(_USERHOME..'/themes') do
- if not theme:find('^%.%.?$') then themes_found[theme] = true end
+ local theme_dir = _USERHOME..'/themes/'
+ for theme in lfs.dir(theme_dir) do
+ if not theme:find('^%.') and
+ lfs.attributes(theme_dir..theme, 'mode') == 'directory' then
+ themes_found[theme] = true
+ end
end
end
for theme in pairs(themes_found) do themes[#themes + 1] = theme end