From 5b446000b88f7ed04bd0c7c0e65c7352de495701 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 2 Jan 2026 08:58:21 -0500 Subject: [PATCH] Notification keybindings added for the list and for last notification. Also bound flat review copy and append to clipboard as well as the show contents window. Fixed bug with using shift along with the cthulhu modifier in keybinding assignments. --- README.md | 1 - distro-packages/Slint/README | 1 - distro-packages/Slint/cthulhu-info | 2 +- meson.build | 8 -------- src/cthulhu/cthulhu-setup.ui | 22 +++++++++++----------- src/cthulhu/cthulhu_gui_prefs.py | 17 +++++++++++++++++ src/cthulhu/flat_review_presenter.py | 24 ++++++++++++------------ src/cthulhu/notification_presenter.py | 8 ++++---- 8 files changed, 45 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 95faf18..70ee6ee 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,6 @@ toolkit, OpenOffice/LibreOffice, Gecko, WebKitGtk, and KDE Qt toolkit. * **pluggy** - Plugin and hook calling mechanisms for Python * **python-dasbus** - D-Bus remote control interface (optional) -* **libpeas** - Plugin loader library ### Audio and Speech diff --git a/distro-packages/Slint/README b/distro-packages/Slint/README index 811924e..1825ead 100644 --- a/distro-packages/Slint/README +++ b/distro-packages/Slint/README @@ -19,7 +19,6 @@ This package requires the following packages, all available from SlackBuilds.org - gst-plugins-good - gtk3 - liblouis -- libpeas - libwnck3 - python3-atspi - python3-cairo diff --git a/distro-packages/Slint/cthulhu-info b/distro-packages/Slint/cthulhu-info index 2cef0ec..7f30753 100644 --- a/distro-packages/Slint/cthulhu-info +++ b/distro-packages/Slint/cthulhu-info @@ -5,6 +5,6 @@ DOWNLOAD="https://git.stormux.org/storm/cthulhu.git" MD5SUM="SKIP" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="at-spi2-core brltty gobject-introspection gsettings-desktop-schemas gstreamer gst-plugins-base gst-plugins-good gtk3 liblouis libpeas libwnck3 python3-atspi python3-cairo python3-gobject python3-setproctitle speech-dispatcher" +REQUIRES="at-spi2-core brltty gobject-introspection gsettings-desktop-schemas gstreamer gst-plugins-base gst-plugins-good gtk3 liblouis libwnck3 python3-atspi python3-cairo python3-gobject python3-setproctitle speech-dispatcher" MAINTAINER="Storm Dragon" EMAIL="storm_dragon@stormux.org" diff --git a/meson.build b/meson.build index 0dedee2..6f09605 100644 --- a/meson.build +++ b/meson.build @@ -89,14 +89,6 @@ else summary += {'sound support': 'no (missing gstreamer)'} endif -# Check for libpeas -libpeas_dep = dependency('libpeas-1.0', required: false) -if libpeas_dep.found() - summary += {'plugin loading': 'yes (found libpeas)'} -else - summary += {'plugin loading': 'no (missing libpeas)'} -endif - # Integration with session startup i18n.merge_file( input: 'cthulhu-autostart.desktop.in', diff --git a/src/cthulhu/cthulhu-setup.ui b/src/cthulhu/cthulhu-setup.ui index 34abfcd..f69e8c3 100644 --- a/src/cthulhu/cthulhu-setup.ui +++ b/src/cthulhu/cthulhu-setup.ui @@ -3776,6 +3776,17 @@ 8 + + + True + False + AI Assistant + + + 8 + False + + True @@ -3951,17 +3962,6 @@ 9 - - - True - False - AI Assistant - - - 8 - False - - True diff --git a/src/cthulhu/cthulhu_gui_prefs.py b/src/cthulhu/cthulhu_gui_prefs.py index f2dec26..09814ef 100644 --- a/src/cthulhu/cthulhu_gui_prefs.py +++ b/src/cthulhu/cthulhu_gui_prefs.py @@ -3088,9 +3088,26 @@ class CthulhuSetupGUI(cthulhu_gtkbuilder.GtkBuilderWrapper): input_event_manager.get_manager().unmap_all_modifiers() except Exception: pass + self._unmapCthulhuModifiersForCapture() editable.connect('key-press-event', self.kbKeyPressed) return + def _unmapCthulhuModifiersForCapture(self): + """Unmap Cthulhu modifier keys so they can be captured as bindings.""" + device = cthulhu_state.device + if device is None: + return + + for modifierKey in settings.cthulhuModifierKeys: + keycode = keybindings.getKeycode(modifierKey) + if keycode == 0 and modifierKey == "Shift_Lock": + keycode = keybindings.getKeycode("Caps_Lock") + if keycode: + try: + device.unmap_modifier(keycode) + except Exception: + pass + def editingCanceledKey(self, editable): """Stops user input of a Key for a selected key binding""" diff --git a/src/cthulhu/flat_review_presenter.py b/src/cthulhu/flat_review_presenter.py index ea29ac1..e1b3338 100644 --- a/src/cthulhu/flat_review_presenter.py +++ b/src/cthulhu/flat_review_presenter.py @@ -479,23 +479,23 @@ class FlatReviewPresenter: bindings.add( keybindings.KeyBinding( - "", + "f", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_MODIFIER_MASK | keybindings.SHIFT_MODIFIER_MASK, self._handlers.get("showContentsHandler"))) bindings.add( keybindings.KeyBinding( - "", + "c", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_CTRL_MODIFIER_MASK, self._handlers.get("flatReviewCopyHandler"))) bindings.add( keybindings.KeyBinding( - "", + "c", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_CTRL_MODIFIER_MASK | keybindings.SHIFT_MODIFIER_MASK, self._handlers.get("flatReviewAppendHandler"))) bindings.add( @@ -685,23 +685,23 @@ class FlatReviewPresenter: bindings.add( keybindings.KeyBinding( - "", + "f", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_MODIFIER_MASK | keybindings.SHIFT_MODIFIER_MASK, self._handlers.get("showContentsHandler"))) bindings.add( keybindings.KeyBinding( - "", + "c", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_CTRL_MODIFIER_MASK, self._handlers.get("flatReviewCopyHandler"))) bindings.add( keybindings.KeyBinding( - "", + "c", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_CTRL_MODIFIER_MASK | keybindings.SHIFT_MODIFIER_MASK, self._handlers.get("flatReviewAppendHandler"))) bindings.add( diff --git a/src/cthulhu/notification_presenter.py b/src/cthulhu/notification_presenter.py index af6e614..2e8e22f 100644 --- a/src/cthulhu/notification_presenter.py +++ b/src/cthulhu/notification_presenter.py @@ -126,9 +126,9 @@ class NotificationPresenter: bindings.add( keybindings.KeyBinding( - "", + "n", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_MODIFIER_MASK, self._handlers.get("present_last_notification"))) bindings.add( @@ -147,9 +147,9 @@ class NotificationPresenter: bindings.add( keybindings.KeyBinding( - "", + "n", keybindings.defaultModifierMask, - keybindings.NO_MODIFIER_MASK, + keybindings.CTHULHU_CTRL_MODIFIER_MASK, self._handlers.get("show_notification_list"))) return bindings