Added ags to hyprland
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import App from 'resource:///com/github/Aylur/ags/app.js';
|
||||
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
||||
const { Box, Window } = Widget;
|
||||
|
||||
|
||||
export default ({
|
||||
name,
|
||||
child,
|
||||
showClassName = "",
|
||||
hideClassName = "",
|
||||
...props
|
||||
}) => {
|
||||
return Window({
|
||||
name,
|
||||
visible: false,
|
||||
layer: 'overlay',
|
||||
...props,
|
||||
|
||||
child: Box({
|
||||
setup: (self) => {
|
||||
self.keybind("Escape", () => closeEverything());
|
||||
if (showClassName != "" && hideClassName !== "") {
|
||||
self.hook(App, (self, currentName, visible) => {
|
||||
if (currentName === name) {
|
||||
self.toggleClassName(hideClassName, !visible);
|
||||
}
|
||||
});
|
||||
|
||||
if (showClassName !== "" && hideClassName !== "")
|
||||
self.className = `${showClassName} ${hideClassName}`;
|
||||
}
|
||||
},
|
||||
child: child,
|
||||
}),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user