diff options
| author | AlexanderCurl <alexc@alexc.hu> | 2026-04-18 17:46:06 +0100 |
|---|---|---|
| committer | AlexanderCurl <alexc@alexc.hu> | 2026-04-18 17:46:06 +0100 |
| commit | 70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69 (patch) | |
| tree | ab1123d4067c1b086dd6faa7ee4ea643236b565a /raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus | |
| parent | 5d94c0a7d44a2255b81815a52a7056a94a39842d (diff) | |
| download | RaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.tar.gz RaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.zip | |
Replaced file structures for themes in the correct format
Diffstat (limited to 'raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus')
3 files changed, 0 insertions, 163 deletions
diff --git a/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/client.js b/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/client.js deleted file mode 100644 index 3867b3a..0000000 --- a/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/client.js +++ /dev/null @@ -1,58 +0,0 @@ -import Gio from 'gi://Gio'; - -const bus_name = 'org.gnome.Shell'; -const iface_name = 'dev.aunetx.BlurMyShell'; -const obj_path = '/dev/aunetx/BlurMyShell'; - - -/// Call pick() from the DBus service, it will open the Inspector from -/// gnome-shell to pick an actor on stage. -export function pick() { - Gio.DBus.session.call( - bus_name, - obj_path, - iface_name, - 'pick', - null, - null, - Gio.DBusCallFlags.NO_AUTO_START, - -1, - null, - null - ); -} - -/// Connect to DBus 'picking' signal, which will be emitted when the inspector -/// is picking a window. -export function on_picking(cb) { - const id = Gio.DBus.session.signal_subscribe( - bus_name, - iface_name, - 'picking', - obj_path, - null, - Gio.DBusSignalFlags.NONE, - _ => { - cb(); - Gio.DBus.session.signal_unsubscribe(id); - } - ); -} - -/// Connect to DBus 'picked' signal, which will be emitted when a window is -/// picked. -export function on_picked(cb) { - const id = Gio.DBus.session.signal_subscribe( - bus_name, - iface_name, - 'picked', - obj_path, - null, - Gio.DBusSignalFlags.NONE, - (conn, sender, obj_path, iface, signal, params) => { - const val = params.get_child_value(0); - cb(val.get_string()[0]); - Gio.DBus.session.signal_unsubscribe(id); - } - ); -} diff --git a/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/iface.xml b/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/iface.xml deleted file mode 100644 index 4f298ad..0000000 --- a/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/iface.xml +++ /dev/null @@ -1,12 +0,0 @@ -<node> - <interface name="dev.aunetx.BlurMyShell"> - <!-- This method is called in preferences to pick a window --> - <method name="pick" /> - <!-- When window is picking, send a signal to preferences --> - <signal name="picking"></signal> - <!-- If window is picked, send a signal to preferences --> - <signal name="picked"> - <arg name="window" type="s" /> - </signal> - </interface> -</node>
\ No newline at end of file diff --git a/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/services.js b/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/services.js deleted file mode 100644 index 4b1f4f0..0000000 --- a/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/services.js +++ /dev/null @@ -1,93 +0,0 @@ -import Gio from 'gi://Gio'; -import GLib from 'gi://GLib'; -import * as Main from 'resource:///org/gnome/shell/ui/main.js'; -import * as LookingGlass from 'resource:///org/gnome/shell/ui/lookingGlass.js'; - - -export const ApplicationsService = class ApplicationsService { - constructor() { - let decoder = new TextDecoder(); - let path = GLib.filename_from_uri(GLib.uri_resolve_relative( - import.meta.url, 'iface.xml', GLib.UriFlags.NONE) - )[0]; - let [, buffer] = GLib.file_get_contents(path); - let iface = decoder.decode(buffer); - GLib.free(buffer); - - this.DBusImpl = Gio.DBusExportedObject.wrapJSObject(iface, this); - } - - /// Pick Window for Preferences Page, exported to DBus client. - pick() { - // emit `picking` signal to know we are listening - const send_picking_signal = _ => - this.DBusImpl.emit_signal( - 'picking', - null - ); - - // emit `picked` signal to send wm_class - const send_picked_signal = wm_class => - this.DBusImpl.emit_signal( - 'picked', - new GLib.Variant('(s)', [wm_class]) - ); - - // notify the preferences that we are listening - send_picking_signal(); - - // A very interesting way to pick a window: - // 1. Open LookingGlass to mask all event handles of window - // 2. Use inspector to pick window, thats is also lookingGlass do - // 3. Close LookingGlass when done - // It will restore event handles of window - - // open then hide LookingGlass - const looking_class = Main.createLookingGlass(); - looking_class.open(); - looking_class.hide(); - - // inspect window now - const inspector = new LookingGlass.Inspector(Main.createLookingGlass()); - inspector.connect('target', (me, target, x, y) => { - // remove border effect when window is picked. - const effect_name = 'lookingGlass_RedBorderEffect'; - target - .get_effects() - .filter(e => e.toString().includes(effect_name)) - .forEach(e => target.remove_effect(e)); - - // get wm_class_instance property of window, then pass it to DBus - // client - const type_str = target.toString(); - - let actor = target; - if (type_str.includes('MetaSurfaceActor')) - actor = target.get_parent(); - - if (!actor.toString().includes('WindowActor')) - actor = actor.get_parent(); - - if (!actor.toString().includes('WindowActor')) - return send_picked_signal('window-not-found'); - - send_picked_signal( - actor.meta_window.get_wm_class() ?? 'window-not-found' - ); - }); - - // close LookingGlass when we're done - inspector.connect('closed', _ => looking_class.close()); - } - - export() { - this.DBusImpl.export( - Gio.DBus.session, - '/dev/aunetx/BlurMyShell' - ); - }; - - unexport() { - this.DBusImpl.unexport(); - } -}; |