2023-10-12 19:37:26 -04:00
|
|
|
import { App, Hyprland, Widget } from '../../imports.js';
|
2023-10-30 22:00:46 -04:00
|
|
|
const { Box, Overlay } = 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';
|
2023-10-30 22:00:46 -04:00
|
|
|
import { Highlighter, updateCurrentWorkspace } from './current-workspace.js';
|
2023-09-23 18:41:05 -04:00
|
|
|
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-20 23:11:21 -04:00
|
|
|
getWorkspaces(box);
|
|
|
|
updateWorkspaces(box);
|
|
|
|
updateClients(box);
|
2023-10-30 22:00:46 -04:00
|
|
|
updateCurrentWorkspace(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-10-20 23:11:21 -04:00
|
|
|
name: 'overview',
|
2023-10-24 17:26:38 -04:00
|
|
|
closeOnUnfocus: 'none',
|
2023-10-30 22:00:46 -04:00
|
|
|
onOpen: child => update(child.child),
|
2023-09-19 23:24:46 -04:00
|
|
|
|
2023-10-30 22:00:46 -04:00
|
|
|
child: Overlay({
|
|
|
|
setup: self => {
|
|
|
|
self.set_overlay_pass_through(
|
|
|
|
self.get_children()[1],
|
|
|
|
true,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
overlays: [Highlighter()],
|
|
|
|
child: Box({
|
|
|
|
className: 'overview',
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
|
|
|
Box({
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
|
|
|
WorkspaceRow('normal', 0),
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
Box({
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
|
|
|
WorkspaceRow('special', 0),
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
connections: [[Hyprland, self => {
|
|
|
|
if (!App.getWindow('overview').visible)
|
|
|
|
return;
|
2023-10-12 19:37:26 -04:00
|
|
|
|
2023-10-30 22:00:46 -04:00
|
|
|
update(self);
|
|
|
|
}]],
|
|
|
|
properties: [
|
|
|
|
['workspaces'],
|
|
|
|
],
|
|
|
|
}),
|
2023-10-20 23:11:21 -04:00
|
|
|
}),
|
2023-10-08 00:43:35 -04:00
|
|
|
|
2023-09-19 23:24:46 -04:00
|
|
|
});
|