diff options
| author | nippy <you@example.com> | 2026-04-18 13:49:56 +0200 |
|---|---|---|
| committer | nippy <you@example.com> | 2026-04-18 13:49:56 +0200 |
| commit | 5d94c0a7d44a2255b81815a52a7056a94a39842d (patch) | |
| tree | 759bdea9645c6a62f9e1e4c001f7d81cccd120d2 /raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/client.js | |
| parent | e79cdf210b267f21a186255ce1a4d50029439d54 (diff) | |
| download | RaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.tar.gz RaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.zip | |
update Raveos themes
Diffstat (limited to 'raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/client.js')
| -rw-r--r-- | raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/client.js | 58 |
1 files changed, 58 insertions, 0 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 new file mode 100644 index 0000000..3867b3a --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/dbus/client.js @@ -0,0 +1,58 @@ +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); + } + ); +} |