summaryrefslogtreecommitdiff
path: root/src/caelestia/utils/version.py
diff options
context:
space:
mode:
authorBatuhan Edgüer <67585935+BestSithInEU@users.noreply.github.com>2025-08-18 10:39:35 +0300
committerGitHub <noreply@github.com>2025-08-18 17:39:35 +1000
commitc72223a7e6ede10931be329620d3b76d592b4eef (patch)
treeca1fcd619a335d71364f835329b335845d754a07 /src/caelestia/utils/version.py
parenttheme: add nvtop, htop, and cava support (#45) (diff)
downloadcaelestia-cli-c72223a7e6ede10931be329620d3b76d592b4eef.tar.gz
caelestia-cli-c72223a7e6ede10931be329620d3b76d592b4eef.tar.bz2
caelestia-cli-c72223a7e6ede10931be329620d3b76d592b4eef.zip
feat: window resizer command & daemon (#43)
* resizer: add window resizer daemon command Implements a continuous window resizer daemon that automatically resizes windows based on configurable rules. Features include: - Listens to Hyprland socket events for real-time window detection - Supports multiple match types: initial_title, title_contains, title_exact - Configurable via CLI config file with fallback to sensible defaults - Rate limiting to prevent excessive resize operations - Window actions: float, center, and custom dimensions - Integration with existing CLI structure Usage: caelestia resizer --daemon * refactor: replace pip daemon with integrated resizer functionality ## Summary - Remove standalone pip daemon and integrate its functionality into the resizer - Add regex matching, config support, and active mode to resizer - Implement clean 'caelestia resizer pip' command for quick PiP operations - Update keybinds to use new unified resizer command ## Why Replace the Old PiP Method? ### 1. Code Duplication The old pip daemon duplicated window management logic that already existed in the resizer: - Both daemons listened to Hyprland socket events - Both had similar window detection and manipulation code - Both needed rate limiting and error handling ### 2. Limited Functionality The old pip daemon was restricted: - Only worked with regex pattern matching for 'Picture in Picture' titles - No configuration support for custom rules - No way to apply PiP to arbitrary windows - No integration with other window actions ### 3. Maintenance Overhead Having two separate daemons created maintenance issues: - Two different codebases to maintain and debug - Potential conflicts when both daemons run simultaneously - Inconsistent error handling and logging approaches ### 4. Review Feedback Implementation The PR review specifically requested this consolidation: - "This can actually probably replace the pip daemon entirely" - "consider adding a regex match mode and pip action, then add that to the default rules" ## New Integrated Approach Benefits ### 1. Unified Window Management - Single daemon handles all window operations (resize, float, center, pip) - Consistent configuration format using camelCase - Shared error handling and rate limiting ### 2. Enhanced PiP Functionality - Works with any window title pattern (regex, contains, exact) - Configurable through CLI config file - Active mode: `caelestia resizer pip` for quick PiP on current window - Better error messages and user guidance ### 3. Future-Proof Architecture - Easy to add new window actions (e.g., minimize, maximize, workspace move) - Extensible pattern matching (could add class-based matching) - Single place to implement new Hyprland features ### 4. Improved User Experience - Simpler command structure: `caelestia resizer pip` vs complex arguments - Better error messages when windows aren't floating - Consistent CLI interface across all window operations ## Implementation Details - Added pip action to WindowRule system - Integrated original pip calculation with minimum size constraints - Added type safety improvements throughout - Maintained backward compatibility for existing users - Updated keybind: `bind = $kbWindowPip, exec, caelestia resizer pip` * fix: unpack dispatch_commands list in hypr.batch call - Fix 'sequence item 0: expected str instance, list found' error - hypr.batch() expects individual string arguments, not a list - Use *dispatch_commands to unpack the list properly * fix: handle Hyprland event format with triple > separators - Fix window ID parsing for events with >>> instead of >> - Add .lstrip('>') to remove any leading > characters - Support both >> and >>> formats for compatibility - Fixes 'Invalid window ID format: >555ee935ba30' errors * resizer: implement active mode for all matching windows Active mode now searches through all open windows and applies the rule to any that match the specified pattern, rather than just checking if the currently active window matches. This allows for batch operations on multiple windows with the same pattern. Special case: using pattern "active" will still target only the currently active window, allowing users to apply rules to just the focused window when needed. This addresses the latest review feedback requesting that active mode work on any open window that matches the given pattern. * parser: better resizer help * completions: add for resizer --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'src/caelestia/utils/version.py')
0 files changed, 0 insertions, 0 deletions