Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Start a Terminal window in the Dock Apps
I have noted many tips regarding Terminal. This one humbly refers to yet-another-parameter available in the .term files.

Almost since the start, I have wanted a mechanism to start a terminal session but not put a window on the screen. That is, start a terminal process in the dock. In my case I collect email via pop3 from a remote source and use ssh tunnelling to connect to the pop3 service via an encrypted connection (also incorporatng ssh-agent, but that is another story). So far I've just started a new terminal window with the ssh execution string. But inspired by a rather good article at ResExcellence, I found that there is an XML key existent in any saved .term files that does the trick.

Configure a terminal how you need it then save it (either 'all windows' or 'main window') and edit, with your favourite text editor, the resultant .term file. Find the key isMiniaturized and set its value to YES. Now whenever this term file is launched, the corresponding terminal session will start in the dock. Ideal when no user interaction is required.

[robg adds: Anonymous also appended a help request regarding Terminal keyboard mapping, which I have removed as it was unrelated to the content of the hint. Unfortunately, Anonymous didn't leave an email address in their hint submission, so I cannot contact them for further assistance with their query!]

    •    
  • Currently 2.33 / 5
  You rated: 4 / 5 (3 votes cast)
 
[4,419 views]  

Start a Terminal window in the Dock | 8 comments | Create New Account
Click here to return to the 'Start a Terminal window in the Dock' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Start a Terminal window in the Dock
Authored by: bluehz on Feb 21, '03 12:15:11PM

At one time I saw a simple one liner script for creating a popup message in the Finder using teh terminal - does anyone remember where that is or what the command was. Would be useful for a terminal in the dock...



[ Reply to This | # ]
Do you mean this?
Authored by: Cantus on Feb 21, '03 09:36:58PM
osascript -e tell\ application\ \"Finder\" -e activate -e display\ dialog\ \"Hello\ World\"\ buttons\ \{\"Cancel\",\ \"OK\"\}\ default\ button\ 2 -e end\ tell

[ Reply to This | # ]
Do you mean this?
Authored by: Cantus on Feb 21, '03 09:43:17PM
Oh hell, this looked good in the Preview, but it removed all backslashes on Submit Comment.

Add a backslash (\) before every space, every ", and before { and }.

Grr.

[ Reply to This | # ]

Use the [ code ] tag...
Authored by: robg on Feb 22, '03 03:42:28PM
One of the new features in this Gl upgrade is the [ code ] tag. Use it when submitting, and it will leave your backslashes alone. Anything between [ code ] and [ /code ] will be 100% ignored by Geeklog. Just remove the extra spaces I added to the tags so that they get interpreted, and you'll get:
\ > < special characters are fine now < > \
Still not perfect, but much better than before. -rob.

[ Reply to This | # ]
Do you mean this?
Authored by: bluehz on Feb 24, '03 07:33:04AM

thx - that was it exactly!

There used to be a timeout parameter for "display dialog" that would close the dialog after reset time period. Does any one know if that still works.



[ Reply to This | # ]
giving up after seconds...
Authored by: ChaChi on Jun 10, '05 05:24:45PM
To make an applescript dialog timeout after a specified length of time you'd just add "giving up after (seconds)" to the "display dialog" command.

Here's an example that will "timeout" after 5 seconds:

osascript -e 'tell application "Finder"' -e 'activate' -e 'display dialog "Hello World" buttons {"Cancel", "OK"} default button 2 giving up after 5' -e 'end tell'

Here's another way of doing this using "System Events" instead of the "Finder":

osascript -e 'set theReturn to ASCII character 10' -e 'set theIcon to posix file "/Applications/Utilities/Terminal.app/Contents/Resources/icon.icns"' -e 'tell application "System Events"' -e 'set FrontMostApp to (name of processes whose frontmost is true) as string' -e 'activate' -e 'set thePassword to text returned of (display dialog "Enter Your Administrator Password:" buttons {"Cancel", "OK"} default button 2 default answer "password" with title "Terminal Alert" giving up after 60 with icon file theIcon with hidden answer)' -e 'set frontmost of process FrontMostApp to true' -e 'end tell' -e 'return theReturn & "The Password Entered Was: \"" & thePassword & "\"" & theReturn'

Hope this helps...

[ Reply to This | # ]
Do you mean this?
Authored by: ChaChi on Jun 10, '05 05:30:24PM
Sorry, the last part of the second example above should read:
-e 'return theReturn & "The Password Entered Was: \"" & thePassword & "\"" & theReturn
I thought I had checked the code for any "special" characters.

[ Reply to This | # ]
Start a Terminal window in the Dock
Authored by: wilton on Feb 22, '03 05:48:55AM

Use SSHTunnelManager. I collect mail over ssh tunnel and use this program. It is MUCH simpler, and gives a small status light to indicate tunnel connection. I also allows managment of several tunnels.



[ Reply to This | # ]