nixos-configs/hosts/wim/config/ags/js/overview/main.js

52 lines
1.1 KiB
JavaScript
Raw Normal View History

import { App, Hyprland, Widget } from '../../imports.js';
const { Box } = Widget;
import { PopupWindow } from '../misc/popup.js';
import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.js';
import { updateClients } from './clients.js';
function update(box) {
getWorkspaces(box);
updateWorkspaces(box);
updateClients(box);
}
export default () => PopupWindow({
name: 'overview',
transition: 'crossfade',
child: Box({
className: 'overview',
vertical: true,
children: [
Box({
vertical: true,
children: [
WorkspaceRow('normal', 0),
],
}),
Box({
vertical: true,
children: [
WorkspaceRow('special', 0),
],
}),
],
// The timeout is because the list of clients is async
setup: box => setTimeout(() => update(box), 100),
connections: [
[Hyprland, box => {
if (!App.getWindow('overview').visible)
return;
print('running overview');
update(box);
}],
],
properties: [
['workspaces'],
],
}),
});