Skip to content

Add configurable y-offset for SketchyBar position - #7

Open
sameer-b wants to merge 1 commit into
malpern:mainfrom
sameer-b:y-offset-config
Open

Add configurable y-offset for SketchyBar position#7
sameer-b wants to merge 1 commit into
malpern:mainfrom
sameer-b:y-offset-config

Conversation

@sameer-b

@sameer-b sameer-b commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Makes the y_offset used when showing SketchyBar configurable via a new --y-offset flag. Previously the resting position was hardcoded to y_offset=0, which breaks for users who have a non-zero y_offset in their SketchyBar config. When the flag is not provided, behavior is identical to before (defaults to 0).

Changes

  • Config.swift: Added optional yOffset property (CGFloat?, default nil) and --y-offset <px> argument parsing
  • SketchyBarController.swift: Accepts optional yOffset in init. When set, uses the user value as the resting position and value - 50 as the off-screen animation start. When nil (default), uses original hardcoded values
  • main.swift: Passes config.yOffset to controller, includes it in startup log and help text
  • ConfigTests.swift: Added test for --y-offset parsing, updated default test to expect nil

Usage

sketchybar-toggle --y-offset 10

This lets users match whatever y_offset they have configured in their SketchyBar config without sketchybar-toggle overriding it to 0.

Screen.Recording.2026-07-09.at.7.49.30.PM.mov

- Add --y-offset CLI flag to Config.swift (CGFloat?, defaults to nil)
- Update SketchyBarController to use configurable yOffset instead of hardcoded 0
- Preserve original behavior when --y-offset is not set
- Add test for --y-offset parsing
@sameer-b

Copy link
Copy Markdown
Author

Addresses: #4

@sameer-b

Copy link
Copy Markdown
Author

@malpern 🙏

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