Got a tip for us? Let us know
|
|
#1 |
|
Terminal command to move terminal window?
I'm a *bit* type-A about the location of my terminal windows. When I toggle between mirrored and dual display mode the terminal windows get bumped around (really annoying!) and I'd like to simple way to put them back where they belong. I have an alias that can resize the window (resize -s 24 80), but I can't figure out how to change the position. Thoughts?
|
|
|
|
0
|
|
|
#2 |
|
Why not just drag them?
__________________
MacBook Pro 2.66GHz C2D 8GB 128GB SSD 9600m
iPhone 4 16GB |
|
|
|
0
|
|
|
#3 |
|
Sorry, you missed the part about me being type-A.
I can drag them, but I swap between mirrored and dual display frequently and its just kind of a pain to drag all five terminals back to their neat little homes. I can resize them easily enough from the terminal and I bet some Unixy-savvy reader will have a suggestion for the pains that ail me. |
|
|
|
0
|
|
|
#4 |
|
I'm fairly sure you can move a window (and resize it) from AppleScript. You could easily write a script that moves and resizes all your Terminal windows to where you want them...
__________________
Sponsor me to cycle 100Km round London in the dark |
|
|
|
0
|
|
|
#5 | |
|
Quote:
I agree with the other poster. If positioning is important, write an AppleScript. You can always execute this script from the command line, if that's what you're concerned about.
__________________
Mehce |
||
|
|
0
|
|
|
#6 |
|
So here is an Applescript hack that works okay:
tell application "Terminal" activate set bounds of window 1 to {0, 0, 505, 320} set bounds of window 2 to {0, 338, 505, 338 + 320} set bounds of window 3 to {505, 0, 505 + 505, 320} set bounds of window 4 to {505, 338, 505 + 505, 338 + 320} set bounds of window 5 to {0, 338 + 338 - 20, 1010, 338 + 338 + 150} end tell The only trouble is that it will rearrange the windows because "window 1" is the most recently active window. Not sure if there is a way to do it based upon the window title, each of which contains "open apple"-# (eg open-apple 1 for the "first" window). This works for now, but if there are other solutions, I'd be curious to hear them. |
|
|
|
0
|
|
|
#7 |
|
I find it extremely annoying how all the windows get moved around when I switch from my 23" ACD to my MacBook's display. I just bought the ACD a few weeks ago and since it's summer I haven't had a need to take my MacBook around, but once school starts back up this Fall I'll be using it a lot and having to reposition all my windows every time will be very annoying. I wish there was a "global" solution to this but I don't think there is.
But on the topic of AppleScript.. you can assign names to your Terminal windows via Terminal (menu bar) > Window Settings, then choose Window from the popup button. Then you can refer to them in AppleScript like this: Code:
set bounds of first window whose name starts with "blah" to {0, 0, 200, 200}
|
|
|
|
0
|
|
|
#8 |
|
If you were running X11 and eTerm, it is pretty simple and can be done via command.
You can also change their size, whether they have borders and control buttons, and their transparency from the command line. But, that requires using a different terminal application :/
__________________
"Many go fishing all their lives without knowing that it is not fish they are after." - Thoreau |
|
|
|
0
|
|
|
#9 |
|
Terminal.app can do it too...
If you'd prefer to use the command line directly, Terminal.app can use xterm escape sequences too. I knocked a shell function out for your use with both moving and resizing Terminal windows. Add the code below to your .bash_profile or .profile. From then on in new terminal windows, you can type:
bumpNjump -x 10 -y 20 -w 800 -h 300 x and y are coordinates for the window; w and h are width and height in pixels The example above moves the window to 10,20 and sets the width to 800 and the height to 300. You don't have to set both the size and the position at the same time if you don't want to. BTW, Bump 'n' Jump: greatest game ever. Code:
function bumpNjump()
{
local xDimension="" yDimension="" width="" height="" OPTIND
while getopts 'x:y:w:h:' thisArg; do
case "${thisArg}" in
x) xDimension="${OPTARG}" ;;
y) yDimension="${OPTARG}" ;;
w) width="${OPTARG}" ;;
h) height="${OPTARG}" ;;
esac
done
if [ -n "${width}" -a -n "${height}" ]; then
echo -en '\E[4;'${height}';'${width}'t';
fi
if [ -n "${xDimension}" -a -n "${yDimension}" ]; then
echo -en '\E[3;'${xDimension}';'${yDimension}'t'
fi
}
|
|
|
|
0
|
|
|
#10 | |
|
Quote:
__________________
Mehce |
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| UUID Command in Terminal? | cdoolittle17 | Mac Programming | 3 | Feb 28, 2014 01:54 PM |
| Mail command in Terminal | lukestroh | OS X Mavericks (10.9) | 6 | Dec 2, 2013 09:14 PM |
| Terminal command | andynewfriends | Mac Basics and Help | 0 | Jun 11, 2013 02:25 PM |
| run terminal command current finder window | SniperUK | Mac Applications and Mac App Store | 3 | Jul 30, 2012 02:52 PM |
| Need command in terminal | chadteetzen | OS X | 1 | Jun 8, 2012 11:55 PM |
|
All times are GMT -5. The time now is 04:55 AM.








Linear Mode
