Skip to content

Add runtime output format cycling - #173

Open
gusjengis wants to merge 4 commits into
hyprwm:mainfrom
gusjengis:feature/format-cycling
Open

gusjengis wants to merge 4 commits into
hyprwm:mainfrom
gusjengis:feature/format-cycling

Conversation

@gusjengis

@gusjengis gusjengis commented Sep 14, 2026 •

Copy link
Copy Markdown

Summary

Adds runtime output-format cycling without changing existing default behavior. Press f while picking to cycle formats, optionally remap that key, and opt in to remembering the selected format between runs.

Commit details

c19dab7 Input: cycle color formats with F

  • handles f and F in the active Wayland keyboard callback
  • cycles through CMYK, HEX, RGB, HSL, and HSV
  • selects the matching default output template for each format
  • marks layer surfaces dirty so the live preview updates immediately
  • uses the selected format when the color is picked

44627e7 Input: allow remapping format cycle key

  • adds long-only --format-key=KEY
  • accepts xkb keysym names such as g, space, or an XF86... symbol
  • validates the supplied keysym and rejects unknown names
  • compares keysyms case-insensitively, preserving f/F behavior
  • keeps f as the default and intentionally provides no -k alias

170258c Output: remember last selected format

  • adds helpers to restore and save format state
  • stores readable format names such as hex or rgb
  • uses $XDG_STATE_HOME/hyprpicker/format when XDG_STATE_HOME is set
  • otherwise uses $HOME/.local/state/hyprpicker/format
  • ignores missing or invalid state and falls back safely
  • saves only after a color is selected

47a47a8 Output: make format persistence opt-in

  • adds long-only --remember-format
  • reads and writes format state only when this option is present
  • preserves existing HEX default for scripts and users not passing the option
  • keeps explicit --format authoritative when combined with --remember-format

Examples

# Existing behavior: starts in HEX and does not persist state
hyprpicker

# Cycle formats with Space
hyprpicker --format-key=space

# Restore and save the selected format
hyprpicker --remember-format

# Start in RGB for this run, then remember the final selected format
hyprpicker --format=rgb --remember-format

Testing

  • nix build .#hyprpicker
  • manually launched picker and cycled formats
  • verified --remember-format is accepted and has no short alias
  • verified invalid --format-key values are rejected
  • verified final diff passes git diff --check

@gusjengis

Copy link
Copy Markdown
Author

Code and PR by 5.6-Sol

@gusjengis
gusjengis marked this pull request as ready for review September 14, 2026 22:11
@gusjengis

Copy link
Copy Markdown
Author

In light of a recent discussion, I feel bad about this, more than I already did.
Main intent was to share what I thought was a good idea, shouldn't have done it in the form of this chaotic slop PR, feels rude, sorry vax.

I'll leave it open just so it get's considered, since I do like the idea, but feel free to close it on sight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant