diff --git a/home/services/ags/config.js b/home/services/ags/config.js index 7ff86750..4b00559e 100644 --- a/home/services/ags/config.js +++ b/home/services/ags/config.js @@ -10,6 +10,7 @@ const css = App.configDir + "/style.css"; Utils.exec(`sass ${scss} ${css}`); App.connect("config-parsed", () => print("config parsed")); + export default { style: css, closeWindowDelay: { @@ -30,7 +31,10 @@ function addWindows(windows) { windows.forEach((win) => App.addWindow(win)); } -Utils.idle(() => +//timeout to wait for Hyprland service to be fully +//initialized. Maybe connect to Hyprland signal like +//notify::worksapces for more consistant results? +Utils.timeout(100, () => addWindows( [ Bar(), diff --git a/home/services/ags/windows/bar/main.js b/home/services/ags/windows/bar/main.js index 0272f918..cb1398fc 100644 --- a/home/services/ags/windows/bar/main.js +++ b/home/services/ags/windows/bar/main.js @@ -30,7 +30,7 @@ const SystemInfo = () => }, ); -const Start = Widget.Box({ +const Start = () => Widget.Box({ hexpand: true, hpack: "start", children: [ @@ -39,13 +39,13 @@ const Start = Widget.Box({ ], }); -const Center = Widget.Box({ +const Center = () => Widget.Box({ children: [ Music(), ], }); -const End = Widget.Box({ +const End = () => Widget.Box({ hexpand: true, hpack: "end", @@ -67,8 +67,8 @@ export default () => child: Widget.CenterBox({ className: "bar", - startWidget: Start, - centerWidget: Center, - endWidget: End, + startWidget: Start(), + centerWidget: Center(), + endWidget: End(), }), }); diff --git a/home/services/ags/windows/osd/main.js b/home/services/ags/windows/osd/main.js index 4ba6db76..a41b0fc7 100644 --- a/home/services/ags/windows/osd/main.js +++ b/home/services/ags/windows/osd/main.js @@ -28,7 +28,7 @@ Brightness.connect("screen-changed", () => { let lastMonitor; -const child = Widget.Box({ +const child = () => Widget.Box({ hexpand: true, visible: false, className: "osd", @@ -72,7 +72,7 @@ export default () => PopupWindow({ name: "osd", monitor: 0, - child, + child: child(), revealerSetup: (self) => self .hook(Indicators, (revealer, _, visible) => { diff --git a/home/services/ags/windows/system-menu/battery_info.js b/home/services/ags/windows/system-menu/battery_info.js index 9b6ab194..646ca1e1 100644 --- a/home/services/ags/windows/system-menu/battery_info.js +++ b/home/services/ags/windows/system-menu/battery_info.js @@ -5,11 +5,11 @@ const batteryEnergy = () => { return Battery.energyRate > 0.1 ? `${Battery.energyRate.toFixed(1)} W ` : ""; }; -const BatteryIcon = Widget.Icon() +const BatteryIcon = () => Widget.Icon() .bind("icon", Battery, "percent", () => Battery.iconName) .bind("tooltip-text", Battery, "energy-rate", batteryEnergy); -const BatteryPercent = Widget.Label() +const BatteryPercent = () => Widget.Label() .bind( "label", Battery, @@ -17,7 +17,7 @@ const BatteryPercent = Widget.Label() (percent) => `${percent}%`, ); -const BatteryTime = Widget.Label({ +const BatteryTime = () => Widget.Label({ className: "time", vexpand: true, vpack: "center", @@ -25,18 +25,18 @@ const BatteryTime = Widget.Label({ .bind("label", Battery, "charging", batteryTime) .bind("label", Battery, "energy-rate", batteryTime); -const BatteryBox = Widget.Box({ +const BatteryBox = () => Widget.Box({ className: "battery-box", visible: Battery.available, children: [ - BatteryIcon, - BatteryPercent, - BatteryTime, + BatteryIcon(), + BatteryPercent(), + BatteryTime(), ], }); -const PowerButton = Widget.Button({ +const PowerButton = () => Widget.Button({ className: "button disabled", hexpand: true, hpack: "end", @@ -54,7 +54,7 @@ export default () => className: "battery-info", children: [ - BatteryBox, - PowerButton, + BatteryBox(), + PowerButton(), ], }); diff --git a/home/services/ags/windows/system-menu/main.js b/home/services/ags/windows/system-menu/main.js index 698e6804..51cda93e 100644 --- a/home/services/ags/windows/system-menu/main.js +++ b/home/services/ags/windows/system-menu/main.js @@ -6,7 +6,7 @@ import PowerProfiles from "./powerprofiles.js"; // import Sliders from "./sliders.js"; import BatteryInfo from "./battery_info.js"; -const SystemMenuBox = Widget.Box({ +const SystemMenuBox = () => Widget.Box({ className: "system-menu", vertical: true, @@ -23,5 +23,5 @@ export default () => monitor: 0, anchor: ["top", "right"], name: "system-menu", - child: SystemMenuBox, + child: SystemMenuBox(), }); diff --git a/home/services/ags/windows/system-menu/powerprofiles.js b/home/services/ags/windows/system-menu/powerprofiles.js index bc894b22..42daacde 100644 --- a/home/services/ags/windows/system-menu/powerprofiles.js +++ b/home/services/ags/windows/system-menu/powerprofiles.js @@ -40,7 +40,7 @@ const makeProfiles = (profiles) => }) ); -const ActiveProfile = Profile({ +const ActiveProfile = () => Profile({ props: { className: "current-profile", }, @@ -50,7 +50,7 @@ const ActiveProfile = Profile({ self.bind("label", PowerProfiles, "active-profile", prettyName), }); -const ProfileRevealer = Widget.Revealer({ +const ProfileRevealer = () => Widget.Revealer({ revealChild: false, transition: "slide_down", @@ -76,8 +76,8 @@ export default () => Widget.Box({ vertical: true, children: [ - ActiveProfile, - ProfileRevealer, + ActiveProfile(), + ProfileRevealer(), ], }), ],