ags steal

This commit is contained in:
2023-10-29 15:05:17 +01:00
parent e7416f5bdf
commit 912479c43d
101 changed files with 10639 additions and 1 deletions

View File

@@ -0,0 +1,53 @@
const { Gdk, Gtk } = imports.gi;
import { App, Service, Utils, Widget } from '../imports.js';
const { execAsync, exec } = Utils;
import { ModuleWorkspaces } from "../modules/workspaces.js";
import { ModuleMusic } from "../modules/music.js";
import { ModuleSystem } from "../modules/system.js";
import { ModuleLeftSpace } from "../modules/leftspace.js";
import { ModuleRightSpace } from "../modules/rightspace.js";
import { RoundedCorner } from "../modules/lib/roundedcorner.js";
const left = Widget.Box({
className: 'bar-sidemodule',
children: [ModuleMusic()],
});
const center = Widget.Box({
children: [
RoundedCorner('topright', { className: 'corner-bar-group' }),
ModuleWorkspaces(),
RoundedCorner('topleft', { className: 'corner-bar-group' }),
],
});
const right = Widget.Box({
className: 'bar-sidemodule',
children: [ModuleSystem()],
});
export default () => Widget.Window({
name: 'bar',
anchor: ['top', 'left', 'right'],
exclusive: true,
visible: true,
child: Widget.CenterBox({
className: 'bar-bg',
startWidget: ModuleLeftSpace(),
centerWidget: Widget.Box({
className: 'spacing-h--20',
children: [
left,
center,
right,
]
}),
endWidget: ModuleRightSpace(),
setup: (self) => {
const styleContext = self.get_style_context();
const minHeight = styleContext.get_property('min-height', Gtk.StateFlags.NORMAL);
// execAsync(['bash', '-c', `hyprctl keyword monitor ,addreserved,${minHeight},0,0,0`]).catch(print);
}
}),
});

View File

@@ -0,0 +1,88 @@
const { Gdk, Gtk } = imports.gi;
import { Service, Widget } from '../imports.js';
import { Keybinds } from "../modules/keybinds.js";
import { setupCursorHover } from "../modules/lib/cursorhover.js";
const cheatsheetHeader = () => Widget.CenterBox({
vertical: false,
startWidget: Widget.Box({}),
centerWidget: Widget.Box({
vertical: true,
className: "spacing-h-15",
children: [
Widget.Box({
halign: 'center',
className: 'spacing-h-5',
children: [
Widget.Label({
halign: 'center',
style: 'margin-right: 0.682rem;',
className: 'txt-title txt',
label: 'Cheat sheet',
}),
Widget.Label({
valign: 'center',
className: "cheatsheet-key txt-small",
label: "",
}),
Widget.Label({
valign: 'center',
className: "cheatsheet-key-notkey txt-small",
label: "+",
}),
Widget.Label({
valign: 'center',
className: "cheatsheet-key txt-small",
label: "/",
})
]
}),
Widget.Label({
justify: Gtk.Justification.CENTER,
className: 'txt-small txt',
label: 'Sheet data stored in ~/.config/ags/data/keybinds.js\nChange keybinds in ~/.config/hypr/keybinds.conf'
}),
]
}),
endWidget: Widget.Button({
valign: 'start',
halign: 'end',
className: "cheatsheet-closebtn icon-material txt txt-hugeass",
onClicked: () => {
App.toggleWindow('cheatsheet');
},
child: Widget.Label({
className: 'icon-material txt txt-hugeass',
label: 'close'
}),
setup: (button) => setupCursorHover(button),
}),
});
const clickOutsideToClose = Widget.EventBox({
onPrimaryClick: () => App.closeWindow('cheatsheet'),
onSecondaryClick: () => App.closeWindow('cheatsheet'),
onMiddleClick: () => App.closeWindow('cheatsheet'),
});
export default () => Widget.Window({
name: 'cheatsheet',
exclusive: false,
focusable: true,
popup: true,
visible: false,
child: Widget.Box({
vertical: true,
children: [
clickOutsideToClose,
Widget.Box({
vertical: true,
className: "cheatsheet-bg spacing-v-15",
children: [
cheatsheetHeader(),
Keybinds(),
]
}),
],
})
});

