Commit Graph

57 Commits

Author SHA1 Message Date
Kalagmitan b00c601d0a refactor: enforce stricter type hints (#91)
LSP was screaming at me so I decided to just address it to get it off my
screen.

+ Fixed the type hints
:= Modified and added type hints for certain functions and variables in
most of the files in the utils/ folder (and some in the subcommands/
folder) for clarity and so pyright's type checker wouldn't cry.
:+ To resolve certain type issues, I had to add a bit more tiny
additional code such as, additional checks if a variable is None, a tiny
class in utils/material/generator.py to resolve the constructor usage
mismatch between what the DynamicScheme accepts and what the code
actually passes, and etc.
- Renamed certain functions and variables for clarity and also for some
to not collide with pre-existing definitions from well-known library
imports.
+ PIL has reorganized their code a bit, so the code is made to reflect
their new definitions.
= Reorganized the single import statement for "colourfulness" in
utils/wallpaper.py to be close to the top.
(I think that's it)

Side Effects?:
Everything should work the same as no logic change was done whatsover
(unless we consider the added if statements for type checking as a logic
change). I've tested it, everything seems to be in urdir.
2026-03-15 22:56:05 +11:00
2 * r + 2 * t cc155cf432 fix: format 2026-03-09 21:26:37 +11:00
Chea Vuthearith 164bda5462 record: add arg to copy screen recording to clipboard (#83) 2026-02-10 20:53:27 +11:00
Evence Wang 57dfea955e shell: fix log rules arg (#67) 2025-11-04 23:13:00 +11:00
2 * r + 2 * t ad6df1c9d2 record: add extraArgs config 2025-09-15 23:18:08 +10: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
sweenu 3319d2ca19 theme: continue execution after failure for one theme (#50) 2025-09-09 13:59:04 +10:00
hoangbaoa c20bc567a4 resizer/pip: account for monitor scale (#51) 2025-09-08 23:32:30 +10:00
Matheus Oliveira 35b10394b6 record: fix wf-recorder audio flag and proc error handling (#48)
* fix(recording): Fix wf-recorder audio flag and improve process monitoring

- Fix incorrect audio flag format for wf-recorder(Invalid whitespace)
  Changed from `-a <device>` to `--audio=<device>` as per wf-recorder docs:
  "Specify device like this: -a<device> or --audio=<device>"

- Add fallback to IDLE audio sources
  Audio sources are typically in IDLE state when no media is playing.
  Now falls back to IDLE sources if no RUNNING sources are found,
  ensuring audio capture works when recording starts during silence
  but media plays later.

- Improve process startup monitoring
  The 0.1s sleep was insufficient for reliable process detection on NVIDIA systems.
  Process would start and immediately die ~90% of the time when triggered via keybinds.
  Now shows immediate UI feedback then monitors for 3 seconds to ensure
  stable process startup while maintaining responsive user experience.

* check returncode + timeout 3s -> 1s + format

---------

Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
2025-08-30 21:59:26 +10:00
2 * r + 2 * t db1e0da5bb Revert "shell: set QT_QPA_PLATFORMTHEME env"
This reverts commit 99142f11ad.
2025-08-23 22:31:18 +10:00
Matheus Oliveira 12f0d51862 record: use correct proc (#47)
Previously, the start() function always invoked 'wl-screenrec' regardless of detected GPU, which prevented recording on systems with NVIDIA GPUswhen 'wf-recorder' is available.

This change updates start() to launch the recorder stored in
self.recorder, ensuring the correct recorder is used based on GPU detection.
2025-08-20 12:19:06 +10:00
2 * r + 2 * t 99142f11ad shell: set QT_QPA_PLATFORMTHEME env
Hopefully fixes most people's icon issues

Fixes caelestia-dots/shell@390
2025-08-19 17:15:36 +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 b22ab08a37 pip: use batch request 2025-08-17 15:02:12 +10:00
2 * r + 2 * t e325129f7a record: fix region 2025-08-16 18:05:33 +10:00
Batuhan Edgüer 651efcd137 record: add NVIDIA GPU support with wf-recorder (#41)
* record: add NVIDIA GPU support with wf-recorder

- Add automatic GPU detection to choose between wl-screenrec and wf-recorder
- Use wf-recorder for NVIDIA GPUs to fix compatibility issues
- Map wf-recorder arguments correctly for region, output, and audio recording
- Update documentation to include wf-recorder as dependency for NVIDIA users

Fixes #37

* format + deduplicate

---------

Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
2025-08-16 18:05:02 +10:00
2 * r + 2 * t 0df89887a0 toggle: improvements
Closes #40
2025-08-16 17:41:23 +10:00
2 * r + 2 * t c9c1be183a toggle: fix specialws 2025-08-16 16:13:02 +10:00
anders130 1fcfb83fba record: fix multi-monitor and moving across filesystems (#38)
* fix(record): support differing filesystems for recording destination

* fix(record): for multi-monitor-systems wl-screenrec needs a -o argument

* fix(record): replace path.rename with shutil.move

* fix(record): use json option to retrieve hyprland focused monitor

* use generator

---------

Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
2025-08-13 16:07:12 +10:00
2 * r + 2 * t f541e99d07 pip: add monitor offset
Fixes #30 (hopefully)
2025-08-04 17:48:58 +10:00
2 * r + 2 * t ae8deb35a7 toggle: allow configuring
Closes #33
2025-08-04 17:33:43 +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
Soramane 2bde2ddfbf shell: fix log when no log rules
also fix nix devshell
2025-07-25 11:41:58 +10:00
2 * r + 2 * t 882adb2c6c record: don't use hevc codec
Cause incompatible with some players (mainly discord)
2025-07-23 18:29:28 +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
Soramane 6a1499f8f0 shell: remove qproc filter
unecessary, was removed in qs update
2025-07-16 18:31:18 +10:00
2 * r + 2 * t 7264b5b0f5 shell: reorder qs args
So nix substituteInPlace works better
2025-07-11 15:39:42 +10:00
2 * r + 2 * t a2cc4f506d record: ensure recordings dir exists
Fixes caelestia-dots/shell#199
2025-07-07 14:26:34 +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 e691dfb7fc record: fix dir not exists error 2025-06-21 12:31:26 +10:00
2 * r + 2 * t 0714622d09 shell: filter log 2025-06-19 15:47:44 +10:00
2 * r + 2 * t 09aac14842 screenshot: use shell for region 2025-06-19 15:05:44 +10:00
2 * r + 2 * t 100100ac5f scheme: fix list when no wallpaper 2025-06-18 18:52:33 +10:00
2 * r + 2 * t 83148d9351 shell: no duplicate + daemon option 2025-06-17 22:21:12 +10:00
2 * r + 2 * t 1ab61223c6 scheme: dump scheme data when no args to list 2025-06-17 14:03:51 +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 4f6b4ef27e toggle: source fish on btop startup 2025-06-16 16:14:39 +10:00
2 * r + 2 * t 8d86facd2f material: fix colour generation
score needs to take a string path
2025-06-15 16:16:49 +10:00
2 * r + 2 * t 7cfbd8a640 shell: fix starting shell
Don't silence shell output
Also use -c caelestia cause install to system
2025-06-15 15:49:07 +10:00
2 * r + 2 * t fd8ab97d3a screenshot: kill wayfreeze even if no selection
Also fix slurp being hidden by wayfreeze
2025-06-14 23:57:49 +10:00
2 * r + 2 * t 4409620ac7 feat: impl pip subcommand 2025-06-14 15:34:47 +10:00
2 * r + 2 * t 427b9185a8 feat: impl emoji picker subcommand 2025-06-14 15:08:03 +10:00
2 * r + 2 * t 15c47a622d feat: impl clipboard subcommand 2025-06-14 15:03:58 +10:00
2 * r + 2 * t b805f8d677 feat: impl recording subcommand 2025-06-14 02:11:10 +10:00
2 * r + 2 * t 9da9d7bb1b wallpaper: fix when no wall 2025-06-13 14:50:25 +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