Compare commits
No commits in common. "36e2709823e3d3b9510e70e042fa22e3445928fe" and "7d71fdd0e81e0c74dcf6936ae7b8a046621937d2" have entirely different histories.
36e2709823
...
7d71fdd0e8
41 changed files with 174 additions and 266 deletions
|
@ -1,25 +1,22 @@
|
|||
import { App, Utils } from './imports.js';
|
||||
|
||||
import { Powermenu } from './js/powermenu.js';
|
||||
import { Bar } from './js/bar/main.js';
|
||||
import { NotificationCenter } from './js/notifications/center.js';
|
||||
import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
|
||||
import { Powermenu } from './js/powermenu.js';
|
||||
import { Bar } from './js/bar/main.js';
|
||||
import { NotificationCenter } from './js/notifications/center.js';
|
||||
import { NotificationsPopupList } from './js/notifications/popup.js'
|
||||
import { Calendar } from './js/date.js';
|
||||
import { QuickSettings } from './js/quick-settings/main.js';
|
||||
import Overview from './js/overview/main.js';
|
||||
import AppLauncher from './js/applauncher/main.js';
|
||||
import { Calendar } from './js/date.js';
|
||||
import { QuickSettings } from './js/quick-settings/main.js';
|
||||
import Overview from './js/overview/main.js';
|
||||
import AppLauncher from './js/applauncher/main.js';
|
||||
|
||||
import { Closer, closeAll } from './js/misc/closer.js';
|
||||
globalThis.closeAll = () => closeAll();
|
||||
import { Closer, closeAll } from './js/misc/closer.js';
|
||||
ags.App.closeAll = () => closeAll();
|
||||
|
||||
const scss = ags.App.configDir + '/scss/main.scss';
|
||||
const css = ags.App.configDir + '/style.css';
|
||||
|
||||
const scss = App.configDir + '/scss/main.scss';
|
||||
const css = App.configDir + '/style.css';
|
||||
|
||||
Utils.exec(`sassc ${scss} ${css}`);
|
||||
|
||||
Utils.execAsync(['bash', '-c', '$AGS_PATH/startup.sh']).catch(print);
|
||||
exec(`sassc ${scss} ${css}`);
|
||||
|
||||
execAsync(['bash', '-c', '$AGS_PATH/startup.sh']).catch(print);
|
||||
|
||||
export default {
|
||||
style: css,
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
const resource = file => `resource:///com/github/Aylur/ags/${file}.js`;
|
||||
const require = async file => (await import(resource(file))).default;
|
||||
const service = async file => (await require(`service/${file}`)).instance;
|
||||
|
||||
export const App = await require('app');
|
||||
App.connect = (...args) => App.instance.connect(...args);
|
||||
|
||||
export const Widget = await require('widget');
|
||||
export const Service = await require('service');
|
||||
export const Variable = await require('variable');
|
||||
export const Utils = await import(resource('utils'));
|
||||
|
||||
export const Applications = await service('applications');
|
||||
export const Audio = await service('audio');
|
||||
export const Battery = await service('battery');
|
||||
export const Bluetooth = await service('bluetooth');
|
||||
export const Hyprland = await service('hyprland');
|
||||
export const Mpris = await service('mpris');
|
||||
export const Network = await service('network');
|
||||
export const Notifications = await service('notifications');
|
||||
export const SystemTray = await service('systemtray');
|
|
@ -1,5 +1,6 @@
|
|||
import { App, Applications, Widget } from '../../imports.js';
|
||||
const { Label, Box, Icon, Button, Scrollable, Entry, Window, EventBox } = Widget;
|
||||
const { App } = ags;
|
||||
const { Applications } = ags.Service;
|
||||
const { Label, Box, Icon, Button, Scrollable, Entry, Window, EventBox } = ags.Widget;
|
||||
|
||||
import { Separator } from '../misc/separator.js';
|
||||
import { PopUp } from '../misc/popup.js';
|
||||
|
@ -11,7 +12,6 @@ const icons = {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
const AppItem = (app, window) => {
|
||||
if (app.app.get_string('Icon') == 'Nextcloud')
|
||||
return;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Audio, Widget } from '../../imports.js';
|
||||
const { Label, Box, Icon } = Widget;
|
||||
const { Audio } = ags.Service;
|
||||
const { Label, Box, Icon, Stack, Button, Slider } = ags.Widget;
|
||||
|
||||
import { Separator } from '../misc/separator.js';
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
@ -12,13 +12,12 @@ const items = {
|
|||
0: 'audio-volume-muted-symbolic',
|
||||
};
|
||||
|
||||
|
||||
const SpeakerIndicator = params => Icon({
|
||||
...params,
|
||||
icon: '',
|
||||
connections: [[Audio, icon => {
|
||||
if (Audio.speaker) {
|
||||
if (Audio.speaker.stream.isMuted) {
|
||||
if (Audio.speaker.isMuted) {
|
||||
icon.icon = items[0];
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Battery, Widget } from '../../imports.js';
|
||||
const { Label, Icon, Stack, Box } = Widget;
|
||||
const { Battery } = ags.Service;
|
||||
const { Label, Icon, Stack, Box } = ags.Widget;
|
||||
|
||||
import { Separator } from '../misc/separator.js';
|
||||
|
||||
|
@ -16,7 +16,6 @@ const icons = charging => ([
|
|||
})],
|
||||
]);
|
||||
|
||||
|
||||
const Indicators = charging => Stack({
|
||||
items: icons(charging),
|
||||
connections: [[Battery, stack => {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { Utils, Widget } from '../../imports.js';
|
||||
const { ProgressBar, Overlay, Box } = Widget;
|
||||
|
||||
const { ProgressBar, Overlay, Box } = ags.Widget;
|
||||
const { execAsync } = ags.Utils;
|
||||
import { Separator } from '../misc/separator.js';
|
||||
import { Heart } from './heart.js';
|
||||
|
||||
|
||||
export const Brightness = Overlay({
|
||||
setup: widget => {
|
||||
widget.set_tooltip_text('Brightness');
|
||||
|
@ -13,7 +11,7 @@ export const Brightness = Overlay({
|
|||
className: 'toggle-off brightness',
|
||||
connections: [
|
||||
[200, progress => {
|
||||
Utils.execAsync('brightnessctl get').then(out => {
|
||||
execAsync('brightnessctl get').then(out => {
|
||||
let br = out / 255;
|
||||
if (br > 0.33) {
|
||||
progress.value = br;
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import { App, Widget } from '../../imports.js';
|
||||
const { Box, Label } = Widget;
|
||||
const { toggleWindow } = App;
|
||||
|
||||
import GLib from 'gi://GLib';
|
||||
const { DateTime } = GLib;
|
||||
const { Box, Label } = ags.Widget;
|
||||
const { toggleWindow } = ags.App;
|
||||
const { DateTime } = imports.gi.GLib;
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
const ClockModule = ({
|
||||
interval = 1000,
|
||||
...params
|
||||
|
@ -26,7 +22,7 @@ export const Clock = EventBox({
|
|||
className: 'toggle-off',
|
||||
onPrimaryClickRelease: () => toggleWindow('calendar'),
|
||||
connections: [
|
||||
[App, (box, windowName, visible) => {
|
||||
[ags.App, (box, windowName, visible) => {
|
||||
if (windowName == 'calendar') {
|
||||
box.toggleClassName('toggle-on', visible);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Widget, Hyprland } from '../../imports.js';
|
||||
const { Label } = Widget;
|
||||
|
||||
const { Hyprland } = ags.Service;
|
||||
const { Label } = ags.Widget;
|
||||
const { Gtk } = imports.gi;
|
||||
|
||||
export const CurrentWindow = Label({
|
||||
style: 'color: #CBA6F7; font-size: 18px',
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import { Widget, App } from '../../imports.js';
|
||||
const { CenterBox, EventBox } = Widget;
|
||||
const { openWindow } = App;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
|
||||
const { Window, CenterBox, EventBox, Button } = ags.Widget;
|
||||
const { openWindow } = ags.App;
|
||||
const { Gtk, Gdk } = imports.gi;
|
||||
const display = Gdk.Display.get_default();
|
||||
|
||||
export const Gesture = ({
|
||||
child,
|
||||
|
@ -21,7 +19,7 @@ export const Gesture = ({
|
|||
],
|
||||
connections: [
|
||||
|
||||
[gesture, _ => {
|
||||
[gesture, box => {
|
||||
const velocity = gesture.get_velocity()[1];
|
||||
if (velocity < -100)
|
||||
openWindow('quick-settings');
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { Utils, Widget } from '../../imports.js';
|
||||
const { Box, Label } = Widget;
|
||||
const { subprocess, execAsync } = Utils;
|
||||
const { Box, Label } = ags.Widget;
|
||||
const { subprocess, execAsync } = ags.Utils;
|
||||
const deflisten = subprocess;
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
subprocess(
|
||||
deflisten(
|
||||
['bash', '-c', 'tail -f /home/matt/.config/.heart'],
|
||||
(output) => {
|
||||
Heart.child.children[0].label = ' ' + output;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { Widget } from '../../imports.js';
|
||||
const { Window, CenterBox, Box } = Widget;
|
||||
const { Window, CenterBox, Box } = ags.Widget;
|
||||
|
||||
import { Separator } from '../misc/separator.js';
|
||||
import { CurrentWindow } from './current-window.js';
|
||||
|
@ -15,7 +14,6 @@ import { Brightness } from './brightness.js';
|
|||
import { AudioIndicator } from './audio.js';
|
||||
import { Gesture } from './gesture.js';
|
||||
|
||||
|
||||
export const Bar = Window({
|
||||
name: 'bar',
|
||||
layer: 'overlay',
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import { App, Notifications, Widget } from '../../imports.js';
|
||||
const { Box, Label, Icon } = Widget;
|
||||
const { toggleWindow } = App;
|
||||
const { Box, Label, Icon } = ags.Widget;
|
||||
const { toggleWindow } = ags.App;
|
||||
const { Notifications } = ags.Service;
|
||||
|
||||
import { Separator } from '../misc/separator.js';
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
export const NotifButton = EventBox({
|
||||
className: 'toggle-off',
|
||||
onPrimaryClickRelease: () => toggleWindow('notification-center'),
|
||||
connections: [
|
||||
[App, (box, windowName, visible) => {
|
||||
[ags.App, (box, windowName, visible) => {
|
||||
if (windowName == 'notification-center') {
|
||||
box.toggleClassName('toggle-on', visible);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { Utils, Widget } from '../../imports.js';
|
||||
const { Box, Label } = Widget;
|
||||
const { subprocess } = Utils;
|
||||
const { Box, Label } = ags.Widget;
|
||||
const { subprocess } = ags.Utils;
|
||||
const deflisten = subprocess;
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
subprocess(
|
||||
deflisten(
|
||||
['bash', '-c', '$AGS_PATH/osk-toggle.sh getState'],
|
||||
(output) => {
|
||||
if (output == 'Running') {
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import { Widget, App } from '../../imports.js';
|
||||
const { Box, Label } = Widget;
|
||||
const { toggleWindow } = App;
|
||||
const { Box, Label } = ags.Widget;
|
||||
const { toggleWindow } = ags.App;
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
export const QsToggle = EventBox({
|
||||
className: 'toggle-off',
|
||||
onPrimaryClickRelease: () => toggleWindow('quick-settings'),
|
||||
connections: [
|
||||
[App, (box, windowName, visible) => {
|
||||
[ags.App, (box, windowName, visible) => {
|
||||
if (windowName == 'quick-settings') {
|
||||
box.toggleClassName('toggle-on', visible);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import { SystemTray, Widget } from '../../imports.js';
|
||||
const { Box, Revealer, Icon, MenuItem } = Widget;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
const { SystemTray } = ags.Service;
|
||||
const { Box, Revealer, Icon, MenuItem } = ags.Widget;
|
||||
const { Gtk } = imports.gi;
|
||||
|
||||
import { Separator } from '../misc/separator.js';
|
||||
|
||||
|
||||
const SysTrayItem = item => MenuItem({
|
||||
className: 'tray-item',
|
||||
child: Icon({
|
||||
|
@ -25,7 +23,7 @@ export const SysTray = Revealer({
|
|||
}]],
|
||||
child: Box({
|
||||
children: [
|
||||
Widget({
|
||||
ags.Widget({
|
||||
type: Gtk.MenuBar,
|
||||
className: 'sys-tray',
|
||||
properties: [
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { Utils, Widget } from '../../imports.js';
|
||||
const { Box, Label } = Widget;
|
||||
const { subprocess } = Utils;
|
||||
const { Box, Label } = ags.Widget;
|
||||
const { subprocess } = ags.Utils;
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
export const TabletToggle = EventBox({
|
||||
className: 'toggle-off',
|
||||
onPrimaryClickRelease: function() {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import { Hyprland, Utils, Widget } from '../../imports.js';
|
||||
const { Box, Label, Revealer } = Widget;
|
||||
const { execAsync } = Utils;
|
||||
const { Hyprland, Applications } = ags.Service;
|
||||
const { execAsync } = ags.Utils;
|
||||
const { Box, Button, Label, Revealer } = ags.Widget;
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
const Workspace = ({ i } = {}) =>
|
||||
Revealer({
|
||||
transition: "slide_right",
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import { Widget } from '../imports.js';
|
||||
const { Box, Label, Window } = Widget;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
import GLib from 'gi://GLib';
|
||||
const { DateTime } = GLib;
|
||||
const { Box, Label, Window } = ags.Widget;
|
||||
const { Gtk } = imports.gi;
|
||||
const { DateTime } = imports.gi.GLib;
|
||||
|
||||
import { PopUp } from './misc/popup.js';
|
||||
|
||||
|
||||
const Divider = () => Box({
|
||||
className: 'divider',
|
||||
vertical: true,
|
||||
|
@ -63,7 +59,7 @@ const Time = () => Box({
|
|||
|
||||
const CalendarWidget = () => Box({
|
||||
className: 'cal-box',
|
||||
child: Widget({
|
||||
child: ags.Widget({
|
||||
type: Gtk.Calendar,
|
||||
showDayNames: true,
|
||||
showHeading: true,
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import { Widget } from '../../imports.js';
|
||||
const { Box, Overlay, EventBox } = Widget;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
const { Box, Overlay, EventBox } = ags.Widget;
|
||||
const { Gtk } = imports.gi;
|
||||
|
||||
const MAX_OFFSET = 200;
|
||||
const OFFSCREEN = 500;
|
||||
const TRANSITION = 'transition: margin 0.5s ease, opacity 3s ease;';
|
||||
|
||||
|
||||
export default ({ properties, connections, params } = {}) => {
|
||||
let widget = EventBox();
|
||||
|
||||
let gesture = Gtk.GestureDrag.new(widget)
|
||||
|
||||
widget.child = Overlay({
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { Mpris, Utils, Widget } from '../../imports.js';
|
||||
const { Button, Icon, Label, Stack, Slider, CenterBox, Box } = Widget;
|
||||
const { execAsync, lookUpIcon } = Utils;
|
||||
|
||||
import Gdk from 'gi://Gdk';
|
||||
const { execAsync, lookUpIcon } = ags.Utils;
|
||||
const { Mpris } = ags.Service;
|
||||
const { Button, Icon, Label, Stack, Slider, CenterBox, Box } = ags.Widget;
|
||||
const { Gdk } = imports.gi;
|
||||
const display = Gdk.Display.get_default();
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
@ -28,7 +27,6 @@ const icons = {
|
|||
},
|
||||
}
|
||||
|
||||
|
||||
export const CoverArt = (player, params) => CenterBox({
|
||||
...params,
|
||||
vertical: true,
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { Mpris, Variable, Widget } from '../../imports.js';
|
||||
const { Box, CenterBox, Label } = Widget;
|
||||
const { Mpris } = ags.Service;
|
||||
const { Box, CenterBox, Label } = ags.Widget;
|
||||
|
||||
import * as mpris from './mpris.js';
|
||||
import PlayerGesture from './gesture.js';
|
||||
import { Separator } from '../misc/separator.js';
|
||||
|
||||
|
||||
const Top = player => Box({
|
||||
className: 'top',
|
||||
halign: 'start',
|
||||
|
@ -98,7 +97,7 @@ export default () => Box({
|
|||
return;
|
||||
|
||||
const player = Mpris.getPlayer(busName);
|
||||
player.colors = Variable();
|
||||
player.colors = ags.Variable();
|
||||
overlay._players.set(busName, PlayerBox(player));
|
||||
|
||||
let result = [];
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { App, Widget } from '../../imports.js';
|
||||
const { Window, EventBox } = Widget;
|
||||
const { closeWindow } = App;
|
||||
const { Window, EventBox } = ags.Widget;
|
||||
const { closeWindow } = ags.App;
|
||||
|
||||
const ALWAYS_OPEN = [
|
||||
'closer',
|
||||
|
@ -8,12 +7,11 @@ const ALWAYS_OPEN = [
|
|||
'notifications',
|
||||
];
|
||||
|
||||
|
||||
// TODO: close on scroll event too?
|
||||
export const closeAll = () => {
|
||||
App.windows.forEach(w => {
|
||||
ags.App.windows.forEach(w => {
|
||||
if (!ALWAYS_OPEN.some(window => window === w.name))
|
||||
closeWindow(w.name)
|
||||
ags.App.closeWindow(w.name)
|
||||
});
|
||||
closeWindow('closer');
|
||||
};
|
||||
|
@ -26,8 +24,8 @@ export const Closer = Window({
|
|||
|
||||
child: EventBox({
|
||||
onPrimaryClickRelease: () => closeAll(),
|
||||
connections: [[App, (_b, _w, _v) => {
|
||||
if (!Array.from(App.windows).some(w => w[1].visible &&
|
||||
connections: [[ags.App, (_b, _w, _v) => {
|
||||
if (!Array.from(ags.App.windows).some(w => w[1].visible &&
|
||||
!ALWAYS_OPEN.some(window => window === w[0]))) {
|
||||
closeWindow('closer');
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import { Widget } from '../../imports.js';
|
||||
|
||||
import Gdk from 'gi://Gdk';
|
||||
const display = Gdk.Display.get_default();
|
||||
|
||||
|
||||
export const EventBox = ({ reset = true, ...params }) => Widget.EventBox({
|
||||
export const EventBox = ({ reset = true, ...params }) => ags.Widget.EventBox({
|
||||
...params,
|
||||
onHover: box => {
|
||||
if (! box.child.sensitive || ! box.sensitive) {
|
||||
|
@ -20,7 +17,7 @@ export const EventBox = ({ reset = true, ...params }) => Widget.EventBox({
|
|||
},
|
||||
});
|
||||
|
||||
export const Button = ({ reset = true, ...params }) => Widget.Button({
|
||||
export const Button = ({ reset = true, ...params }) => ags.Widget.Button({
|
||||
...params,
|
||||
onHover: box => {
|
||||
if (! box.child.sensitive || ! box.sensitive) {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import { Widget } from '../../imports.js';
|
||||
const { Box, EventBox } = Widget;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
import Gdk from 'gi://Gdk';
|
||||
const { Box, EventBox } = ags.Widget;
|
||||
const { Gtk, Gdk } = imports.gi;
|
||||
const display = Gdk.Display.get_default();
|
||||
|
||||
|
||||
export const Draggable = ({
|
||||
maxOffset = 150,
|
||||
startMargin = 0,
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import { App, Widget } from '../../imports.js';
|
||||
const { Revealer, Box } = Widget;
|
||||
const { openWindow } = App;
|
||||
|
||||
const { Revealer, Box } = ags.Widget;
|
||||
const { openWindow } = ags.App;
|
||||
|
||||
export const PopUp = ({name, child, transition = 'slide_down', ...params}) => Box({
|
||||
style: 'min-height:1px; min-width:1px',
|
||||
|
@ -9,7 +7,7 @@ export const PopUp = ({name, child, transition = 'slide_down', ...params}) => Bo
|
|||
...params,
|
||||
transition,
|
||||
transitionDuration: 500,
|
||||
connections: [[App, (revealer, currentName, visible) => {
|
||||
connections: [[ags.App, (revealer, currentName, visible) => {
|
||||
if (currentName === name) {
|
||||
revealer.reveal_child = visible;
|
||||
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
import { Widget } from '../../imports.js';
|
||||
const { Box } = Widget;
|
||||
|
||||
|
||||
export const Separator = width => Box({
|
||||
export const Separator = width => ags.Widget.Box({
|
||||
style: `min-width: ${width}px;`,
|
||||
});
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
import { Applications, Utils, Widget } from '../../imports.js';
|
||||
const { lookUpIcon, execAsync } = Utils;
|
||||
const { Box, Icon, Label, Button } = Widget;
|
||||
|
||||
import GLib from 'gi://GLib';
|
||||
const { GLib } = imports.gi;
|
||||
const { Notifications, Applications } = ags.Service;
|
||||
const { lookUpIcon, exec, execAsync } = ags.Utils;
|
||||
const { Box, Icon, Label, Button } = ags.Widget;
|
||||
|
||||
import { Draggable } from '../misc/drag.js';
|
||||
import { EventBox } from '../misc/cursorbox.js'
|
||||
import { closeAll } from '../misc/closer.js';
|
||||
|
||||
|
||||
const NotificationIcon = notif => {
|
||||
const NotificationIcon = ({ appEntry, appIcon, image }) => {
|
||||
let iconCmd = () => {};
|
||||
|
||||
if (Applications.query(notif.appEntry).length > 0) {
|
||||
let app = Applications.query(notif.appEntry)[0];
|
||||
if (Applications.query(appEntry).length > 0) {
|
||||
let app = Applications.query(appEntry)[0];
|
||||
|
||||
if (app.app.get_string('StartupWMClass') != null) {
|
||||
iconCmd = box => {
|
||||
|
@ -34,7 +32,7 @@ const NotificationIcon = notif => {
|
|||
}
|
||||
}
|
||||
|
||||
if (notif.image) {
|
||||
if (image) {
|
||||
return EventBox({
|
||||
onPrimaryClickRelease: iconCmd,
|
||||
child: Box({
|
||||
|
@ -42,7 +40,7 @@ const NotificationIcon = notif => {
|
|||
hexpand: false,
|
||||
className: 'icon img',
|
||||
style: `
|
||||
background-image: url("${notif.image}");
|
||||
background-image: url("${image}");
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
|
@ -54,12 +52,12 @@ const NotificationIcon = notif => {
|
|||
}
|
||||
|
||||
let icon = 'dialog-information-symbolic';
|
||||
if (lookUpIcon(notif.appIcon)) {
|
||||
icon = notif.appIcon;
|
||||
if (lookUpIcon(appIcon)) {
|
||||
icon = appIcon;
|
||||
}
|
||||
|
||||
if (lookUpIcon(notif.appEntry)) {
|
||||
icon = notif.appEntry;
|
||||
if (lookUpIcon(appEntry)) {
|
||||
icon = appEntry;
|
||||
}
|
||||
|
||||
return EventBox({
|
||||
|
@ -83,22 +81,22 @@ const NotificationIcon = notif => {
|
|||
});
|
||||
};
|
||||
|
||||
export default ({ notif, command = () => {}} = {}) => {
|
||||
export default ({ id, summary, body, actions, urgency, time, command = i => {}, ...icon }) => {
|
||||
const BlockedApps = [
|
||||
'Spotify',
|
||||
];
|
||||
|
||||
if (BlockedApps.find(app => app == notif.appName)) {
|
||||
notif.close();
|
||||
if (BlockedApps.find(app => app == Notifications.getNotification(id).appName)) {
|
||||
Notifications.close(id);
|
||||
return;
|
||||
}
|
||||
|
||||
return Draggable({
|
||||
maxOffset: 200,
|
||||
command: () => command(),
|
||||
command: () => command(id),
|
||||
properties: [
|
||||
['hovered', false],
|
||||
['id', notif.id],
|
||||
['id', id],
|
||||
],
|
||||
onHover: w => {
|
||||
if (!w._hovered) {
|
||||
|
@ -112,7 +110,7 @@ export default ({ notif, command = () => {}} = {}) => {
|
|||
},
|
||||
|
||||
child: Box({
|
||||
className: `notification ${notif.urgency}`,
|
||||
className: `notification ${urgency}`,
|
||||
vexpand: false,
|
||||
// Notification
|
||||
child: Box({
|
||||
|
@ -121,7 +119,7 @@ export default ({ notif, command = () => {}} = {}) => {
|
|||
// Content
|
||||
Box({
|
||||
children: [
|
||||
NotificationIcon(notif),
|
||||
NotificationIcon(icon),
|
||||
Box({
|
||||
hexpand: true,
|
||||
vertical: true,
|
||||
|
@ -137,20 +135,20 @@ export default ({ notif, command = () => {}} = {}) => {
|
|||
maxWidthChars: 24,
|
||||
truncate: 'end',
|
||||
wrap: true,
|
||||
label: notif.summary,
|
||||
useMarkup: notif.summary.startsWith('<'),
|
||||
label: summary,
|
||||
useMarkup: summary.startsWith('<'),
|
||||
}),
|
||||
Label({
|
||||
className: 'time',
|
||||
valign: 'start',
|
||||
label: GLib.DateTime.new_from_unix_local(notif.time).format('%H:%M'),
|
||||
label: GLib.DateTime.new_from_unix_local(time).format('%H:%M'),
|
||||
}),
|
||||
EventBox({
|
||||
reset: false,
|
||||
child: Button({
|
||||
className: 'close-button',
|
||||
valign: 'start',
|
||||
onClicked: () => notif.close(),
|
||||
onClicked: () => Notifications.close(id),
|
||||
child: Icon('window-close-symbolic'),
|
||||
}),
|
||||
}),
|
||||
|
@ -162,7 +160,7 @@ export default ({ notif, command = () => {}} = {}) => {
|
|||
useMarkup: true,
|
||||
xalign: 0,
|
||||
justification: 'left',
|
||||
label: notif.body,
|
||||
label: body,
|
||||
wrap: true,
|
||||
}),
|
||||
],
|
||||
|
@ -172,9 +170,9 @@ export default ({ notif, command = () => {}} = {}) => {
|
|||
// Actions
|
||||
Box({
|
||||
className: 'actions',
|
||||
children: notif.actions.map(action => Button({
|
||||
children: actions.map(action => Button({
|
||||
className: 'action-button',
|
||||
onClicked: () => notif.invoke(action.id),
|
||||
onClicked: () => Notifications.invoke(id, action.id),
|
||||
hexpand: true,
|
||||
child: Label(action.label),
|
||||
})),
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import { Notifications, App, Utils, Widget } from '../../imports.js';
|
||||
const { Button, Label, Box, Icon, Scrollable, Window, Revealer } = Widget;
|
||||
const { timeout } = Utils;
|
||||
const { getWindow } = App;
|
||||
const { Notifications } = ags.Service;
|
||||
const { Button, Label, Box, Icon, Scrollable, Window, Revealer } = ags.Widget;
|
||||
const { timeout } = ags.Utils;
|
||||
const { getWindow } = ags.App;
|
||||
|
||||
import Notification from './base.js';
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
import { PopUp } from '../misc/popup.js';
|
||||
|
||||
|
||||
const ClearButton = () => EventBox({
|
||||
child: Button({
|
||||
onPrimaryClickRelease: button => {
|
||||
|
@ -60,14 +59,12 @@ const NotificationList = Box({
|
|||
if (box.children.length == 0) {
|
||||
box.children = Notifications.notifications
|
||||
.reverse()
|
||||
.map(n => Notification({ notif: n, command: () => n.close() }));
|
||||
.map(n => Notification({ ...n, command: i => Notifications.close(i), }));
|
||||
}
|
||||
else if (id) {
|
||||
let notif = Notifications.getNotification(id);
|
||||
|
||||
const NewNotif = Notification({
|
||||
notif,
|
||||
command: () => notif.close(),
|
||||
...Notifications.getNotification(id),
|
||||
command: i => Notifications.close(i),
|
||||
});
|
||||
|
||||
if (NewNotif) {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
import { Notifications, Utils, Widget } from '../../imports.js';
|
||||
const { Box, Revealer, Window } = Widget;
|
||||
const { timeout, interval } = Utils;
|
||||
|
||||
import GLib from 'gi://GLib';
|
||||
const { source_remove } = GLib;
|
||||
|
||||
import Notification from './base.js';
|
||||
|
||||
const { Notifications } = ags.Service;
|
||||
const { Box, Revealer, Window } = ags.Widget;
|
||||
const { timeout, interval } = ags.Utils;
|
||||
const { source_remove } = imports.gi.GLib;
|
||||
|
||||
const Popups = () => Box({
|
||||
vertical: true,
|
||||
|
@ -40,10 +36,9 @@ const Popups = () => Box({
|
|||
|
||||
box._map.delete(id);
|
||||
|
||||
let notif = Notifications.getNotification(id);
|
||||
box._map.set(id, Notification({
|
||||
notif,
|
||||
command: () => notif.dismiss(),
|
||||
...Notifications.getNotification(id),
|
||||
command: i => Notifications.dismiss(i),
|
||||
}));
|
||||
|
||||
box.children = Array.from(box._map.values()).reverse();
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
import { App, Hyprland, Utils, Widget } from '../../imports.js';
|
||||
const { Icon, Revealer } = Widget;
|
||||
const { closeWindow } = App;
|
||||
const { execAsync } = Utils;
|
||||
const { Icon, Revealer } = ags.Widget;
|
||||
const { closeWindow } = ags.App;
|
||||
const { execAsync } = ags.Utils;
|
||||
const { Hyprland } = ags.Service;
|
||||
|
||||
import { WindowButton } from './dragndrop.js';
|
||||
import * as VARS from './variables.js';
|
||||
|
||||
Array.prototype.remove = function (el) { this.splice(this.indexOf(el), 1) };
|
||||
|
||||
const IconStyle = app => `min-width: ${app.size[0] * VARS.SCALE - VARS.MARGIN}px;
|
||||
min-height: ${app.size[1] * VARS.SCALE - VARS.MARGIN}px;
|
||||
font-size: ${Math.min(app.size[0] * VARS.SCALE - VARS.MARGIN,
|
||||
app.size[1] * VARS.SCALE - VARS.MARGIN) * VARS.ICON_SCALE}px;`;
|
||||
|
||||
|
||||
const Client = (client, active, clients) => Revealer({
|
||||
transition: 'crossfade',
|
||||
setup: rev => {
|
||||
|
@ -67,7 +65,7 @@ const Client = (client, active, clients) => Revealer({
|
|||
});
|
||||
|
||||
export function updateClients(box) {
|
||||
execAsync('hyprctl clients -j')
|
||||
ags.Utils.execAsync('hyprctl clients -j')
|
||||
.then(result => {
|
||||
let clients = JSON.parse(result).filter(client => client.class)
|
||||
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
import { App, Utils, Widget } from '../../imports.js';
|
||||
const { EventBox } = Widget;
|
||||
const { execAsync } = Utils;
|
||||
const { getWindow } = App;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
import Gdk from 'gi://Gdk';
|
||||
const { Gtk, Gdk } = imports.gi;
|
||||
const { EventBox } = ags.Widget;
|
||||
const { execAsync } = ags.Utils;
|
||||
const { getWindow } = ags.App;
|
||||
import Cairo from 'cairo';
|
||||
|
||||
import { Button } from '../misc/cursorbox.js';
|
||||
|
||||
const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)];
|
||||
|
||||
const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)];
|
||||
|
||||
function createSurfaceFromWidget(widget) {
|
||||
const alloc = widget.get_allocation();
|
||||
|
@ -31,6 +28,7 @@ function createSurfaceFromWidget(widget) {
|
|||
let hidden = 0;
|
||||
export const WorkspaceDrop = params => EventBox({
|
||||
...params,
|
||||
//tooltipText: `Workspace: ${id}`,
|
||||
connections: [['drag-data-received', (eventbox, _c, _x, _y, data) => {
|
||||
let id = eventbox.get_parent()._id;
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { Hyprland, Widget } from '../../imports.js';
|
||||
const { Window, Box } = Widget;
|
||||
const { Window, Box } = ags.Widget;
|
||||
const { Hyprland } = ags.Service;
|
||||
|
||||
import { PopUp } from '../misc/popup.js';
|
||||
import { WorkspaceRow, getWorkspaces, updateWorkspaces } from './workspaces.js';
|
||||
import { updateClients } from './clients.js';
|
||||
|
||||
|
||||
export default Window({
|
||||
name: 'overview',
|
||||
layer: 'overlay',
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Hyprland, Widget } from '../../imports.js';
|
||||
const { Revealer, CenterBox, Box, EventBox, Label, Overlay } = Widget;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
const { Revealer, CenterBox, Box, EventBox, Label, Overlay } = ags.Widget;
|
||||
const { Hyprland } = ags.Service;
|
||||
const { Gtk } = imports.gi;
|
||||
|
||||
import { WorkspaceDrop } from './dragndrop.js';
|
||||
import * as VARS from './variables.js';
|
||||
|
@ -9,7 +8,6 @@ import * as VARS from './variables.js';
|
|||
const DEFAULT_STYLE = `min-width: ${VARS.SCREEN.X * VARS.SCALE}px;
|
||||
min-height: ${VARS.SCREEN.Y * VARS.SCALE}px;`;
|
||||
|
||||
|
||||
export function getWorkspaces(box) {
|
||||
let children = [];
|
||||
box.children.forEach(type => {
|
||||
|
@ -63,7 +61,7 @@ export const WorkspaceRow = (className, i) => Revealer({
|
|||
overlays: [Box({
|
||||
style: DEFAULT_STYLE,
|
||||
children: [
|
||||
Widget({
|
||||
ags.Widget({
|
||||
type: Gtk.Fixed,
|
||||
}),
|
||||
Label({
|
||||
|
@ -91,7 +89,7 @@ const Workspace = (id, name) => Revealer({
|
|||
['wasActive', false],
|
||||
],
|
||||
connections: [[Hyprland, box => {
|
||||
box._timeouts.forEach(timer => timer.destroy());
|
||||
box._timeouts.forEach(clearTimeout);
|
||||
|
||||
let activeId = Hyprland.active.workspace.id;
|
||||
let active = activeId === box._id;
|
||||
|
@ -121,12 +119,12 @@ const Workspace = (id, name) => Revealer({
|
|||
box._wasActive = true;
|
||||
}
|
||||
else if (box._wasActive) {
|
||||
box._wasActive = false;
|
||||
box._timeouts.push(setTimeout(() => {
|
||||
rev.setStyle(`${DEFAULT_STYLE}
|
||||
transition: margin 0.5s ease-in-out;
|
||||
opacity: 1; margin-left: ${n ? '' : '-'}300px;
|
||||
margin-right: ${n ? '-' : ''}300px;`);
|
||||
box._wasActive = false;
|
||||
}, 120));
|
||||
box._timeouts.push(setTimeout(() => {
|
||||
rev.setStyle(`${DEFAULT_STYLE} opacity: 0;
|
||||
|
@ -149,7 +147,7 @@ const Workspace = (id, name) => Revealer({
|
|||
overlays: [Box({
|
||||
className: 'workspace',
|
||||
style: DEFAULT_STYLE,
|
||||
child: Widget({
|
||||
child: ags.Widget({
|
||||
type: Gtk.Fixed,
|
||||
}),
|
||||
})],
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { Widget } from '../imports.js';
|
||||
const { Window, CenterBox, Label } = Widget;
|
||||
const { Window, CenterBox, Label } = ags.Widget;
|
||||
|
||||
import { PopUp } from './misc/popup.js';
|
||||
import { Button } from './misc/cursorbox.js'
|
||||
|
||||
|
||||
const PowermenuWidget = CenterBox({
|
||||
className: 'powermenu',
|
||||
vertical: false,
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { Network, Bluetooth, Audio, App, Utils, Widget } from '../../imports.js';
|
||||
const { Box, CenterBox, Label, Icon } = Widget;
|
||||
const { execAsync } = Utils;
|
||||
const { openWindow } = App;
|
||||
const { Box, CenterBox, Label, Icon } = ags.Widget;
|
||||
const { Network, Bluetooth, Audio } = ags.Service;
|
||||
const { execAsync } = ags.Utils;
|
||||
const { openWindow } = ags.App;
|
||||
|
||||
import { EventBox } from '../misc/cursorbox.js';
|
||||
|
||||
|
||||
const GridButton = ({ command = () => {}, secondaryCommand = () => {}, icon } = {}) => Box({
|
||||
className: 'grid-button',
|
||||
children: [
|
||||
|
@ -149,7 +148,7 @@ const SecondRow = Box({
|
|||
className: 'grid-label',
|
||||
connections: [[Audio, icon => {
|
||||
if (Audio.speaker) {
|
||||
if (Audio.speaker.stream.isMuted) {
|
||||
if (Audio.speaker.isMuted) {
|
||||
icon.icon = items[0];
|
||||
}
|
||||
else {
|
||||
|
@ -172,7 +171,7 @@ const SecondRow = Box({
|
|||
className: 'grid-label',
|
||||
connections: [[Audio, icon => {
|
||||
if (Audio.microphone) {
|
||||
if (Audio.microphone.stream.isMuted) {
|
||||
if (Audio.microphone.isMuted) {
|
||||
icon.icon = itemsMic[0];
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Mpris, Widget } from '../../imports.js';
|
||||
const { Window, Box, Label, Revealer, Icon } = Widget;
|
||||
|
||||
import Gtk from 'gi://Gtk';
|
||||
const { Window, Box, Label, Revealer, Icon } = ags.Widget;
|
||||
const { Mpris } = ags.Service;
|
||||
const { ToggleButton } = imports.gi.Gtk;
|
||||
|
||||
import { ButtonGrid } from './button-grid.js';
|
||||
import { SliderBox } from './slider-box.js';
|
||||
|
@ -9,7 +8,6 @@ import Player from '../media-player/player.js';
|
|||
import { EventBox } from '../misc/cursorbox.js';
|
||||
import { PopUp } from '../misc/popup.js';
|
||||
|
||||
|
||||
const QuickSettingsWidget = Box({
|
||||
className: 'qs-container',
|
||||
vertical: true,
|
||||
|
@ -32,12 +30,12 @@ const QuickSettingsWidget = Box({
|
|||
SliderBox,
|
||||
|
||||
EventBox({
|
||||
child: Widget({
|
||||
type: Gtk.ToggleButton,
|
||||
child: ags.Widget({
|
||||
type: ToggleButton,
|
||||
setup: btn => {
|
||||
const id = Mpris.connect('changed', () => {
|
||||
const id = Mpris.instance.connect('changed', () => {
|
||||
btn.set_active(Mpris.players.length > 0);
|
||||
Mpris.disconnect(id);
|
||||
Mpris.instance.disconnect(id);
|
||||
});
|
||||
},
|
||||
connections: [['toggled', button => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Audio, Utils, Widget } from '../../imports.js';
|
||||
const { Box, Slider, Icon, EventBox } = Widget;
|
||||
const { execAsync } = Utils;
|
||||
const { Box, Slider, Icon, EventBox } = ags.Widget;
|
||||
const { Audio } = ags.Service;
|
||||
const { execAsync } = ags.Utils;
|
||||
|
||||
const items = {
|
||||
101: 'audio-volume-overamplified-symbolic',
|
||||
|
@ -10,7 +10,6 @@ const items = {
|
|||
0: 'audio-volume-muted-symbolic',
|
||||
};
|
||||
|
||||
|
||||
export const SliderBox = Box({
|
||||
className: 'slider-box',
|
||||
vertical: true,
|
||||
|
@ -27,7 +26,7 @@ export const SliderBox = Box({
|
|||
className: 'slider-label',
|
||||
connections: [[Audio, icon => {
|
||||
if (Audio.speaker) {
|
||||
if (Audio.speaker.stream.isMuted) {
|
||||
if (Audio.speaker.isMuted) {
|
||||
icon.icon = items[0];
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -12,7 +12,8 @@ Libinput.instance.connect('device-init', () => {
|
|||
});
|
||||
*/
|
||||
|
||||
const { Service, Utils } = '../imports.js';
|
||||
const { Service } = ags;
|
||||
const { execAsync } = ags.Utils;
|
||||
import GLib from 'gi://GLib';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
|
@ -122,7 +123,7 @@ class LibinputService extends Service {
|
|||
constructor() {
|
||||
super();
|
||||
this.debugInstances = new Map();
|
||||
Utils.execAsync(['libinput', 'list-devices'])
|
||||
execAsync(['libinput', 'list-devices'])
|
||||
.then(out => this.parseOutput(out))
|
||||
.catch(console.error);
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ bind = $mainMod, C, killactive,
|
|||
|
||||
bind = $mainMod, L, exec, $LOCK_PATH/lock.sh
|
||||
bind = $mainMod SHIFT, E, exec, ags run-js 'ags.App.openWindow("powermenu")'
|
||||
bindn =, Escape, exec, ags run-js 'closeAll()'
|
||||
bindn =, Escape, exec, ags run-js 'ags.App.closeAll()'
|
||||
bind = $mainMod SHIFT, SPACE, togglefloating,
|
||||
bind = $mainMod, D, exec, ags -t applauncher
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
|
|
BIN
nixos/flake.lock
BIN
nixos/flake.lock
Binary file not shown.
Loading…
Reference in a new issue