Compare commits
2 commits
6f574f7b2d
...
a7fdacd252
Author | SHA1 | Date | |
---|---|---|---|
a7fdacd252 | |||
71b6939bfb |
3 changed files with 89 additions and 5 deletions
81
config/ags/js/bar/fullscreen.js
Normal file
81
config/ags/js/bar/fullscreen.js
Normal file
|
@ -0,0 +1,81 @@
|
|||
import { Widget, Hyprland, Utils, Variable } from '../../imports.js';
|
||||
const { Box, EventBox } = Widget;
|
||||
|
||||
const Revealed = Variable(true);
|
||||
const Hovering = Variable(false);
|
||||
|
||||
import { Gesture } from './gesture.js';
|
||||
|
||||
|
||||
export const Revealer = params => Box({
|
||||
style: 'min-height: 1px',
|
||||
vertical: true,
|
||||
children: [
|
||||
Widget.Revealer({
|
||||
transition: 'slide_down',
|
||||
setup: self => self.revealChild = true,
|
||||
properties: [
|
||||
['timeouts', []],
|
||||
],
|
||||
connections: [[Hyprland, self => {
|
||||
Utils.execAsync('hyprctl activewindow -j')
|
||||
.then(result => {
|
||||
let client = JSON.parse(result);
|
||||
if (client.fullscreen === Revealed.value) return;
|
||||
|
||||
Revealed.value = client.fullscreen;
|
||||
|
||||
if (Revealed.value) {
|
||||
setTimeout(() => {
|
||||
if (Revealed.value)
|
||||
self.revealChild = false
|
||||
}, 2000);
|
||||
}
|
||||
else {
|
||||
self.revealChild = true;
|
||||
}
|
||||
}).catch(print);
|
||||
}]],
|
||||
|
||||
child: Gesture({
|
||||
onHover: () => Hovering.value = true,
|
||||
onHoverLost: self => {
|
||||
Hovering.value = false;
|
||||
if (Revealed.value) {
|
||||
setTimeout(() => {
|
||||
if (!Hovering.value) {
|
||||
self.get_parent().get_parent().children[1].revealChild = true;
|
||||
self.get_parent().revealChild = false;
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
...params,
|
||||
}),
|
||||
}),
|
||||
|
||||
Widget.Revealer({
|
||||
connections: [[Revealed, self => {
|
||||
if (Revealed.value) {
|
||||
setTimeout(() => {
|
||||
if (Revealed.value)
|
||||
self.revealChild = true;
|
||||
}, 2000);
|
||||
}
|
||||
else {
|
||||
self.revealChild = false;
|
||||
}
|
||||
}]],
|
||||
child: EventBox({
|
||||
onHover: self => {
|
||||
Hovering.value = true;
|
||||
self.get_parent().get_parent().children[0].revealChild = true;
|
||||
self.get_parent().revealChild = false;
|
||||
},
|
||||
child: Box({
|
||||
style: 'min-height: 50px;',
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
});
|
|
@ -13,7 +13,7 @@ import { SysTray } from './systray.js';
|
|||
import { BatteryIndicator } from './battery.js';
|
||||
import { Brightness } from './brightness.js';
|
||||
import { AudioIndicator } from './audio.js';
|
||||
import { Gesture } from './gesture.js';
|
||||
import { Revealer } from './fullscreen.js';
|
||||
|
||||
|
||||
export const Bar = Window({
|
||||
|
@ -21,8 +21,7 @@ export const Bar = Window({
|
|||
layer: 'overlay',
|
||||
anchor: 'top left right',
|
||||
exclusive: true,
|
||||
|
||||
child: Gesture({
|
||||
child: Revealer({
|
||||
child: CenterBox({
|
||||
className: 'transparent',
|
||||
halign: 'fill',
|
||||
|
@ -56,7 +55,11 @@ export const Bar = Window({
|
|||
],
|
||||
}),
|
||||
|
||||
centerWidget: CurrentWindow,
|
||||
centerWidget: Box({
|
||||
children: [
|
||||
CurrentWindow,
|
||||
],
|
||||
}),
|
||||
|
||||
endWidget: Box({
|
||||
halign: 'end',
|
||||
|
|
|
@ -72,7 +72,7 @@ export function updateClients(box) {
|
|||
let clients = JSON.parse(result).filter(client => client.class)
|
||||
|
||||
box._workspaces.forEach(workspace => {
|
||||
let fixed = workspace.child.child.overlays[1].children[0];
|
||||
let fixed = workspace.child.child.get_children()[2].children[0];
|
||||
let toRemove = fixed.get_children();
|
||||
|
||||
clients.filter(client => client.workspace.id == workspace._id).forEach(client => {
|
||||
|
|
Loading…
Reference in a new issue