-
Notifications
You must be signed in to change notification settings - Fork 18
Add a YAML config based configuration path. Adds alternative bindings for corner functions, max-height function and make larger/smaller #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
|
Adds a yaml based config workflow. |
create a release workflow
attempt to use go build cache v4
set up to use actions/setup-go@v4
switch new ways to set cache paths in ci.yml
|
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? |
…correctly parsed as float
|
Any interest in splitting the PR? |
|
Sure! Please let me know how you would like the change structured. There are a few generally orthogonal things:
|
|
Created 2 separate FRs. |
ahmetb
left a comment
There was a problem hiding this 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>←</kbd>: top-left ½, ⅔ and ⅓ |
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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
| 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 ⅓ |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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:
-
the path to config file is something well known, like
%HOME%/.config/rectanglewin/config.yaml -
the program should create the default config file if it's missing (we can have a nice config file with inline comments etc).
-
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.
There was a problem hiding this comment.
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:
- automatically drop this config.yaml if missing at %HOME%/.config/RectangleWin/config.yaml
- load from aforementioned path
- 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: | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Enhance rectangleWin to have the following features:
All these bindings are the same as default rectangle on Mac when used with a Windows keyboard.