View File

@@ -0,0 +1,36 @@
import { Widget } from '../imports.js';
import { RoundedCorner } from "../modules/lib/roundedcorner.js";
export const CornerTopleft = () => Widget.Window({
name: 'cornertl',
layer: 'top',
anchor: ['top', 'left'],
exclusive: false,
visible: true,
child: RoundedCorner('topleft', { className: 'corner', }),
});
export const CornerTopright = () => Widget.Window({
name: 'cornertr',
layer: 'top',
anchor: ['top', 'right'],
exclusive: false,
visible: true,
child: RoundedCorner('topright', { className: 'corner', }),
});
export const CornerBottomleft = () => Widget.Window({
name: 'cornerbl',
layer: 'top',
anchor: ['bottom', 'left'],
exclusive: false,
visible: true,
child: RoundedCorner('bottomleft', { className: 'corner-black', }),
});
export const CornerBottomright = () => Widget.Window({
name: 'cornerbr',
layer: 'top',
anchor: ['bottom', 'right'],
exclusive: false,
visible: true,
child: RoundedCorner('bottomright', { className: 'corner-black', }),
});

View File

@@ -0,0 +1,27 @@
import { App, Widget } from '../../imports.js';
const { Revealer, Box, Window } = Widget;
export default ({
name,
child,
showClassName,
hideClassName,
...props
}) => Window({
name,
popup: true,
visible: false,
layer: 'overlay',
...props,
child: Box({
className: `${showClassName} ${hideClassName}`,
connections: [[App, (self, currentName, visible) => {
if (currentName === name) {
self.toggleClassName(hideClassName, !visible);
}
}]],
child: child,
}),
});

View File

@@ -0,0 +1,12 @@
import { Widget } from '../imports.js';
import Osd from "../modules/onscreendisplay.js";
export default (monitor) => Widget.Window({
name: `indicator${monitor}`,
monitor,
className: 'indicator',
layer: 'overlay',
visible: true,
anchor: ['top'],
child: Osd(),
});

View File

@@ -0,0 +1,12 @@
const { Gdk, Gtk } = imports.gi;
import { Widget } from '../imports.js';
import PopupWindow from './lib/popupwindow.js';
import OnScreenKeyboard from "../modules/onscreenkeyboard.js";
export default () => PopupWindow({
anchor: ['bottom'],
name: 'osk',
showClassName: 'osk-show',
hideClassName: 'osk-hide',
child: OnScreenKeyboard(),
});

View File

@@ -0,0 +1,18 @@
import { Widget } from '../imports.js';
import { SearchAndWindows } from "../modules/overview.js";
export default () => Widget.Window({
name: 'overview',
exclusive: false,
focusable: true,
popup: true,
visible: false,
anchor: ['top'],
layer: 'overlay',
child: Widget.Box({
vertical: true,
children: [
SearchAndWindows(),
]
}),
})

View File

@@ -0,0 +1,13 @@
const { Gdk, Gtk } = imports.gi;
import { Widget } from '../imports.js';
import SessionScreen from "../modules/sessionscreen.js";
export default () => Widget.Window({ // On-screen keyboard
name: 'session',
popup: true,
visible: false,
focusable: true,
layer: 'overlay',
// anchor: ['top', 'bottom', 'left', 'right'],
child: SessionScreen(),
})

View File

@@ -0,0 +1,11 @@
import PopupWindow from './lib/popupwindow.js';
import SidebarLeft from "../modules/sideleft.js";
export default () => PopupWindow({
focusable: true,
anchor: ['left', 'bottom'],
name: 'sideleft',
showClassName: 'sideleft-show',
hideClassName: 'sideleft-hide',
child: SidebarLeft(),
});

View File

@@ -0,0 +1,12 @@
import { Widget } from '../imports.js';
import PopupWindow from './lib/popupwindow.js';
import SidebarRight from "../modules/sideright.js";
export default () => PopupWindow({
focusable: true,
anchor: ['right', 'top', 'bottom'],
name: 'sideright',
showClassName: 'sideright-show',
hideClassName: 'sideright-hide',
child: SidebarRight(),
});