diff options
author | RaindropsSys <contact@minteck.org> | 2023-06-21 16:18:36 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-06-21 16:18:36 +0200 |
commit | c67e72c95d5fb6afef6b0b72800ea3eae4310fa1 (patch) | |
tree | 7c0a0f3209e6663fc9166004c6f55666da890156 /core | |
parent | b0d3eeb6edc4f7caf4b372cd176cd657c25d0846 (diff) | |
download | kirinos-c67e72c95d5fb6afef6b0b72800ea3eae4310fa1.tar.gz kirinos-c67e72c95d5fb6afef6b0b72800ea3eae4310fa1.tar.bz2 kirinos-c67e72c95d5fb6afef6b0b72800ea3eae4310fa1.zip |
Updated 9 files and added 281 files (automated)
Diffstat (limited to 'core')
34 files changed, 240 insertions, 5 deletions
diff --git a/core/desktop/index.html b/core/desktop/index.html index d06197b..9024117 100644 --- a/core/desktop/index.html +++ b/core/desktop/index.html @@ -6,7 +6,6 @@ <style> * { font-family: "Inter", sans-serif; - pointer-events: none; user-select: none; user-focus: none; outline: none; @@ -54,6 +53,12 @@ console.log('[status]', e.message) }); + document.getElementById("status").addEventListener("ipc-message", (event) => { + if (event.channel === "status") { + console.info("update =>", event.args[0]); + } + }) + const fs = require("fs"); if (fs.existsSync("/mango/session/config/wallpaper")) { diff --git a/core/status/icons/battery-0-charging.svg b/core/status/icons/battery-0-charging.svg new file mode 100644 index 0000000..a7688ac --- /dev/null +++ b/core/status/icons/battery-0-charging.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M15.5,44c-0.4,0-0.8-0.1-1.1-0.4c-0.3-0.3-0.4-0.6-0.4-1.1V8.7c0-0.4,0.1-0.8,0.4-1.1c0.3-0.3,0.6-0.4,1.1-0.4H20V4h8v3.2 + h4.5c0.4,0,0.8,0.1,1.1,0.4C33.9,7.9,34,8.3,34,8.7v33.8c0,0.4-0.1,0.8-0.4,1.1c-0.3,0.3-0.6,0.4-1.1,0.4H15.5z M17,41h14V10.2H17 + V41z"/> +<polygon points="25,16 20,28 23,28 23,36 28,24 25,24 "/> +</svg> diff --git a/core/status/icons/battery-0.svg b/core/status/icons/battery-0.svg new file mode 100644 index 0000000..da11590 --- /dev/null +++ b/core/status/icons/battery-0.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M450-403h60v-240h-60v240Zm30.5 150q12.5 0 21-9t8.5-21.5q0-12.5-8.625-21T480-313q-12 0-21 8.625T450-283q0 12 9 21t21.5 9ZM310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-60h280v-616H340v616Zm0 0h280-280Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-1-charging.svg b/core/status/icons/battery-1-charging.svg new file mode 100644 index 0000000..a7688ac --- /dev/null +++ b/core/status/icons/battery-1-charging.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M15.5,44c-0.4,0-0.8-0.1-1.1-0.4c-0.3-0.3-0.4-0.6-0.4-1.1V8.7c0-0.4,0.1-0.8,0.4-1.1c0.3-0.3,0.6-0.4,1.1-0.4H20V4h8v3.2 + h4.5c0.4,0,0.8,0.1,1.1,0.4C33.9,7.9,34,8.3,34,8.7v33.8c0,0.4-0.1,0.8-0.4,1.1c-0.3,0.3-0.6,0.4-1.1,0.4H15.5z M17,41h14V10.2H17 + V41z"/> +<polygon points="25,16 20,28 23,28 23,36 28,24 25,24 "/> +</svg> diff --git a/core/status/icons/battery-1.svg b/core/status/icons/battery-1.svg new file mode 100644 index 0000000..9831a68 --- /dev/null +++ b/core/status/icons/battery-1.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-60h280v-616H340v616Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-2-charging.svg b/core/status/icons/battery-2-charging.svg new file mode 100644 index 0000000..31484bb --- /dev/null +++ b/core/status/icons/battery-2-charging.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M15.5,44c-0.4,0-0.8-0.1-1.1-0.4c-0.3-0.3-0.4-0.6-0.4-1.1V8.7c0-0.4,0.1-0.8,0.4-1.1c0.3-0.3,0.6-0.4,1.1-0.4H20V4h8v3.2 + h4.5c0.4,0,0.8,0.1,1.1,0.4C33.9,7.9,34,8.3,34,8.7v33.8c0,0.4-0.1,0.8-0.4,1.1c-0.3,0.3-0.6,0.4-1.1,0.4H15.5z M17,36.6h14V10.2H17 + V36.6z"/> +<polygon points="25,16 20,28 23,28 23,36 28,24 25,24 "/> +</svg> diff --git a/core/status/icons/battery-2.svg b/core/status/icons/battery-2.svg new file mode 100644 index 0000000..26d0c19 --- /dev/null +++ b/core/status/icons/battery-2.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-148h280v-528H340v528Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-3-charging.svg b/core/status/icons/battery-3-charging.svg new file mode 100644 index 0000000..9f2d775 --- /dev/null +++ b/core/status/icons/battery-3-charging.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M33.6,7.6c-0.3-0.3-0.6-0.4-1.1-0.4H28V4h-8v3.2h-4.5c-0.4,0-0.8,0.1-1.1,0.4C14.1,7.9,14,8.3,14,8.7v33.8 + c0,0.4,0.1,0.8,0.4,1.1c0.3,0.3,0.6,0.4,1.1,0.4h17c0.4,0,0.8-0.1,1.1-0.4c0.3-0.3,0.4-0.6,0.4-1.1V8.7C34,8.3,33.9,7.9,33.6,7.6z + M31,32.2h-6.4L23,36v-3.8h-6v-22h14V32.2z"/> +<polygon points="25,24 25,16 20,28 23,28 23,32.2 24.6,32.2 28,24 "/> +</svg> diff --git a/core/status/icons/battery-3.svg b/core/status/icons/battery-3.svg new file mode 100644 index 0000000..98023a6 --- /dev/null +++ b/core/status/icons/battery-3.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-236h280v-440H340v440Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-4-charging.svg b/core/status/icons/battery-4-charging.svg new file mode 100644 index 0000000..2a3a610 --- /dev/null +++ b/core/status/icons/battery-4-charging.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M33.6,7.6c-0.3-0.3-0.6-0.4-1.1-0.4H28V4h-8v3.2h-4.5c-0.4,0-0.8,0.1-1.1,0.4C14.1,7.9,14,8.3,14,8.7v33.8 + c0,0.4,0.1,0.8,0.4,1.1c0.3,0.3,0.6,0.4,1.1,0.4h17c0.4,0,0.8-0.1,1.1-0.4c0.3-0.3,0.4-0.6,0.4-1.1V8.7C34,8.3,33.9,7.9,33.6,7.6z + M31,27.8h-4.6L23,36v-8h-3l0.1-0.2H17V10.2h14V27.8z"/> +<polygon points="25,24 25,16 20.1,27.8 26.4,27.8 28,24 "/> +</svg> diff --git a/core/status/icons/battery-4.svg b/core/status/icons/battery-4.svg new file mode 100644 index 0000000..12979e7 --- /dev/null +++ b/core/status/icons/battery-4.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-324h280v-352H340v352Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-5-charging.svg b/core/status/icons/battery-5-charging.svg new file mode 100644 index 0000000..a42609d --- /dev/null +++ b/core/status/icons/battery-5-charging.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M33.6,7.6c-0.3-0.3-0.6-0.4-1.1-0.4H28V4h-8v3.2h-4.5c-0.4,0-0.8,0.1-1.1,0.4C14.1,7.9,14,8.3,14,8.7v33.8 + c0,0.4,0.1,0.8,0.4,1.1c0.3,0.3,0.6,0.4,1.1,0.4h17c0.4,0,0.8-0.1,1.1-0.4c0.3-0.3,0.4-0.6,0.4-1.1V8.7C34,8.3,33.9,7.9,33.6,7.6z + M31,23.4h-6V24h3l-5,12v-8h-3l1.9-4.6H17V10.2h14V23.4z"/> +<polygon points="25,16 21.9,23.4 25,23.4 "/> +</svg> diff --git a/core/status/icons/battery-5.svg b/core/status/icons/battery-5.svg new file mode 100644 index 0000000..bfd4958 --- /dev/null +++ b/core/status/icons/battery-5.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-412h280v-264H340v264Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-6-charging.svg b/core/status/icons/battery-6-charging.svg new file mode 100644 index 0000000..ba3de72 --- /dev/null +++ b/core/status/icons/battery-6-charging.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M33.6,7.6c-0.3-0.3-0.6-0.4-1.1-0.4H28V4h-8v3.2h-4.5c-0.4,0-0.8,0.1-1.1,0.4C14.1,7.9,14,8.3,14,8.7v33.8 + c0,0.4,0.1,0.8,0.4,1.1c0.3,0.3,0.6,0.4,1.1,0.4h17c0.4,0,0.8-0.1,1.1-0.4c0.3-0.3,0.4-0.6,0.4-1.1V8.7C34,8.3,33.9,7.9,33.6,7.6z + M31,19h-6v5h3l-5,12v-8h-3l3.8-9H17v-8.8h14V19z"/> +<polygon points="25,16 23.8,19 25,19 "/> +</svg> diff --git a/core/status/icons/battery-6.svg b/core/status/icons/battery-6.svg new file mode 100644 index 0000000..7fd403f --- /dev/null +++ b/core/status/icons/battery-6.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-500h280v-176H340v176Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-7-charging.svg b/core/status/icons/battery-7-charging.svg new file mode 100644 index 0000000..c7ee17f --- /dev/null +++ b/core/status/icons/battery-7-charging.svg @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M33.6,7.6c-0.3-0.3-0.6-0.4-1.1-0.4H28V4h-8v3.2h-4.5c-0.4,0-0.8,0.1-1.1,0.4C14.1,7.9,14,8.3,14,8.7v33.8 + c0,0.4,0.1,0.8,0.4,1.1c0.3,0.3,0.6,0.4,1.1,0.4h17c0.4,0,0.8-0.1,1.1-0.4c0.3-0.3,0.4-0.6,0.4-1.1V8.7C34,8.3,33.9,7.9,33.6,7.6z + M23,36v-8h-3l5-12v8h3L23,36z M31,14.6H17v-4.4h14V14.6z"/> +</svg> diff --git a/core/status/icons/battery-7.svg b/core/status/icons/battery-7.svg new file mode 100644 index 0000000..2c617df --- /dev/null +++ b/core/status/icons/battery-7.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v676q0 12.75-8.625 21.375T650-80H310Zm30-588h280v-88H340v88Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-8-charging.svg b/core/status/icons/battery-8-charging.svg new file mode 100644 index 0000000..7a51140 --- /dev/null +++ b/core/status/icons/battery-8-charging.svg @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve"> +<path d="M33.4,8.6C33,8.2,32.6,8,32,8h-4V4h-8v4h-4c-0.6,0-1,0.2-1.4,0.6C14.2,9,14,9.4,14,10v32c0,0.6,0.2,1,0.6,1.4 + C15,43.8,15.4,44,16,44h16c0.6,0,1-0.2,1.4-0.6C33.8,43,34,42.6,34,42V10C34,9.4,33.8,9,33.4,8.6z M23,36v-8h-3l5-12v8h3L23,36z"/> +</svg> diff --git a/core/status/icons/battery-8.svg b/core/status/icons/battery-8.svg new file mode 100644 index 0000000..41e611d --- /dev/null +++ b/core/status/icons/battery-8.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M320-80q-17 0-28.5-11.5T280-120v-640q0-17 11.5-28.5T320-800h80v-80h160v80h80q17 0 28.5 11.5T680-760v640q0 17-11.5 28.5T640-80H320Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/battery-error.svg b/core/status/icons/battery-error.svg new file mode 100644 index 0000000..7118ade --- /dev/null +++ b/core/status/icons/battery-error.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="m656-94-42-42 84-84-84-84 42-42 84 84 84-84 42 42-83 84 83 84-42 42-84-83-84 83ZM310-80q-12.75 0-21.375-8.625T280-110v-676q0-12.75 8.625-21.375T310-816h90v-64h160v64h90q12.75 0 21.375 8.625T680-786v363q-17 5-31.5 12T620-394v-362H340v616h204q7 17 16.5 31.5T582-80H310Zm30-60h204-15 15-204Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-ethernet.svg b/core/status/icons/network-ethernet.svg new file mode 100644 index 0000000..30135ef --- /dev/null +++ b/core/status/icons/network-ethernet.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="m680-240-42-42 196-198-196-198 42-42 240 240-240 240Zm-400 0L40-480l240-240 42 42-196 198 196 198-42 42Zm40-205q-14 0-24.5-10.5T285-480q0-14 10.5-24.5T320-515q14 0 24.5 10.5T355-480q0 14-10.5 24.5T320-445Zm160 0q-14 0-24.5-10.5T445-480q0-14 10.5-24.5T480-515q14 0 24.5 10.5T515-480q0 14-10.5 24.5T480-445Zm160 0q-14 0-24.5-10.5T605-480q0-14 10.5-24.5T640-515q14 0 24.5 10.5T675-480q0 14-10.5 24.5T640-445Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-none.svg b/core/status/icons/network-none.svg new file mode 100644 index 0000000..854fa6e --- /dev/null +++ b/core/status/icons/network-none.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M818-56 703-171H248q-88 0-148-59T40-377q0-80 50.5-134T217-577q2-14 6.5-31.5T236-640L70-806l42-42L861-99l-43 43ZM248-231h397L285-591q-11 15-14.5 34t-3.5 37h-19q-62 0-105 39.5t-43 101q0 61.5 43 105T248-231Zm216-181Zm390 210-47-47q25-17 39-38t14-50q0-43-31-73.5T755-441h-67v-81q0-88-61-147.5T478.473-729Q450-729 417.5-720T358-691l-42-42q36-29 77.5-42.5T478-789q111 0 190.5 79T748-520v21q72-1 122 45t50 117q0 35-16.5 73.5T854-202ZM583-470Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-wifi-0.svg b/core/status/icons/network-wifi-0.svg new file mode 100644 index 0000000..76452ad --- /dev/null +++ b/core/status/icons/network-wifi-0.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M480-120 0-600q99-94 221-147t259-53q137 0 259 53t221 147L480-120Zm0-82 392-392q-87-68-184.5-107T480-740q-110 0-207.5 39T88-594l392 392Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-wifi-1.svg b/core/status/icons/network-wifi-1.svg new file mode 100644 index 0000000..25262d5 --- /dev/null +++ b/core/status/icons/network-wifi-1.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M480-120 0-600q97-93 220-146.5T480-800q137 0 260 53.5T960-600L480-120ZM344-338q29-23 63.5-36t72.5-13q38 0 72.5 13t63.5 36l256-256q-87-68-184.5-107T480-740q-110 0-207.5 39T88-594l256 256Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-wifi-2.svg b/core/status/icons/network-wifi-2.svg new file mode 100644 index 0000000..fb75dea --- /dev/null +++ b/core/status/icons/network-wifi-2.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M480-120 0-600q97-93 220-146.5T480-800q137 0 260 53.5T960-600L480-120ZM273-409q45-35 96.5-55T480-484q59 0 110.5 20t96.5 55l185-185q-87-68-184.5-107T480-740q-110 0-207.5 39T88-594l185 185Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-wifi-3.svg b/core/status/icons/network-wifi-3.svg new file mode 100644 index 0000000..179575c --- /dev/null +++ b/core/status/icons/network-wifi-3.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M480-120 0-600q97-93 220-146.5T480-800q137 0 260 53.5T960-600L480-120ZM197-486q62-49 132-76t151-27q81 0 151.5 27T764-486l108-108q-87-68-184.5-107T480-740q-110 0-207.5 39T88-594l109 108Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-wifi-4.svg b/core/status/icons/network-wifi-4.svg new file mode 100644 index 0000000..51722d0 --- /dev/null +++ b/core/status/icons/network-wifi-4.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M480-120 0-600q99-94 221-147t259-53q137 0 259 53t221 147L480-120Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/network-wifi-offline.svg b/core/status/icons/network-wifi-offline.svg new file mode 100644 index 0000000..3d32327 --- /dev/null +++ b/core/status/icons/network-wifi-offline.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M480-120-1-600q99-96 221.5-148T480-800q137 0 258.5 52T960-600l-35 35q-25-26-58-39.5T795-618q-78 0-133 55t-55 133q0 39 14 70.5t41 57.5L480-120Zm315-30q-15 0-25.5-10.5T759-186q0-15 10.5-25.5T795-222q15 0 25.5 10.5T831-186q0 15-10.5 25.5T795-150Zm-23-114q0-42 8-67t39-48q26-19 35-33.5t9-33.5q0-26-17.5-42.5T800-505q-29 0-48 14.5T721-451l-41-25q16-38 47-60t73-22q48 0 80.5 31t32.5 78q0 31-12.5 53T862-353q-29 23-36.5 39.5T818-264h-46Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/volume-0.svg b/core/status/icons/volume-0.svg new file mode 100644 index 0000000..5266dc0 --- /dev/null +++ b/core/status/icons/volume-0.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M813-56 681-188q-28 20-60.5 34.5T553-131v-62q23-7 44.5-15.5T638-231L473-397v237L273-360H113v-240h156L49-820l43-43 764 763-43 44Zm-36-232-43-43q20-34 29.5-71.923T773-481q0-103.322-60-184.661T553-769v-62q124 28 202 125.5T833-481q0 51-14 100t-42 93ZM643-422l-90-90v-130q47 22 73.5 66t26.5 96q0 15-2.5 29.5T643-422ZM473-592 369-696l104-104v208Zm-60 286v-150l-84-84H173v120h126l114 114Zm-42-192Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/volume-1.svg b/core/status/icons/volume-1.svg new file mode 100644 index 0000000..77a6dbd --- /dev/null +++ b/core/status/icons/volume-1.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M280-360v-240h160l200-200v640L440-360H280Zm60-60h127l113 109v-337L467-540H340v120Zm119-60Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/volume-2.svg b/core/status/icons/volume-2.svg new file mode 100644 index 0000000..233c07d --- /dev/null +++ b/core/status/icons/volume-2.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M200-360v-240h160l200-200v640L360-360H200Zm420 48v-337q54 17 87 64t33 105q0 59-33 105t-87 63ZM500-648 387-540H260v120h127l113 109v-337ZM378-480Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/volume-3.svg b/core/status/icons/volume-3.svg new file mode 100644 index 0000000..946d406 --- /dev/null +++ b/core/status/icons/volume-3.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M560-131v-62q97-28 158.5-107.5T780-481q0-101-61-181T560-769v-62q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm420 48v-337q55 17 87.5 64T660-480q0 57-33 104t-87 64ZM420-648 307-540H180v120h127l113 109v-337Zm-94 168Z"/></svg>
\ No newline at end of file diff --git a/core/status/icons/volume-none.svg b/core/status/icons/volume-none.svg new file mode 100644 index 0000000..2dfad44 --- /dev/null +++ b/core/status/icons/volume-none.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="m611-323-43-43 114-113-114-113 43-43 113 114 113-114 43 43-114 113 114 113-43 43-113-114-113 114Zm-491-37v-240h160l200-200v640L280-360H120Zm300-288L307-540H180v120h127l113 109v-337ZM311-481Z"/></svg>
\ No newline at end of file diff --git a/core/status/index.html b/core/status/index.html index eee47a7..dc9c165 100644 --- a/core/status/index.html +++ b/core/status/index.html @@ -6,7 +6,6 @@ <style> * { font-family: "Inter", sans-serif; - pointer-events: none; user-select: none; user-focus: none; outline: none; @@ -34,15 +33,145 @@ backdrop-filter: blur(50px); background-color: rgba(255, 255, 255, .5); } + + .status-bar-clickable:active { + background-color: rgba(0, 0, 0, .1); + border-radius: 5px; + } + + .n { + font-family: "Roboto Mono", monospace; + } </style> </head> <body> <div id="bg"></div> - <div id="status-bar"> - <div id="bar-left" style="display: inline-block;">left</div> - <div id="bar-right" style="margin-left: auto; display: inline-block; width: max-content; float: right;">right</div> + <div id="status-bar" style="padding: 0 20px;"> + <div id="bar-left" style="display: inline-block; height: 100%;"> + <a onclick="ipcRenderer.sendToHost('status', { action: 'clickOn', item: 'menu' });" id="mango-menu" class="status-bar-clickable" style="height: 31px; display: inline-flex; align-items: center; justify-content: center; width: 31px;"> + <img src="../../logo-symbolic.svg" style="width: 24px; pointer-events: none;"> + </a> + </div> + <div id="bar-right" style="margin-left: auto; display: inline-block; width: max-content; float: right; height: 100%;"> + <a onclick="ipcRenderer.sendToHost('status', { action: 'clickOn', item: 'volume' });" id="item-volume" class="status-bar-clickable" style="height: 31px; display: inline-flex; align-items: center; justify-content: center; width: 31px; vertical-align: middle;"> + <img id="item-volume-icon" src="" style="width: 24px; pointer-events: none; vertical-align: middle;"> + </a><a onclick="ipcRenderer.sendToHost('status', { action: 'clickOn', item: 'network' });" id="item-network" class="status-bar-clickable" style="height: 31px; display: inline-flex; align-items: center; justify-content: center; width: 31px; vertical-align: middle;"> + <img id="item-network-icon" src="" style="width: 24px; pointer-events: none; vertical-align: middle;"> + </a><a onclick="ipcRenderer.sendToHost('status', { action: 'clickOn', item: 'battery' });" id="item-battery" class="status-bar-clickable" style="height: 31px; display: inline-flex; align-items: center; justify-content: center; width: 31px; vertical-align: middle;"> + <img id="item-battery-icon" src="" style="width: 24px; pointer-events: none; vertical-align: middle;"> + </a><a onclick="ipcRenderer.sendToHost('status', { action: 'clickOn', item: 'clock' });" id="item-clock" class="status-bar-clickable" style="height: 31px; display: inline-flex; align-items: center; justify-content: center; width: max-content; vertical-align: middle;"> <span id="item-clock-week"></span> <span id="item-clock-day" class="n"></span> <span id="item-clock-month"></span> <span id="item-clock-hour" class="n"></span>:<span id="item-clock-minute" class="n"></span></a> + </div> </div> <script> + const ipcRenderer = require('electron').ipcRenderer; + const libmangoaudio = require('../../lib/libmangoaudio'); + const si = require('systeminformation'); + const wifi = require('node-wifi'); + + wifi.init({ + iface: null + }); + + setInterval(async () => { + await connectionCheck(); + }, 30000); + + function fetchTimeout(url, options, timeout = 5000) { + return Promise.race([ + fetch(url, options), + new Promise((_, reject) => + setTimeout(() => reject(new Error('timeout')), timeout) + ) + ]); + } + + async function connectionCheck() { + let online = false; + let serversList = [ + "https://connectivitycheck.grapheneos.network/generate_204", + "http://connectivitycheck.grapheneos.network/generate_204", + "http://grapheneos.online/gen_204", + "http://grapheneos.online/generate_204", + "https://www.google.com/generate_204", + "http://connectivitycheck.gstatic.com/generate_204", + "http://www.google.com/gen_204", + "http://play.googleapis.com/generate_204" + ] + + for (let server of serversList) { + try { + let res = await fetchTimeout(server, {}, 3000); + if (res.status === 204) { + online = true; + break; + } + } catch (e) {} + } + + return online; + } + + let hasInternetAccess = connectionCheck(); + + setInterval(async () => { + let dateParts = (new Intl.DateTimeFormat('en-IE', { weekday: "short", month: "short", day: "2-digit", hour: "2-digit", minute: "2-digit" })).format(new Date()).split(" ").map((i, j) => { if (j === 0 || j === 2) { return i.substring(0, i.length - 1); } else { return i; } }); + let timeParts = dateParts[3].split(":"); + + document.getElementById("item-clock-week").innerText = dateParts[0].toString(); + document.getElementById("item-clock-day").innerText = dateParts[1].toString(); + document.getElementById("item-clock-month").innerText = dateParts[2].toString(); + document.getElementById("item-clock-hour").innerText = timeParts[0]; + document.getElementById("item-clock-minute").innerText = timeParts[1]; + + let level = (await libmangoaudio.getDefaultOutput())['volume']['level']; + + if (typeof level === "number") { + if (level === 0) { + document.getElementById("item-volume-icon").src = "./icons/volume-0.svg"; + } else if (level < 100/3) { + document.getElementById("item-volume-icon").src = "./icons/volume-1.svg"; + } else if (level < 200/3) { + document.getElementById("item-volume-icon").src = "./icons/volume-2.svg"; + } else { + document.getElementById("item-volume-icon").src = "./icons/volume-3.svg"; + } + } else { + document.getElementById("item-volume-icon").src = "./icons/volume-none.svg"; + } + + let batteryInfo = await si.battery(); + let battery = batteryInfo.percent; + let charging = batteryInfo.isCharging; + let present = batteryInfo.hasBattery || batteryInfo.maxCapacity === 0 || batteryInfo.voltage === 0 || batteryInfo.designedCapacity === 0 || batteryInfo.capacityUnit === ''; + + let levelIcon = Math.floor(battery / 12.5); + let iconSuffix = charging ? "-charging" : ""; + + if (present) { + document.getElementById("item-battery-icon").src = "./icons/battery-" + levelIcon + iconSuffix + ".svg"; + } else { + document.getElementById("item-battery-icon").src = "./icons/battery-error.svg"; + } + + let online = hasInternetAccess; + let networks = wifi.getCurrentConnections(); + + if (!online) { + if (networks.length > 0) { + document.getElementById("item-network-icon").src = "./icons/network-wifi-offline.svg"; + } else { + document.getElementById("item-network-icon").src = "./icons/network-none.svg"; + } + } else { + if (networks.length > 0) { + let quality = Math.round(networks[0].quality / 25); + document.getElementById("item-network-icon").src = "./icons/network-wifi-" + quality + ".svg"; + } else { + document.getElementById("item-network-icon").src = "./icons/network-ethernet.svg"; + } + } + }, 1000); + function resizeBackground(width, height) { document.getElementById("bg").style.width = width + "px"; document.getElementById("bg").style.height = height + "px"; |