summaryrefslogtreecommitdiff
path: root/src/modules/osds.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-22 19:58:07 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-22 19:58:07 +1100
commitcf55e2613314e27243c60395e58665b9309280c8 (patch)
tree572b6226dad2c84621deb33d765d5a67454fc842 /src/modules/osds.tsx
parentscss: make notifpopup shadow default (diff)
downloadcaelestia-shell-cf55e2613314e27243c60395e58665b9309280c8.tar.gz
caelestia-shell-cf55e2613314e27243c60395e58665b9309280c8.tar.bz2
caelestia-shell-cf55e2613314e27243c60395e58665b9309280c8.zip
config: use config file
Config file at ~/.config/caelestia/shell.json
Diffstat (limited to 'src/modules/osds.tsx')
-rw-r--r--src/modules/osds.tsx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/osds.tsx b/src/modules/osds.tsx
index f95053e..4bbc87b 100644
--- a/src/modules/osds.tsx
+++ b/src/modules/osds.tsx
@@ -1,6 +1,6 @@
import Monitors, { type Monitor } from "@/services/monitors";
import PopupWindow from "@/widgets/popupwindow";
-import { execAsync, register, timeout, Variable, type Time } from "astal";
+import { bind, execAsync, register, timeout, Variable, type Time } from "astal";
import { App, Astal, Gtk, Widget } from "astal/gtk3";
import cairo from "cairo";
import { osds as config } from "config";
@@ -52,13 +52,13 @@ const SliderOsd = ({
name={type}
monitor={monitor?.id}
keymode={Astal.Keymode.NONE}
- anchor={config[type].position}
- margin={config[type].margin}
+ anchor={bind(config[type].position)}
+ margin={bind(config[type].margin)}
setup={self => {
let time: Time | null = null;
const hideAfterTimeout = () => {
time?.cancel();
- time = timeout(config[type].hideDelay, () => self.hide());
+ time = timeout(config[type].hideDelay.get(), () => self.hide());
};
self.connect("show", hideAfterTimeout);
windowSetup(self, () => {
@@ -74,8 +74,8 @@ const SliderOsd = ({
setup={self => {
const halfPi = Math.PI / 2;
const vertical =
- config[type].position === Astal.WindowAnchor.LEFT ||
- config[type].position === Astal.WindowAnchor.RIGHT;
+ config[type].position.get() === Astal.WindowAnchor.LEFT ||
+ config[type].position.get() === Astal.WindowAnchor.RIGHT;
const icon = Variable("");
drawAreaSetup(self, icon);
@@ -134,7 +134,7 @@ const SliderOsd = ({
// Progress number, at top/right
let nw = 0;
let nh = 0;
- if (config[type].showValue) {
+ if (config[type].showValue.get()) {
const numLayout = parent.create_pango_layout(String(Math.round(progressValue * 100)));
[nw, nh] = numLayout.get_pixel_size();
let diff;
@@ -295,7 +295,7 @@ class LockOsd extends Widget.Window {
const child = this.get_child();
if (!child) return;
this[right ? "marginLeft" : "marginRight"] = window.visible
- ? child.get_preferred_width()[1] + config.lock.spacing
+ ? child.get_preferred_width()[1] + config.lock.spacing.get()
: 0;
}
});
@@ -311,7 +311,7 @@ class LockOsd extends Widget.Window {
super.show();
this.#update();
this.#timeout?.cancel();
- this.#timeout = timeout(config.lock[this.lockType].hideDelay, () => this.hide());
+ this.#timeout = timeout(config.lock[this.lockType].hideDelay.get(), () => this.hide());
}
}