🔧 chore(scripts/config): stop using singleton instance, add type declarations(for completion)
this will make easier to work with multiple configuration files at the same time
This commit is contained in:
@@ -2,7 +2,8 @@ import { Gtk } from "ags/gtk4";
|
||||
import { Windows } from "../../windows";
|
||||
import { createBinding } from "ags";
|
||||
import { time } from "../../scripts/utils";
|
||||
import { Config } from "../../scripts/config";
|
||||
import { generalConfig } from "../../app";
|
||||
|
||||
|
||||
export const Clock = () =>
|
||||
<Gtk.Button class={createBinding(Windows.getDefault(), "openWindows").as((wins) =>
|
||||
@@ -14,7 +15,7 @@ export const Clock = () =>
|
||||
];
|
||||
}}
|
||||
label={time((dt) => dt.format(
|
||||
Config.getDefault().getProperty("clock.date_format", "string"))
|
||||
generalConfig.getProperty("clock.date_format", "string"))
|
||||
?? "An error occurred"
|
||||
)}
|
||||
/>;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Gtk } from "ags/gtk4";
|
||||
import AstalHyprland from "gi://AstalHyprland";
|
||||
import { getAppIcon, getSymbolicIcon } from "../../scripts/apps";
|
||||
import { Config } from "../../scripts/config";
|
||||
import { Separator } from "../Separator";
|
||||
import { generalConfig } from "../../app";
|
||||
import { createBinding, createComputed, createState, For, With } from "ags";
|
||||
import GObject from "gi://GObject?version=2.0";
|
||||
import { variableToBoolean } from "../../scripts/utils";
|
||||
|
||||
import GObject from "ags/gobject";
|
||||
|
||||
|
||||
const [showNumbers, setShowNumbers] = createState(false);
|
||||
export const showWorkspaceNumber = (show: boolean) =>
|
||||
setShowNumbers(show);
|
||||
@@ -83,8 +85,8 @@ export const Workspaces = () => {
|
||||
<For each={defaultWorkspaces}>
|
||||
{(ws: AstalHyprland.Workspace, i) => {
|
||||
const showId = createComputed([
|
||||
Config.getDefault().bindProperty("workspaces.always_show_id", "boolean").as(Boolean),
|
||||
Config.getDefault().bindProperty("workspaces.enable_helper", "boolean").as(Boolean),
|
||||
generalConfig.bindProperty("workspaces.always_show_id", "boolean").as(Boolean),
|
||||
generalConfig.bindProperty("workspaces.enable_helper", "boolean").as(Boolean),
|
||||
showNumbers,
|
||||
i
|
||||
], (alwaysShowIds, enableHelper, showIds, i) => {
|
||||
|
||||
Reference in New Issue
Block a user