How to set default Window position and/or size?

Whenever I start an application like Terminal or Preview, they are always opened as a small window on the top left corner of the screen. Is there any way to set them to open in the center of the screen? Preferably maximized too?


Solution 1:

In Terminal you can change the default window size from Preferences > Settings > Window:

You can also use window groups to set a default position and size for the window opened when you launch Terminal (but not for new windows opened later).

I use Sequential and Skim as alternatives to Preview and iTerm 2 as an alternative to Terminal. All of them have an option to open windows in full screen by default, and all of them have their own (pre-Lion and actually usable) implementations for full screen windows.

The sizes of Finder windows are saved in .DS_Store files and there are no default window size settings in com.apple.Finder.plist or anything. I use a script like this to reset the properties of windows:

tell application "Finder"
    if number of Finder windows is 0 then return
    tell Finder window 1
        set toolbar visible to false
        set sidebar width to 0
        set statusbar visible to false
        set current view to column view
        set bounds to {960, 44, 1920, 1076}
        tell its column view options
            set shows icon to false
        end tell
    end tell
end tell

Solution 2:

Slate (a window manager) is extremely configurable, and using the JavaScript config file will allow you to do this. Events like a window opening can be handled with a JavaScript callback which moves the window to fill the screen.

An example of what you want: (taken pretty much directly from the wiki page)

slate.on("windowOpened", function(event, win) {
    if (win.app().name() === "Terminal" || win.app().name() === "Preview") {
        win.move("x" : "screenOriginX", "y" : "screenOriginY",
                 "width" : "screenSizeX", "height" : "screenSizeY");
    }
});

Solution 3:

I'd like to help you with the correct answer which is given on SuperUser: What controls saved / default window sizes and positions in OS X?

Next to that, if you don't want to mess with the .plist files I can recommend you BetterSnapTool which can be used to drag a program to the top of a screen like you can do in Windows 7 by default.