Skip to content

Conversation

@phoeagon
Copy link
Contributor

Enhance rectangleWin to have the following features:

  1. default corner key binding with ctrl-alt-U|I|J|K.
  2. ctrl-alt-shift-UP: make the current window take the full height of screen.
  3. ctrl-alt-+ make current window larger.
  4. ctrl-alt-- make current window smaller.
    All these bindings are the same as default rectangle on Mac when used with a Windows keyboard.

add ctrl-alt-[U I J K] as the hot key to resize to 4 corners, cycling between 1/2, 1/3 and 2/3.
It's similar to the setup of ctrl-win-alt-up|down|left|right, except that this is more aligned with default rectangle key bindings on mac w/ a windows keyboard.
add doc on ctrl-alt-u|i|j|k
add a few more hotkeys
@phoeagon phoeagon changed the title Adds alternative bindings for corner functions, max-height function and make larger/smaller Add a YAML config based configuration path. Adds alternative bindings for corner functions, max-height function and make larger/smaller Sep 2, 2025
@phoeagon
Copy link
Contributor Author

phoeagon commented Sep 2, 2025

Adds a yaml based config workflow.
Minor changes to main.go to ensure console outputs are preserved as well.

@ahmetb
Copy link
Owner

ahmetb commented Sep 7, 2025

These are all good but I think we should try to split into smaller PRs so I can adequately review.

Also it might be good to send a proposal issue first so we can discuss. What do you think?

@ahmetb
Copy link
Owner

ahmetb commented Sep 9, 2025

Any interest in splitting the PR?

@phoeagon
Copy link
Contributor Author

phoeagon commented Sep 9, 2025

Sure! Please let me know how you would like the change structured. There are a few generally orthogonal things:

  1. config yaml
  2. additional functions (maxheight, etc)
  3. fixing github workflows, etc.
    I've opened an FR... (oh I see you mean open a PR not FR).
    do you have a strong opinion on each of these?
    Thanks!

@phoeagon
Copy link
Contributor Author

phoeagon commented Sep 9, 2025

Created 2 separate FRs.
Please let me know if you would like to have the maxheight, etc, features added without the configuration feature. That would require a bit of rewriting and reverting on my end to reproduce the results.
Thanks!

Copy link
Owner

@ahmetb ahmetb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fantastic work, thank you. i'm really excited about the prospects.

- Press multiple times to alternate between ½, ⅔ and ⅓.

- **Corner snapping**
- <kbd>Win</kbd> + <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>&larr;</kbd>: top-left ½, ⅔ and ⅓
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something i've been imagining is that we allow users to configure:

steps: [0.33, 0.5, 0.66, 1]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea! I think this may take a bit more work on conf though and is conceptually quite independent from the main hotkey assignment part. do you mind if we track this separate?
Thanks!

README.md Outdated
Comment on lines 39 to 43
The following are also available if you use the attached `config.yaml`:
- <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>U</kbd>: top-left ½, ⅔ and ⅓
- <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>I</kbd>: top-right ½, ⅔ and ⅓
- <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>J</kbd>: bottom-left ½, ⅔ and ⅓
- <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>K</kbd>: bottom-right ½, ⅔ and ⅓
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably elide this section and move it down below to the sample config.
it's rather random to have other bindings when you have a file present on disk (the file should override the defaults)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved.


## Configuration

Configuration could be achieved by changing `config.yaml` in the same folder.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some major things I always wanted to do:

  1. the path to config file is something well known, like %HOME%/.config/rectanglewin/config.yaml

  2. the program should create the default config file if it's missing (we can have a nice config file with inline comments etc).

  3. the tray icon has an item called "Preferences" that launches a notepad.exe with the config file.

Stretch goal: I suspect we'll add new configs over time --we gotta find a way to update the config file with the "new" defaults the program ships with.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Updated the files (please see #14) to:

  1. automatically drop this config.yaml if missing at %HOME%/.config/RectangleWin/config.yaml
  2. load from aforementioned path
  3. Add an option to load notepad.exe on that file

I think it may take more work to add a "reload" option in the context menu, due to this process registering hotkeys, which must happen after parent process quits, introducing needs for additional interprocess synchronization.

@@ -0,0 +1,68 @@
keybindings:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if this is the default, let's call it config.default.yaml + add comments?

we can also use //go:embed to add this file into the binary so the binary auto-installs this file to the disk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. "embed" is a great idea!

…onfig/RectangleWin/config.yaml if missing, instad of the current folder
…aveat of this is that there's no simple way to reload after changing and saving it in notepad.exe, due to the need for a more complex synchronization for this reload
…n now be automatically created by the main EXE
@phoeagon
Copy link
Contributor Author

@ahmetb I've moved this to #14 which might be cleaner, especially for github workflows that might not be easy to integrate back. (Please feel free to close this one and use #14 for review) (for clarity, I'm responding to the comments here as well)

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.

2 participants