aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-05-11 15:21:59 +1200
committerDavid Phillips <david@sighup.nz>2017-05-11 15:21:59 +1200
commit0d9affe79d1557baedf010411799abdc1734773e (patch)
tree740854514ade1df1ec8dd814bab28d3f07c6d717
parent6757e6daf68ce27786dfae2f9e1da1222ee3e976 (diff)
downloadpetrichor-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.html5
-rw-r--r--petrichor.js14
2 files changed, 15 insertions, 4 deletions
diff --git a/index.html b/index.html
index 4ed4e6b..9eb88d2 100644
--- a/index.html
+++ b/index.html
@@ -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;