2024-01-30 11:29:07 -05:00
|
|
|
const Applications = await Service.import('applications');
|
|
|
|
const Hyprland = await Service.import('hyprland');
|
|
|
|
const { Box, Icon, Label } = Widget;
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2024-01-13 23:38:31 -05:00
|
|
|
import Separator from '../../misc/separator.ts';
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-12-05 12:04:08 -05:00
|
|
|
const SPACING = 8;
|
2023-08-28 00:23:13 -04:00
|
|
|
|
2023-12-05 12:04:08 -05:00
|
|
|
|
|
|
|
export default () => Box({
|
2024-03-28 16:06:02 -04:00
|
|
|
class_name: 'current-window',
|
|
|
|
|
2023-12-05 12:04:08 -05:00
|
|
|
children: [
|
|
|
|
Separator(SPACING / 2),
|
|
|
|
|
2023-12-18 18:00:30 -05:00
|
|
|
Icon({ size: 30 })
|
|
|
|
.hook(Hyprland.active.client, (self) => {
|
|
|
|
const app = Applications
|
|
|
|
.query(Hyprland.active.client.class)[0];
|
|
|
|
|
2024-03-29 17:12:48 -04:00
|
|
|
self.icon = app?.icon_name || '';
|
2023-12-18 18:00:30 -05:00
|
|
|
}),
|
2023-12-05 12:04:08 -05:00
|
|
|
|
|
|
|
Separator(SPACING),
|
|
|
|
|
|
|
|
Label({
|
|
|
|
css: 'color: #CBA6F7; font-size: 18px',
|
|
|
|
truncate: 'end',
|
2023-12-18 18:00:30 -05:00
|
|
|
label: Hyprland.active.client.bind('title'),
|
2023-12-05 12:04:08 -05:00
|
|
|
}),
|
|
|
|
],
|
2024-03-29 17:12:48 -04:00
|
|
|
}).hook(Hyprland.active.client, (self) => {
|
|
|
|
self.visible = Hyprland.active.client.title !== '';
|
2023-08-28 00:23:13 -04:00
|
|
|
});
|