feat(ags): reorder abstract js modules

This commit is contained in:
matt1432 2023-09-11 19:57:21 -04:00
parent 1793d140f8
commit 53eda996c9
17 changed files with 38 additions and 33 deletions

View file

@ -3,7 +3,7 @@ import { Powermenu } from './js/powermenu.js';
import { Bar } from './js/bar/bar.js';
import { NotificationCenter } from './js/notifications/center.js';
import { NotificationsPopupList } from './js/notifications/popup.js'
import { Closer } from './js/common.js';
import { Closer } from './js/misc/closer.js';
const scss = ags.App.configDir + '/scss/main.scss';
const css = ags.App.configDir + '/style.css';

View file

@ -1,6 +1,8 @@
const { Audio } = ags.Service;
const { Label, Box, Icon, Stack, Button, Slider } = ags.Widget;
import { Separator, EventBox } from '../common.js';
import { Separator } from '../misc/separator.js';
import { EventBox } from '../misc/cursorbox.js';
const items = {
101: 'audio-volume-overamplified-symbolic',

View file

@ -1,6 +1,6 @@
const { Window, CenterBox, Box } = ags.Widget;
import { Separator } from '../common.js';
import { Separator } from '../misc/separator.js';
import { CurrentWindow } from './current-window.js';
import { Workspaces } from './workspaces.js';
import { OskToggle } from './osk-toggle.js';

View file

@ -1,7 +1,8 @@
const { Label, Icon, Stack, ProgressBar, Overlay, Box } = ags.Widget;
import { Separator } from '../common.js';
const { exec } = ags.Utils;
import { Separator } from '../misc/separator.js';
const icons = charging => ([
...Array.from({ length: 10 }, (_, i) => i * 10).map(i => ([
`${i}`, Icon({

View file

@ -1,6 +1,6 @@
const { Label, Icon, Stack, ProgressBar, Overlay, Box } = ags.Widget;
const { exec } = ags.Utils;
import { Separator } from '../common.js';
import { Separator } from '../misc/separator.js';
import { Heart } from './heart.js';
export const Brightness = Overlay({

View file

@ -2,7 +2,7 @@ const { Box, Label } = ags.Widget;
const { subprocess, exec } = ags.Utils;
const deflisten = subprocess;
import { EventBox } from '../common.js';
import { EventBox } from '../misc/cursorbox.js';
deflisten(
['bash', '-c', 'tail -f /home/matt/.config/.heart'],

View file

@ -2,7 +2,8 @@ const { Box, Label, Icon } = ags.Widget;
const { openWindow, closeWindow } = ags.App;
const { Notifications } = ags.Service;
import { EventBox, Separator } from '../common.js';
import { Separator } from '../misc/separator.js';
import { EventBox } from '../misc/cursorbox.js';
var notifButtonState = false;

View file

@ -2,7 +2,7 @@ const { Box, Label } = ags.Widget;
const { subprocess, exec } = ags.Utils;
const deflisten = subprocess;
import { EventBox } from '../common.js';
import { EventBox } from '../misc/cursorbox.js';
deflisten(
['bash', '-c', '$AGS_PATH/osk-toggle.sh getState'],

View file

@ -1,8 +1,9 @@
const { Box, Label } = ags.Widget;
const { subprocess } = ags.Utils;
import { EventBox } from '../common.js';
const deflisten = subprocess;
import { EventBox } from '../misc/cursorbox.js';
deflisten(
['bash', '-c', '$AGS_PATH/qs-toggle.sh state'],
(output) => {

View file

@ -1,7 +1,8 @@
const { SystemTray } = ags.Service;
const { Box, Button, Icon, MenuItem } = ags.Widget;
const { Gtk } = imports.gi;
import { EventBox } from '../common.js';
import { EventBox } from '../misc/cursorbox.js';
const SysTrayItem = item => MenuItem({
className: 'tray-item',

View file

@ -1,7 +1,7 @@
const { Box, Label } = ags.Widget;
const { subprocess } = ags.Utils;
import { EventBox } from '../common.js';
import { EventBox } from '../misc/cursorbox.js';
export const TabletToggle = EventBox({
className: 'toggle-off',

View file

@ -2,7 +2,7 @@ const { Hyprland, Applications } = ags.Service;
const { execAsync } = ags.Utils;
const { Box, Button, Label, Revealer } = ags.Widget;
import { EventBox } from '../common.js';
import { EventBox } from '../misc/cursorbox.js';
const Workspace = ({ i } = {}) =>
Revealer({

View file

@ -0,0 +1,13 @@
export const Closer = ags.Widget.Window({
name: 'closer',
popup: true,
layer: 'top',
anchor: 'top bottom left right',
child: ags.Widget.EventBox({
onPrimaryClickRelease: () => {
ags.App.closeWindow('powermenu');
ags.App.closeWindow('closer');
},
}),
});

View file

@ -1,21 +1,3 @@
export const Closer = ags.Widget.Window({
name: 'closer',
popup: true,
layer: 'top',
anchor: 'top bottom left right',
child: ags.Widget.EventBox({
onPrimaryClickRelease: () => {
ags.App.closeWindow('powermenu');
ags.App.closeWindow('closer');
},
}),
});
export const Separator = width => ags.Widget.Box({
style: `min-width: ${width}px;`,
});
import Gdk from 'gi://Gdk';
const display = Gdk.Display.get_default();

View file

@ -0,0 +1,3 @@
export const Separator = width => ags.Widget.Box({
style: `min-width: ${width}px;`,
});

View file

@ -4,7 +4,7 @@ const { lookUpIcon, timeout } = ags.Utils;
const { Box, Icon, Label, Button } = ags.Widget;
import { Draggable } from '../misc/drag.js';
import { EventBox } from '../common.js'
import { EventBox } from '../misc/cursorbox.js'
const NotificationIcon = ({ appEntry, appIcon, image }) => {
if (image) {

View file

@ -1,8 +1,9 @@
import Notification from './base.js';
import { EventBox } from '../common.js'
const { Notifications } = ags.Service;
const { Button, Label, Box, Icon, Scrollable, Window } = ags.Widget;
import Notification from './base.js';
import { EventBox } from '../misc/cursorbox.js'
const ClearButton = () => EventBox({child: Button({
onClicked: Notifications.clear,
connections: [[Notifications, button => {