diff --git a/_widgets/email-widget.md b/_widgets/email-widget.md
index 51462b4..61dbdeb 100644
--- a/_widgets/email-widget.md
+++ b/_widgets/email-widget.md
@@ -3,8 +3,8 @@ layout: page
---
# Email widget
-This widget consists of an icon with counter which shows number of unread emails: ![email icon](./em-wid-1.png)
-and a popup message which appears when mouse hovers over an icon: ![email popup](./em-wid-2.png)
+This widget consists of an icon with counter which shows number of unread emails: ![email icon]({{'/assets/img/screenshots/email-widget-1.png' | relative_url }})
+and a popup message which appears when mouse hovers over an icon: ![email popup]({{'/assets/img/screenshots/email-widget-2.png' | relative_url }})
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
diff --git a/_widgets/volume-widget.md b/_widgets/volume-widget.md
index 7cc5b0e..a1146c2 100644
--- a/_widgets/volume-widget.md
+++ b/_widgets/volume-widget.md
@@ -4,7 +4,7 @@ layout: page
# Volume widget
Simple and easy-to-install widget for Awesome Window Manager which represents the sound level: ![Volume Widget](
-./vol-widget-1.png)
+{{'/assets/img/screenshots/volume-widget.png' | relative_url }})
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
@@ -25,8 +25,8 @@ s.mytasklist, -- Middle widget
...
```
-- _Optional step._ In Arc icon theme the muted audio level icon (![Volume-widget](./audio-volume-muted-symbolic.png)) looks like 0 level icon, which could be a bit misleading.
- So I decided to use original muted icon for low audio level, and the same icon, but colored in red for muted audio level. Fortunately icons are in svg format, so you can easily recolor them with `sed`, so it would look like this (![Volume Widget](./audio-volume-muted-symbolic_red.png)):
+- _Optional step._ In Arc icon theme the muted audio level icon (![Volume-widget]({{'/assets/img/screenshots/audio-volume-muted-symbolic.png' | relative_url }}) looks like 0 level icon, which could be a bit misleading.
+ So I decided to use original muted icon for low audio level, and the same icon, but colored in red for muted audio level. Fortunately icons are in svg format, so you can easily recolor them with `sed`, so it would look like this (![Volume Widget]({{'/assets/img/screenshots/audio-volume-muted-symbolic_red.png' | relative_url }}))):
```bash
cd /usr/share/icons/Arc/status/symbolic &&
diff --git a/_widgets/volumearc-widget.md b/_widgets/volumearc-widget.md
index bf40ced..8b8702b 100644
--- a/_widgets/volumearc-widget.md
+++ b/_widgets/volumearc-widget.md
@@ -5,7 +5,7 @@ layout: page
Almost the same as [volumebar widget](https://github.com/streetturtle/awesome-wm-widgets/tree/master/volumebar-widget), but using arcchart:
-![screenshot](out.gif)
+![screenshot]({{'/assets/img/screenshots/volumearc-widget.gif' | relative_url }})
Supports:
- scroll up - increase volume,
diff --git a/_widgets/volumebar-widget.md b/_widgets/volumebar-widget.md
index 9478d8f..8c3848d 100644
--- a/_widgets/volumebar-widget.md
+++ b/_widgets/volumebar-widget.md
@@ -5,7 +5,7 @@ layout: page
Almost the same as volume widget, but more minimalistic:
-![screenshot](out.gif)
+![screenshot]({{'/assets/img/screenshots/volumebar-widget.gif' | relative_url }})
Supports
- scroll up - increase volume,
diff --git a/_widgets/weather-widget.md b/_widgets/weather-widget.md
index b1caae7..3a3e2ad 100644
--- a/_widgets/weather-widget.md
+++ b/_widgets/weather-widget.md
@@ -3,7 +3,7 @@ layout: page
---
# Weather widget
-![Weather Widget](./weather-widget.png)
+![Weather Widget]({{'/assets/img/screenshots/weather-widget.png' | relative_url }})
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
diff --git a/assets/img/screenshots/audio-volume-muted-symbolic.png b/assets/img/screenshots/audio-volume-muted-symbolic.png
new file mode 100644
index 0000000..b9dffd6
Binary files /dev/null and b/assets/img/screenshots/audio-volume-muted-symbolic.png differ
diff --git a/assets/img/screenshots/audio-volume-muted-symbolic.svg b/assets/img/screenshots/audio-volume-muted-symbolic.svg
new file mode 100644
index 0000000..e577d05
--- /dev/null
+++ b/assets/img/screenshots/audio-volume-muted-symbolic.svg
@@ -0,0 +1,88 @@
+
+
diff --git a/assets/img/screenshots/audio-volume-muted-symbolic_red.png b/assets/img/screenshots/audio-volume-muted-symbolic_red.png
new file mode 100644
index 0000000..f47807d
Binary files /dev/null and b/assets/img/screenshots/audio-volume-muted-symbolic_red.png differ
diff --git a/assets/img/screenshots/audio-volume-muted-symbolic_red.svg b/assets/img/screenshots/audio-volume-muted-symbolic_red.svg
new file mode 100644
index 0000000..d42c2ba
--- /dev/null
+++ b/assets/img/screenshots/audio-volume-muted-symbolic_red.svg
@@ -0,0 +1,88 @@
+
+
diff --git a/assets/img/screenshots/email-widget-1.png b/assets/img/screenshots/email-widget-1.png
new file mode 100644
index 0000000..5290ea8
Binary files /dev/null and b/assets/img/screenshots/email-widget-1.png differ
diff --git a/assets/img/screenshots/email-widget-2.png b/assets/img/screenshots/email-widget-2.png
new file mode 100644
index 0000000..0a0fd3a
Binary files /dev/null and b/assets/img/screenshots/email-widget-2.png differ
diff --git a/assets/img/screenshots/volume-widget.png b/assets/img/screenshots/volume-widget.png
new file mode 100644
index 0000000..6f09cce
Binary files /dev/null and b/assets/img/screenshots/volume-widget.png differ
diff --git a/assets/img/screenshots/volumearc-widget.gif b/assets/img/screenshots/volumearc-widget.gif
new file mode 100644
index 0000000..61fa486
Binary files /dev/null and b/assets/img/screenshots/volumearc-widget.gif differ
diff --git a/assets/img/screenshots/volumebar-widget.gif b/assets/img/screenshots/volumebar-widget.gif
new file mode 100644
index 0000000..16653c8
Binary files /dev/null and b/assets/img/screenshots/volumebar-widget.gif differ
diff --git a/assets/img/screenshots/weather-widget.png b/assets/img/screenshots/weather-widget.png
new file mode 100644
index 0000000..177b350
Binary files /dev/null and b/assets/img/screenshots/weather-widget.png differ
diff --git a/assets/js/init.js b/assets/js/init.js
index f4ee022..044e9c7 100644
--- a/assets/js/init.js
+++ b/assets/js/init.js
@@ -1,3 +1,5 @@
+---
+---
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var options = {};
@@ -49,8 +51,8 @@ particlesJS.load('particles-js', 'assets/js/particlesjs-config.json', function()
console.log('callback - particles.js config loaded');
});
-// if ('serviceWorker' in navigator) {
-// navigator.serviceWorker.register("{{ '/assets/js/service-worker.js| relative_url '}}").catch(function() {
-// console.log("Error registering service worker");
-// });
-// }
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register("assets/js/service-worker.js").catch(function(e) {
+ console.log("Error registering service worker" + e);
+ });
+}
diff --git a/assets/js/service-worker.js b/assets/js/service-worker.js
new file mode 100644
index 0000000..8ac130d
--- /dev/null
+++ b/assets/js/service-worker.js
@@ -0,0 +1,51 @@
+const CACHE_NAME = 'awmw-cache';
+const PRE_CACHED_ASSETS = [
+ '/assets/css/materialize.min.css',
+ '/assets/css/stylw.css',
+ '/assets/css/syntax1.css',
+ '/assets/js/materialize.min.js',
+ '/assets/js/particles.min.js',
+ '/assets/js/init.js',
+ '/index.html'
+];
+
+self.addEventListener('install', function(event) {
+ event.waitUntil(
+ caches.open(CACHE_NAME).then(function(cache) {
+ let cachePromises = PRE_CACHED_ASSETS.map(function(asset) {
+ var url = new URL(asset, location.href);
+ var request = new Request(url);
+ return fetch(request).then(function(response) {
+ return cache.put(asset, response);
+ });
+ });
+
+ return Promise.all(cachePromises);
+ })
+ );
+});
+
+self.addEventListener('activate', function(event) {
+ event.waitUntil(
+ caches.keys().then(function(cacheNames) {
+ return Promise.all(
+ // delete old caches
+ cacheNames.map(function(cacheName) {
+ if (cacheName !== CACHE_NAME) {
+ return caches.delete(cacheName);
+ }
+ })
+ );
+ })
+ );
+});
+
+self.addEventListener('fetch', function(event) {
+ if (event.request.headers.get('accept').startsWith('text/html')) {
+ event.respondWith(
+ fetch(event.request).catch(error => {
+ return caches.match('index.html');
+ })
+ );
+ }
+});