mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-01-06 07:42:49 +00:00
ags steal
This commit is contained in:
53
desktops/hyprland/ags/windows/bar.js
Normal file
53
desktops/hyprland/ags/windows/bar.js
Normal 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);
|
||||
}
|
||||
}),
|
||||
});
|
||||
88
desktops/hyprland/ags/windows/cheatsheet.js
Normal file
88
desktops/hyprland/ags/windows/cheatsheet.js
Normal 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(),
|
||||
]
|
||||
}),
|
||||
],
|
||||
})
|
||||
});
|
||||
36
desktops/hyprland/ags/windows/corners.js
Normal file
36
desktops/hyprland/ags/windows/corners.js
Normal 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', }),
|
||||
});
|
||||
|
||||
27
desktops/hyprland/ags/windows/lib/popupwindow.js
Normal file
27
desktops/hyprland/ags/windows/lib/popupwindow.js
Normal 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,
|
||||
}),
|
||||
});
|
||||
12
desktops/hyprland/ags/windows/osd.js
Normal file
12
desktops/hyprland/ags/windows/osd.js
Normal 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(),
|
||||
});
|
||||
12
desktops/hyprland/ags/windows/osk.js
Normal file
12
desktops/hyprland/ags/windows/osk.js
Normal 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(),
|
||||
});
|
||||
18
desktops/hyprland/ags/windows/overview.js
Normal file
18
desktops/hyprland/ags/windows/overview.js
Normal 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(),
|
||||
]
|
||||
}),
|
||||
})
|
||||
13
desktops/hyprland/ags/windows/session.js
Normal file
13
desktops/hyprland/ags/windows/session.js
Normal 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(),
|
||||
})
|
||||
11
desktops/hyprland/ags/windows/sideleft.js
Normal file
11
desktops/hyprland/ags/windows/sideleft.js
Normal 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(),
|
||||
});
|
||||
12
desktops/hyprland/ags/windows/sideright.js
Normal file
12
desktops/hyprland/ags/windows/sideright.js
Normal 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(),
|
||||
});
|
||||
Reference in New Issue
Block a user