Conversation
Replace the 290-line on_key_press if/elif chain with a (ctrl, shift, keyval) dispatch dict for O(1) lookup. Extract search-focused handling and each key action into small named methods.
In compact mode, position the window at the mouse cursor using gtk-layer-shell (anchor top-left + margins). Cursor coordinates are queried via hyprctl and converted to monitor-local offsets. Includes screen-bounds clamping and stale-socket auto-recovery. Closes #9
Add tests for keyboard mixin (65), utils (fuzzy search, date format), detection (URL/SVG/data-URI), text (markup escaping, highlighting), config manager (load/save/type coercion), and CLI (arg parsing, logging). 276 tests total. Add 'just test' recipe to the QA group.
Run ruff lint and pytest on ubuntu with GTK3 system packages. Triggers on push to main/dev and on PRs to main.
setup-python installs an isolated Python that can't see apt-installed python3-gi. Switch test job to system python3 + python3-pytest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gtk-layer-shellfor Wayland positioning andhyprctlfor cursor queries. Includes monitor-aware clamping and stale-socket auto-recovery. Closes Place floating window under the cursor #9on_key_pressif/elif chain with a(ctrl, shift, keyval)dispatch table for O(1) lookup. Each key action is now a small named method.just testrecipe.Cursor-position launch — experimental
Note
The "window under cursor" feature is experimental and currently only supports Hyprland (via
hyprctl+gtk-layer-shell).The positioning layer (
gtk-layer-shell) works on all wlroots compositors (Sway, river, wayfire, etc.), but the cursor query currently only supports Hyprland's IPC.If you need support for a specific compositor, please open an issue with the compositor name and we'll look into adding it.
How it works
gtk-layer-shellhyprctl cursorposhyprctl monitors -jOn X11, falls back to standard
window.move(). On unsupported Wayland compositors, the window uses default placement (no crash).Dependencies
gtk-layer-shell(optional) —pacman -S gtk-layer-shellon ArchTest plan
HYPRLAND_INSTANCE_SIGNATUREauto-recoveredjust test)