Compare commits

..

2 commits

Author SHA1 Message Date
11f5eecbc2 fix(ags): put screen corners under bar 2023-11-16 00:49:51 -05:00
cd6f9c4e24 fix(ags bar): fix fullscreen hiding 2023-11-16 00:48:50 -05:00
16 changed files with 82 additions and 101 deletions

View file

@ -10,6 +10,7 @@ import Corners from './js/corners/main.js';
import NotifCenter from './js/notifications/center.js'; import NotifCenter from './js/notifications/center.js';
import NotifPopups from './js/notifications/popup.js'; import NotifPopups from './js/notifications/popup.js';
import OSD from './js/osd/main.js'; import OSD from './js/osd/main.js';
import OSK from './js/on-screen-keyboard/main.js';
import Overview from './js/overview/main.js'; import Overview from './js/overview/main.js';
import Powermenu from './js/powermenu.js'; import Powermenu from './js/powermenu.js';
import QSettings from './js/quick-settings/main.js'; import QSettings from './js/quick-settings/main.js';
@ -34,6 +35,10 @@ export default {
'quick-settings': 500, 'quick-settings': 500,
}, },
windows: [ windows: [
// Put the corners first so they
// don't block the cursor on the bar
...Corners(),
AppLauncher(), AppLauncher(),
Calendar(), Calendar(),
NotifCenter(), NotifCenter(),
@ -44,7 +49,6 @@ export default {
Bar(), Bar(),
BgFade(), BgFade(),
...Corners(),
NotifPopups(), NotifPopups(),
], ],
}; };

View file

