2023-10-12 19:37:26 -04:00
|
|
|
import { App, Hyprland, Widget } from '../../imports.js';
|
2023-10-08 00:43:35 -04:00
|
|
|
const { Box } = Widget;
|
2023-09-19 23:24:46 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
import PopupWindow from '../misc/popup.js';
|
2023-09-23 18:41:05 -04:00
|
|
|
import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.js';
|
|
|
|
import { updateClients } from './clients.js';
|
2023-09-19 23:24:46 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
|
2023-10-12 19:37:26 -04:00
|
|
|
function update(box) {
|
2023-10-13 10:25:56 -04:00
|
|
|
getWorkspaces(box);
|
|
|
|
updateWorkspaces(box);
|
|
|
|
updateClients(box);
|
2023-10-12 19:37:26 -04:00
|
|
|
}
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-10-16 18:11:19 -04:00
|
|
|
export default () => PopupWindow({
|
2023-09-23 18:41:05 -04:00
|
|
|
name: 'overview',
|
2023-10-08 00:43:35 -04:00
|
|
|
transition: 'crossfade',
|
2023-10-17 13:47:02 -04:00
|
|
|
onOpen: child => update(child),
|
2023-09-19 23:24:46 -04:00
|
|
|
|
2023-10-08 00:43:35 -04:00
|
|
|
child: Box({
|
|
|
|
className: 'overview',
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
|
|
|
Box({
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
|
|
|
WorkspaceRow('normal', 0),
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
Box({
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
|
|
|
WorkspaceRow('special', 0),
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
],
|
2023-10-17 13:47:02 -04:00
|
|
|
connections: [[Hyprland, self => {
|
|
|
|
if (!App.getWindow('overview').visible)
|
|
|
|
return;
|
2023-10-12 19:37:26 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
update(self);
|
|
|
|
}]],
|
2023-10-08 00:43:35 -04:00
|
|
|
properties: [
|
|
|
|
['workspaces'],
|
|
|
|
],
|
2023-09-19 23:24:46 -04:00
|
|
|
}),
|
2023-10-08 00:43:35 -04:00
|
|
|
|
2023-09-19 23:24:46 -04:00
|
|
|
});
|