summaryrefslogtreecommitdiff
path: root/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/preferences/menu.js
diff options
context:
space:
mode:
authornippy <you@example.com>2026-04-18 13:49:56 +0200
committernippy <you@example.com>2026-04-18 13:49:56 +0200
commit5d94c0a7d44a2255b81815a52a7056a94a39842d (patch)
tree759bdea9645c6a62f9e1e4c001f7d81cccd120d2 /raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/preferences/menu.js
parente79cdf210b267f21a186255ce1a4d50029439d54 (diff)
downloadRaveOS-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/preferences/menu.js')
-rw-r--r--raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/preferences/menu.js68
1 files changed, 68 insertions, 0 deletions
diff --git a/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/preferences/menu.js b/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/preferences/menu.js
new file mode 100644
index 0000000..899fdcf
--- /dev/null
+++ b/raveos-theme/gnome/theme-data/extensions/installed/blur-my-shell@aunetx/preferences/menu.js
@@ -0,0 +1,68 @@
+import Gdk from 'gi://Gdk';
+import Gtk from 'gi://Gtk';
+import Gio from 'gi://Gio';
+import GLib from 'gi://GLib';
+
+
+export function addMenu(window) {
+ const builder = new Gtk.Builder();
+
+ // add a dummy page and remove it immediately, to access headerbar
+ builder.add_from_file(GLib.filename_from_uri(GLib.uri_resolve_relative(import.meta.url, '../ui/menu.ui', GLib.UriFlags.NONE))[0]);
+ let menu_util = builder.get_object('menu_util');
+ window.add(menu_util);
+ try {
+ addMenuToHeader(window, builder);
+ } catch (error) {
+ // could not add menu... not so bad
+ }
+ window.remove(menu_util);
+}
+
+function addMenuToHeader(window, builder) {
+ // a little hack to get to the headerbar
+ const page = builder.get_object('menu_util');
+ const pages_stack = page.get_parent(); // AdwViewStack
+ const content_stack = pages_stack.get_parent().get_parent(); // GtkStack
+ const preferences = content_stack.get_parent(); // GtkBox
+ const headerbar = preferences.get_first_child().get_next_sibling()
+ .get_first_child().get_first_child().get_first_child(); // AdwHeaderBar
+ headerbar.pack_start(builder.get_object('info_menu'));
+
+ // setup menu actions
+ const actionGroup = new Gio.SimpleActionGroup();
+ window.insert_action_group('prefs', actionGroup);
+
+ // a list of actions with their associated link
+ const actions = [
+ {
+ name: 'open-bug-report',
+ link: 'https://github.com/aunetx/blur-my-shell/issues'
+ },
+ {
+ name: 'open-readme',
+ link: 'https://github.com/aunetx/blur-my-shell'
+ },
+ {
+ name: 'open-license',
+ link: 'https://github.com/aunetx/blur-my-shell/blob/master/LICENSE'
+ },
+ {
+ name: 'donate-github',
+ link: 'https://github.com/sponsors/aunetx'
+ },
+ {
+ name: 'donate-kofi',
+ link: 'https://ko-fi.com/aunetx'
+ },
+ ];
+
+ actions.forEach(action => {
+ let act = new Gio.SimpleAction({ name: action.name });
+ act.connect(
+ 'activate',
+ () => Gtk.show_uri(window, action.link, Gdk.CURRENT_TIME)
+ );
+ actionGroup.add_action(act);
+ });
+}