Commit Graph

22 Commits

Author SHA1 Message Date
Chea Vuthearith 164bda5462 record: add arg to copy screen recording to clipboard (#83) 2026-02-10 20:53:27 +11:00
2 * r + 2 * t 2eda287a80 record: wl-screenrec -> gpu-screen-recorder
Supports NVIDIA, so no need for having a fallback
Also supports pausing
2025-09-13 22:58:57 +10:00
Batuhan Edgüer c72223a7e6 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>
2025-08-18 17:39:35 +10:00
2 * r + 2 * t 0df89887a0 toggle: improvements
Closes #40
2025-08-16 17:41:23 +10:00
2 * r + 2 * t d8037819f0 ci: add flake update workflow
Also add contributing, funding and issue templates

parser: add kill option to shell
version: fix errors when not on arch
2025-08-04 15:40:17 +10:00
2 * r + 2 * t 13a2d46d08 shell: remove default log rules
The spammy logs have been silenced
2025-07-22 19:12:28 +10:00
2 * r + 2 * t 9b01d62dc1 feat: add version flag 2025-07-04 20:45:53 +10:00
2 * r + 2 * t 9ed04e7a85 wsaction: remove 2025-06-24 23:53:44 +10:00
2 * r + 2 * t dcd3cdc864 emoji: add fetch option 2025-06-23 14:11:05 +10:00
2 * r + 2 * t 2664749c75 shell: disable textinput log warning 2025-06-19 17:28:21 +10:00
2 * r + 2 * t 0714622d09 shell: filter log 2025-06-19 15:47:44 +10:00
2 * r + 2 * t 83148d9351 shell: no duplicate + daemon option 2025-06-17 22:21:12 +10:00
2 * r + 2 * t 2c94c42cbd scheme: add notify opt
For sending a notification on error
2025-06-17 12:49:16 +10:00
2 * r + 2 * t 6284c74a32 scheme: add list and get subcommands 2025-06-17 12:10:31 +10:00
2 * r + 2 * t b805f8d677 feat: impl recording subcommand 2025-06-14 02:11:10 +10:00
2 * r + 2 * t 796d538b16 feat: impl screenshot command 2025-06-13 00:42:46 +10:00
2 * r + 2 * t c043a14ca2 feat: impl wallpaper 2025-06-12 21:35:05 +10:00
2 * r + 2 * t e75e727262 scheme: add variant option
Remove variant subcommand
2025-06-12 16:23:14 +10:00
2 * r + 2 * t f43987ef2f feat: impl scheme command (partial) 2025-06-11 18:07:34 +10:00
2 * r + 2 * t dc855e1b01 internal: refactor scheme
Also use a single file to store scheme data
2025-06-11 17:37:04 +10:00
2 * r + 2 * t a4f5138d41 parser: print help when no args
Also create utility script for testing
2025-06-11 15:43:32 +10:00
2 * r + 2 * t f663e6f690 internal: refactor for packaging
Package using python-build, python-installer and hatch
2025-06-11 00:41:05 +10:00