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