ags: some migration

i cry
This commit is contained in:
end-4
2023-12-29 18:17:08 +07:00
parent 0f91b010a6
commit 10bc1c4ef8
16 changed files with 551 additions and 569 deletions
+19 -22
View File
@@ -138,14 +138,11 @@ const Taskbar = () => Widget.Box({
})
}],
],
connections: [
// [Hyprland, (box) => box._update(box)],
[Hyprland, (box, address) => box._add(box, address), 'client-added'],
[Hyprland, (box, address) => box._remove(box, address), 'client-removed'],
],
setup: (self) => {
self.hook(Hyprland, (box, address) => box._add(box, address), 'client-added')
.hook(Hyprland, (box, address) => box._remove(box, address), 'client-removed')
Utils.timeout(100, () => self._update(self));
}
},
});
const PinnedApps = () => Widget.Box({
@@ -166,18 +163,18 @@ const PinnedApps = () => Widget.Box({
app.launch();
},
onMiddleClick: () => app.launch(),
tooltipText: app.name,
setup: (self) => {
self.revealChild = true;
},
tooltipText: app.name,
connections: [[Hyprland, button => {
const running = Hyprland.clients
.find(client => client.class.toLowerCase().includes(term)) || false;
self.hook(Hyprland, button => {
const running = Hyprland.clients
.find(client => client.class.toLowerCase().includes(term)) || false;
button.toggleClassName('notrunning', !running);
button.toggleClassName('focused', Hyprland.active.client.address == running.address);
button.set_tooltip_text(running ? running.title : app.name);
}, 'notify::clients']],
button.toggleClassName('notrunning', !running);
button.toggleClassName('focused', Hyprland.active.client.address == running.address);
button.set_tooltip_text(running ? running.title : app.name);
}, 'notify::clients')
},
})
newButton.revealChild = true;
return newButton;
@@ -238,13 +235,13 @@ export default () => {
transition: 'slide_up',
transitionDuration: 200,
child: dockContent,
connections: [
// [Hyprland, (self) => self._updateShow(self)],
// [Hyprland.active.workspace, (self) => self._updateShow(self)],
// [Hyprland.active.client, (self) => self._updateShow(self)],
// [Hyprland, (self) => self._updateShow(self), 'client-added'],
// [Hyprland, (self) => self._updateShow(self), 'client-removed'],
],
// setup: (self) => self
// .hook(Hyprland, (self) => self._updateShow(self))
// .hook(Hyprland.active.workspace, (self) => self._updateShow(self))
// .hook(Hyprland.active.client, (self) => self._updateShow(self))
// .hook(Hyprland, (self) => self._updateShow(self), 'client-added')
// .hook(Hyprland, (self) => self._updateShow(self), 'client-removed')
// ,
})
return EventBox({
onHover: () => {