diff options
author | David Phillips <david@sighup.nz> | 2017-05-11 15:21:59 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-05-11 15:21:59 +1200 |
commit | 0d9affe79d1557baedf010411799abdc1734773e (patch) | |
tree | 740854514ade1df1ec8dd814bab28d3f07c6d717 | |
parent | 6757e6daf68ce27786dfae2f9e1da1222ee3e976 (diff) | |
download | petrichor-0d9affe79d1557baedf010411799abdc1734773e.tar.xz |
Poll for the presence of `lightdm` variable
Fixes an issue reported by Oscifer on the AUR package.
webkit2 greeter devs report that this should be fixed in version 3
of the greeter with a callback being introduced.
-rw-r--r-- | index.html | 5 | ||||
-rw-r--r-- | petrichor.js | 14 |
2 files changed, 15 insertions, 4 deletions
@@ -2,11 +2,8 @@ <head> <link rel="stylesheet" type="text/css" href="petrichor.css" /> <script src="petrichor.js" type="text/javascript"></script> - <script type="text/javascript"> - start(); - </script> </head> - <body onclick="reset();" onload="load();"> + <body onclick="reset();"> <div id="date-container"> <div id="date"></div> <div id="time"></div> diff --git a/petrichor.js b/petrichor.js index dd20bfe..bcb14d6 100644 --- a/petrichor.js +++ b/petrichor.js @@ -174,4 +174,18 @@ function load() { update_time(); build_session_list(); + start(); } + +/* Temporary hack until webkit greeter 3. + * The fact this is needed frankly makes me shudder. */ +function try_load() +{ + if (typeof lightdm !== 'undefined') { + load(); + } else { + setTimeout(try_load, 500); + } +} + +window.onload = try_load; |