@ -2,9 +2,9 @@ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
import { Label, Box, Icon } from 'resource:///com/github/Aylur/ags/widget.js'; import { Label, Box, Icon } from 'resource:///com/github/Aylur/ags/widget.js';
import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import { SpeakerIcon } from '../misc/audio-icons.js'; import { SpeakerIcon } from '../../misc/audio-icons.js';
import Separator from '../misc/separator.js'; import Separator from '../../misc/separator.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
const SpeakerIndicator = props => Icon({ const SpeakerIndicator = props => Icon({

View file

@ -1,7 +1,7 @@
import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js';
import { Label, Icon, Box } from 'resource:///com/github/Aylur/ags/widget.js'; import { Label, Icon, Box } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../../misc/separator.js';
const Indicator = () => Icon({ const Indicator = () => Icon({

View file

@ -1,6 +1,6 @@
import { ProgressBar, Overlay, Box } from 'resource:///com/github/Aylur/ags/widget.js'; import { ProgressBar, Overlay, Box } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../../misc/separator.js';
import Heart from './heart.js'; import Heart from './heart.js';

View file

@ -4,7 +4,7 @@ import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import GLib from 'gi://GLib'; import GLib from 'gi://GLib';
const { DateTime } = GLib; const { DateTime } = GLib;
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
const ClockModule = ({ const ClockModule = ({

View file

@ -1,7 +1,7 @@
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import { subprocess, execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; import { subprocess, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
export default () => EventBox({ export default () => EventBox({

View file

@ -2,8 +2,8 @@ import App from 'resource:///com/github/Aylur/ags/app.js';
import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js';
import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../../misc/separator.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
export default () => EventBox({ export default () => EventBox({

View file

@ -1,6 +1,6 @@
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
export default () => EventBox({ export default () => EventBox({

View file

@ -1,7 +1,7 @@
import App from 'resource:///com/github/Aylur/ags/app.js'; import App from 'resource:///com/github/Aylur/ags/app.js';
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
export default () => EventBox({ export default () => EventBox({

View file

@ -2,7 +2,7 @@ import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js';
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
import { Box, Icon, MenuItem, MenuBar, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, Icon, MenuItem, MenuBar, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../../misc/separator.js';
const SysTrayItem = item => { const SysTrayItem = item => {

View file

@ -1,6 +1,6 @@
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
export default () => EventBox({ export default () => EventBox({

View file

@ -2,7 +2,7 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
import { Box, Overlay, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, Overlay, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import EventBox from '../misc/cursorbox.js'; import EventBox from '../../misc/cursorbox.js';
const Workspace = ({ i } = {}) => const Workspace = ({ i } = {}) =>

View file

@ -1,78 +1,54 @@
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js';
import { Box, EventBox, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, EventBox, Revealer, Window } from 'resource:///com/github/Aylur/ags/widget.js';
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
const Revealed = Variable(true);
const Hovering = Variable(false);
Hyprland.connect('changed', () => { const BarCloser = variable => Window({
const workspace = Hyprland.getWorkspace(Hyprland.active.workspace.id); name: 'bar-closer',
Revealed.value = workspace?.hasfullscreen; visible: false,
anchor: ['top', 'bottom', 'left', 'right'],
layer: 'overlay',
child: EventBox({
onHover: self => {
variable.value = false;
self.get_parent().visible = false;
},
child: Box({
css: 'padding: 1px',
}),
}),
}); });
Hyprland.connect('fullscreen', (_, fullscreen) => Revealed.value = fullscreen);
export default props => Box({ export default props => {
const Revealed = Variable(true);
const barCloser = BarCloser(Revealed);
return Box({
css: 'min-height: 1px', css: 'min-height: 1px',
hexpand: true, hexpand: true,
vertical: true, vertical: true,
connections: [
[Hyprland.active, () => {
const workspace = Hyprland.getWorkspace(Hyprland.active.workspace.id);
Revealed.value = !workspace?.hasfullscreen;
}],
[Hyprland, (_, fullscreen) => Revealed.value = !fullscreen, 'fullscreen'],
],
children: [ children: [
Revealer({ Revealer({
transition: 'slide_down', transition: 'slide_down',
revealChild: true, revealChild: true,
binds: [['revealChild', Revealed, 'value']],
properties: [['timeouts', []]],
connections: [[Revealed, self => {
if (Revealed.value) {
timeout(2000, () => {
if (Revealed.value)
self.revealChild = false;
});
}
else {
self.revealChild = true;
}
}]],
child: EventBox({
onHover: () => Hovering.value = true,
onHoverLost: self => {
Hovering.value = false;
if (Revealed.value) {
timeout(2000, () => {
if (!Hovering.value) {
// Replace bar with transparent eventbox
self.get_parent().get_parent().children[1].revealChild = true;
self.get_parent().revealChild = false;
}
});
}
},
...props, ...props,
}), }),
}),
Revealer({ Revealer({
connections: [[Revealed, self => { binds: [['revealChild', Revealed, 'value', v => !v]],
if (Revealed.value) {
timeout(2000, () => {
if (Revealed.value)
self.revealChild = true;
});
}
else {
self.revealChild = false;
}
}]],
child: EventBox({ child: EventBox({
onHover: self => { onHover: () => {
Hovering.value = true; barCloser.visible = true;
Revealed.value = true;
// Replace eventbox with bar
self.get_parent().get_parent().children[0].revealChild = true;
self.get_parent().revealChild = false;
}, },
child: Box({ child: Box({
css: 'min-height: 5px;', css: 'min-height: 5px;',
@ -80,4 +56,5 @@ export default props => Box({
}), }),
}), }),
], ],
}); });
};

View file

@ -1,20 +1,20 @@
import { Window, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget.js'; import { Window, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';
import CurrentWindow from './current-window.js'; import CurrentWindow from './buttons/current-window.js';
import Workspaces from './workspaces.js'; import Workspaces from './buttons/workspaces.js';
import OskToggle from './osk-toggle.js'; import OskToggle from './buttons/osk-toggle.js';
import TabletToggle from './tablet-toggle.js'; import TabletToggle from './buttons/tablet-toggle.js';
import QsToggle from './quick-settings.js'; import QsToggle from './buttons/quick-settings.js';
import NotifButton from './notif-button.js'; import NotifButton from './buttons/notif-button.js';
import Clock from './clock.js'; import Clock from './buttons/clock.js';
import SysTray from './systray.js'; import SysTray from './buttons/systray.js';
import Battery from './battery.js'; import Battery from './buttons/battery.js';
import Brightness from './brightness.js'; import Brightness from './buttons/brightness.js';
import Audio from './audio.js'; import Audio from './buttons/audio.js';
import KeyboardLayout from './keyboard-layout.js'; import KeyboardLayout from './buttons/keyboard-layout.js';
import Revealer from './fullscreen.js'; import BarReveal from './fullscreen.js';
export default () => Window({ export default () => Window({
@ -22,7 +22,7 @@ export default () => Window({
layer: 'overlay', layer: 'overlay',
anchor: ['top', 'left', 'right'], anchor: ['top', 'left', 'right'],
exclusivity: 'exclusive', exclusivity: 'exclusive',
child: Revealer({ child: BarReveal({
child: CenterBox({ child: CenterBox({
className: 'bar', className: 'bar',
vertical: false, vertical: false,