Added strict type checking to the project. (#236)

* Implement strict typing (WIP).

* changes

* Finish type checks

* Fix notification icon, matugen settings and update tsconfig.

* OSD Styling updates and added the ability to configure OSD duration.
This commit is contained in:
Jas Singh
2024-09-09 00:44:51 -07:00
committed by GitHub
parent 41dbc3829a
commit bb3b3dfdfb
56 changed files with 468 additions and 240 deletions

View File

@@ -9,6 +9,7 @@ const audio = await Service.import("audio")
const {
enable,
duration,
orientation,
location,
active_monitor,
@@ -21,8 +22,6 @@ hyprland.active.connect("changed", () => {
curMonitor.value = hyprland.active.monitor.id;
})
const DELAY = 2500;
let count = 0
const handleReveal = (self: any, property: string) => {
if (!enable.value) {
@@ -30,7 +29,7 @@ const handleReveal = (self: any, property: string) => {
}
self[property] = true
count++
Utils.timeout(DELAY, () => {
Utils.timeout(duration.value, () => {
count--
if (count === 0)
@@ -39,8 +38,6 @@ const handleReveal = (self: any, property: string) => {
}
const renderOSD = () => {
return Widget.Revealer({
transition: "crossfade",
reveal_child: false,
@@ -72,16 +69,16 @@ const renderOSD = () => {
children: orientation.bind("value").as(ort => {
if (ort === "vertical") {
return [
OSDLabel(ort),
OSDLabel(),
OSDBar(ort),
OSDIcon(ort)
OSDIcon()
]
}
return [
OSDIcon(ort),
OSDIcon(),
OSDBar(ort),
OSDLabel(ort),
OSDLabel(),
]
})
})