GNOME extensions - WIP

This commit is contained in:
wheaney 2024-03-07 14:39:47 -08:00
parent 714f79d088
commit 47294824b9
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,49 @@
const Lang = imports.lang;
const St = imports.gi.St;
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const GObject = imports.gi.GObject;
const Cogl = imports.gi.Cogl;
const Shell = imports.gi.Shell;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
class Extension {
enable() {
var XREffect = GObject.registerClass({}, class XREffect extends Shell.GLSLEffect {
vfunc_build_pipeline() {
// TODO - replace this with the sombrero shader
const declares = `
uniform sampler2D uDesktopTexture;
`;
const code = `
cogl_color_out = texture2D(uDesktopTexture, cogl_tex_coord_in[0].xy);
`;
this.add_glsl_snippet(Shell.SnippetHook.FRAGMENT, declares, code, false);
}
// TODO - read IMU data and update uniform variables
vfunc_paint_target(node, paintContext) {
if (!this._initialized) {
this.set_uniform_float(this.get_uniform_location('uDesktopTexture'), 1, [0]);
this._initialized = true;
}
super.vfunc_paint_target(node, paintContext);
}
});
Main.uiGroup.add_effect(new XREffect());
}
disable() {
}
}
function init() {
return new Extension();
}

View File

@ -0,0 +1,9 @@
{
"uuid": "breezydesktop@org.xronlinux",
"name": "Breezy GNOME",
"description": "XR virtual desktop for Linux.",
"shell-version": [
"43"
],
"url": "https://github.com/wheaney/breezy-desktop"
}