Make Smaller/Make Larger, add height Only option
Is it possible to add a height Only option to resizing?
Height/Width are useful as separate commands to be able to adjust windows to the exact size you want without leaving the keyboard
Separately, I just migrated from Rectangle -> Rectangle Pro, and added the widthOnly config (replacing w/ Hookshot) and that doesn't seem to be working
It looks like this config was merged into Rectangle open source in November 2024, so perhaps it hasn't made it to Rectangle Pro?
https://github.com/rxhanson/Rectangle/pull/1504
It looks like this config was merged into Rectangle open source in November 2024, so perhaps it hasn't made it to Rectangle Pro?
Correct. Are you up for trying out a pre-release version that also has smallerHeight & largerHeight as Terminal command configuration? I thought I had a version ready to test, but looks like it had some rough edges that I still have to iron out.
Saw your edit - def interested in testing it once you have a beta release ready
Saw the latest release (which includes addWidth), was height added or is that still in progress?
It's in there. Let me know if it's not working for you.
Not able to access smallerHeight and largerHeight
Attaching terminal commands to show how the config is set (also restarted Rectangle Pro to make sure it took effect)
username@Mac ~ % defaults read com.knollsoft.Hookshot smallerHeight
{
keyCode = 33;
modifierFlags = 786432;
}
username@Mac ~ % defaults read com.knollsoft.Hookshot largerHeight
{
keyCode = 30;
modifierFlags = 786432;
}
username@Mac ~ % defaults read com.knollsoft.Hookshot largerWidth
2025-01-17 14:23:28.227 defaults[1945:11136426]
The domain/default pair of (com.knollsoft.Hookshot, largerWidth) does not exist
username@Mac ~ % defaults read com.knollsoft.Hookshot smallerWidth
2025-01-17 14:23:34.078 defaults[1946:11136452]
The domain/default pair of (com.knollsoft.Hookshot, smallerWidth) does not exist
Included the output of largerWidth and smallerWidth just to show they aren't conflicting w/ same keycodes.
If I flip this around (same keycodes, but using largerWidth and smallerWidth) it works for width adjustments.
Am I using the wrong name for the height commands? (smallerHeight, largerHeight)
I'm glad I found this post! I noticed that the free Rectangle app provided a way to configure smallerWidth and largerWidth in the UI (found the keys themselves in the JSON export), even though Rectangle Pro doesn't seem to:
The discussion above made me realize that the settings could be set via defaults write, and I can confirm that setting dict objects with keyCode and modifierFlags did work for me: I'm now able to make windows taller, shorter, wider, or narrower using custom shortcuts.
Here's how I configured these values:
#!/bin/bash
# Rectangle Pro configuration script
BUNDLE_ID="com.knollsoft.Hookshot"
# With no bits overlapping, adding is the same as OR'ing them
MOD_CMD=$((0x100000))
MOD_OPT=$((0x80000))
MOD_CTRL=$((0x40000))
MOD_SHIFT=$((0x20000))
# See https://eastmanreference.com/complete-list-of-applescript-key-codes
LETTER_H=4
LETTER_L=37
LETTER_J=38
LETTER_K=40
# This is *my* preference, choose whatever works for you
MOD=$(($MOD_CTRL + $MOD_OPT + $MOD_SHIFT))
INCREMENT_SIZE_PX=30
# Make window narrower: Ctrl+Opt+Shift + H
defaults write $BUNDLE_ID smallerWidth -dict keyCode -int $LETTER_H modifierFlags -int $MOD
# make window wider: Ctrl+Opt+Shift + L
defaults write $BUNDLE_ID largerWidth -dict keyCode -int $LETTER_L modifierFlags -int $MOD
# Make window shorter: Ctrl+Opt+Shift + J
defaults write $BUNDLE_ID smallerHeight -dict keyCode -int $LETTER_J modifierFlags -int $MOD
# Make window taller: Ctrl+Opt+Shift + K
defaults write $BUNDLE_ID largerHeight -dict keyCode -int $LETTER_K modifierFlags -int $MOD
# By how many pixels the width or height changes each time
defaults write $BUNDLE_ID sizeOffset -float $INCREMENT_SIZE_PX
I then restarted Rectangle Pro and was able to use these shortcuts successfully.
After restarting I exported RectangleProConfig.json and saw that the 4 new shortcuts had been included. I assume/hope this means they won't be discarded or overwritten as I make unrelated changes in the settings, or when the app is updated.
I don't really mind doing this, but I think it's a great feature and I'm sure more people would enjoy it if it was also configurable in the UI.
Thanks again for this great app!
After restarting I exported RectangleProConfig.json and saw that the 4 new shortcuts had been included. I assume/hope this means they won't be discarded or overwritten as I make unrelated changes in the settings, or when the app is updated.
Don't worry, they will persist along with other settings/updates.
I don't really mind doing this, but I think it's a great feature and I'm sure more people would enjoy it if it was also configurable in the UI.
Agreed, it's in the works.