fitztrev / shuttle

A simple shortcut menu for macOS
http://fitztrev.github.io/shuttle/
MIT License
4.55k stars 393 forks source link

"theme" command setting seems to ignore window dimensions #251

Open ChrisMoriarty opened 5 years ago

ChrisMoriarty commented 5 years ago

What I choose as my default theme in the Terminal preferences seems to drive the dimensions of the window, even if I specify other themes in the json file.

When I specify a theme parameter (eg "theme": "Ocean"), the colors work, but shuttle seems to ignore the specific window dimensions. Instead it uses the dimensions from the default theme.

I am using Terminal.app as my terminal, and I'd like to apply a custom theme to a few of my commands. One of which requires a longer terminal window. A workaround is to make the default terminal theme have a longer window. But now all my terminal windows are long.

thshdw commented 5 years ago

Hi @ChrisMoriarty any difference if this is a new tab or a new window?

thshdw commented 5 years ago
              "cmd": "ssh username@blog2.example.com",
              "inTerminal": "tab",
              "name": "SSH blog - Opens in Tab of active window",
              "theme": "Ocean",
              "title": "title of tab"

or

              "cmd": "ssh username@blog3.example.com",
              "inTerminal": "new",
              "name": "SSH blog - Opens in new window",
              "theme": "Ocean",
              "title": "title of window"

does it work with tab or new?

ChrisMoriarty commented 5 years ago

Tab is sort of irrelevant here, isn't it? The use case is for "new" window, with it's own dimensions. For science, I added the tab sample you pasted and tried it both with an existing window, and with no terminal open. Both open with the default dimensions, not the dimensions specified in the Ocean theme.

thshdw commented 5 years ago

Thanks for testing. I'll look into this.

Are the colors you have in the Ocean theme getting applied?

ChrisMoriarty commented 5 years ago

Np. Yes, the colors got applied both for "tab" and "new".

thshdw commented 5 years ago

It seems that applescript is ignoring the size because it has its own sizing capability with the bounds property. Maybe this is better anyway because you could then set the x and y positions.

set bounds of front window to {800, 96, 80, 500}

screen shot 2019-02-19 at 10 38 08 pm
ChrisMoriarty commented 5 years ago

I'm not sure I follow. Are you saying I can specify "bounds" as a command setting?

thshdw commented 5 years ago

I will need to add a size declaration the the command settings. Something like:

"size": "VALUE"

Then we can pass this value to the applescript

thshdw commented 5 years ago

I need to do some testing to see if this is occurring with iTerm themes

thshdw commented 5 years ago

I need to do some testing to see if this is occurring with iTerm themes

iTerm is correctly setting the window size in the profile/theme.

I'll make another set of applescripts specifically for window positioning. This way users won't be forced to set a size on every command. If you don't want to set a position and size for your terminal window then nothing will change. If you specify a position and size then shuttle will use specific positioning applescripts.

This will only work with commands run in new windows. If you have the size setting in your command options I'll force a new window.

ChrisMoriarty commented 5 years ago

That's good to know that iTerm works. I thought about giving it a try at some point. Your solution sounds good to me. Good luck, and thanks for taking the time to fix it.