2023-12-05 12:04:08 -05:00
|
|
|
import Applications from 'resource:///com/github/Aylur/ags/service/applications.js';
|
2023-10-31 08:32:40 -04:00
|
|
|
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-12-05 12:04:08 -05:00
|
|
|
import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
|
|
|
import Separator from '../../misc/separator.js';
|
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({
|
|
|
|
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];
|
|
|
|
|
|
|
|
if (app) {
|
2023-12-19 13:44:12 -05:00
|
|
|
self.icon = app.icon_name || '';
|
2023-12-18 18:00:30 -05:00
|
|
|
self.visible = Hyprland.active.client.title !== '';
|
|
|
|
}
|
|
|
|
}),
|
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
|
|
|
}),
|
|
|
|
],
|
2023-08-28 00:23:13 -04:00
|
|
|
});
|