diff --git a/src/services/modus.py b/src/services/modus.py index 3bfa5b7..d837cce 100644 --- a/src/services/modus.py +++ b/src/services/modus.py @@ -572,9 +572,7 @@ def open_trash(): continue -# --- Occlusion (uses Hyprland API above) --- - - +# Occlusion def check_occlusion(occlusion_region, workspace=None) -> bool: if workspace is None: workspace = get_active_workspace_id() diff --git a/src/shared/data.py b/src/shared/data.py index 438152a..d24935d 100644 --- a/src/shared/data.py +++ b/src/shared/data.py @@ -4,7 +4,7 @@ from utils.functions import parse_timeout_string from utils.utils import toml_file HOME_DIR = GLib.get_home_dir() -APP_NAME = "modus1" +APP_NAME = "modus" CACHE_DIR = str(GLib.get_user_cache_dir()) + f"/{APP_NAME}" diff --git a/src/shared/widgets/animator.py b/src/shared/widgets/animator.py index 91e3beb..9ffac94 100644 --- a/src/shared/widgets/animator.py +++ b/src/shared/widgets/animator.py @@ -172,6 +172,7 @@ class Animator(Service): self._max_value = 1.0 self._repeat = False self._duration = 0.8 + self._bezier_curve = (1, 1, 0, 0) self._timing_function = timing_function self._tick_widget = tick_widget self._tick_interval = tick_interval diff --git a/src/shared/widgets/customrevealer.py b/src/shared/widgets/customrevealer.py index a56626c..382340c 100644 --- a/src/shared/widgets/customrevealer.py +++ b/src/shared/widgets/customrevealer.py @@ -21,6 +21,7 @@ class SlideRevealer(Gtk.Overlay): self.duration = duration self.fixed_size = size self._revealed = False + self._show_animation = False self._cached_dimensions = None self.animator = Animator( diff --git a/src/shared/widgets/flat_scale.py b/src/shared/widgets/flat_scale.py index 3f64183..40ff5c1 100644 --- a/src/shared/widgets/flat_scale.py +++ b/src/shared/widgets/flat_scale.py @@ -8,10 +8,6 @@ from gi.repository import Pango, PangoCairo from shared.widgets.animator import Animator, ease_in, ease_in_out, ease_out -# ------------------------------------------------------------------ # -# Helpers # -# ------------------------------------------------------------------ # - def _draw_rounded_rect(cr, x, y, w, h, r): r = min(r, w / 2, h / 2) @@ -31,11 +27,6 @@ def _draw_rounded_rect(cr, x, y, w, h, r): cr.close_path() -# ------------------------------------------------------------------ # -# TypedDict # -# ------------------------------------------------------------------ # - - class FlatScaleStyle(TypedDict): slider_color: Gdk.RGBA slider_height: float @@ -52,11 +43,6 @@ class FlatScaleStyle(TypedDict): background_color: Gdk.RGBA -# ------------------------------------------------------------------ # -# Widget # -# ------------------------------------------------------------------ # - - class FlatScale(Gtk.DrawingArea, Widget): """ A Cairo-drawn linear scale widget for Fabric. @@ -232,10 +218,6 @@ class FlatScale(Gtk.DrawingArea, Widget): if on_value_changed: self.connect("value-changed", on_value_changed) - # ------------------------------------------------------------------ # - # Value # - # ------------------------------------------------------------------ # - @property def value(self) -> float: return self._value @@ -254,10 +236,6 @@ class FlatScale(Gtk.DrawingArea, Widget): def get_value(self) -> float: return self._value - # ------------------------------------------------------------------ # - # Realize / gadget contexts # - # ------------------------------------------------------------------ # - def _on_realize(self, _widget) -> None: state = self.get_state_flags() self._gadget_classes[self._slider_ctx] = None @@ -298,10 +276,6 @@ class FlatScale(Gtk.DrawingArea, Widget): self._cached_style = None self.queue_draw() - # ------------------------------------------------------------------ # - # Style resolution # - # ------------------------------------------------------------------ # - def do_get_border_width( self, context: Gtk.StyleContext, state: Gtk.StateFlags ) -> float: @@ -361,10 +335,6 @@ class FlatScale(Gtk.DrawingArea, Widget): return self._min_value + ratio * (self._max_value - self._min_value) - # ------------------------------------------------------------------ # - # Bubble animation helpers # - # ------------------------------------------------------------------ # - def _bubble_open(self): self._bubble_closing = False self._anim_bubble_close.pause() @@ -396,10 +366,6 @@ class FlatScale(Gtk.DrawingArea, Widget): else: self._bubble_progress = min(1.0, self._anim_bubble_open.value) - # ------------------------------------------------------------------ # - # Drawing helpers # - # ------------------------------------------------------------------ # - def do_draw_rounded_rect(self, cr, x, y, width, height, radius): _draw_rounded_rect(cr, x, y, width, height, radius) @@ -495,10 +461,6 @@ class FlatScale(Gtk.DrawingArea, Widget): cr.restore() - # ------------------------------------------------------------------ # - # Main draw # - # ------------------------------------------------------------------ # - def do_draw(self, cr: cairo.Context) -> bool: styles = self.do_resolve_style() @@ -622,10 +584,6 @@ class FlatScale(Gtk.DrawingArea, Widget): return False - # ------------------------------------------------------------------ # - # Input events # - # ------------------------------------------------------------------ # - def _on_button_press(self, _widget, event: Gdk.EventButton) -> bool: if event.button == 1: self._dragging = True diff --git a/src/utils/functions.py b/src/utils/functions.py index dcc8ae6..e7c6b4c 100644 --- a/src/utils/functions.py +++ b/src/utils/functions.py @@ -369,7 +369,6 @@ def run_command( return CommandResult(1, "", str(e)) - def fuzzy_score(query: str, text: str) -> int: """ Fuzzy match scoring. Returns score > 0 if all query chars found in order. diff --git a/src/utils/uinput.py b/src/utils/uinput.py deleted file mode 100644 index 85e9965..0000000 --- a/src/utils/uinput.py +++ /dev/null @@ -1,65 +0,0 @@ -"""Pure-Python mouse click simulation via /dev/uinput.""" - -import os -import struct -import time as _time - -_UI_DEV_CREATE = 0x5501 -_UI_SET_EVBIT = 0x40045564 -_UI_SET_KEYBIT = 0x40045565 -_UI_SET_RELBIT = 0x40045567 - -_EV_KEY = 0x01 -_EV_REL = 0x02 -_REL_X = 0x00 -_REL_Y = 0x01 -_BTN_LEFT = 0x110 -_SYN_REPORT = 0 - -_ABS_CNT = 64 -_INPUT_EVENT_FMT = " bool: - """Move cursor to (x, y) and left-click using a virtual uinput mouse. - - Returns True on success. - """ - try: - fd = os.open("/dev/uinput", os.O_WRONLY | os.O_NONBLOCK) - - import fcntl - - for cap in (_EV_KEY, _EV_REL): - fcntl.ioctl(fd, _UI_SET_EVBIT, cap) - fcntl.ioctl(fd, _UI_SET_KEYBIT, _BTN_LEFT) - for rel in (_REL_X, _REL_Y): - fcntl.ioctl(fd, _UI_SET_RELBIT, rel) - - name = b"OpenCodeMouse\x00" + b"\x00" * 66 - dev = name - dev += struct.pack("