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


Click here to return to the 'Toggle terminal transparency via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Toggle terminal transparency via AppleScript
Authored by: Silence on Aug 16, '04 02:23:06AM
I use iterm and use the following

tell application "iTerm"
	activate
	set current_terminal to (current terminal)
	tell current_terminal
		set current_session to (current session)
		tell current_session
			set old_transparency to transparency
			if old_transparency < "0.1"
				set transparency to "0.9"
			else
				set transparency to "0.05"
			end if
		end tell
	end tell
end tell
of for interactive setting

tell application "iTerm"
	activate
	set current_terminal to (current terminal)
	tell current_terminal
		set current_session to (current session)
		tell current_session
			set old_transparency to transparency
			display dialog "Set Transparency" default answer old_transparency  buttons {"Cancel", "OK"} default button 2
			set new_transparency to the text returned of the result
			set transparency to new_transparency
		end tell
	end tell
end tell


[ Reply to This | # ]
Toggle terminal colors for different servers
Authored by: davidswelt on Nov 19, '04 06:58:45AM

I use this to set the background color of terminal windows depending on the server that i'm logged on to in that window.

The previously posted code does this in AppleScript, but you'd need to have a way to trigger this depending on the server that's i'm SSH'ed into. I don't know how to do this, however, doing it via the shell automatically works just fine. Of course, we need to reset the color once the SSH session has ended, and for that, we need to remember the window ID that we're running in. Here's my SSH script that logs me into a server (via a proxy login server) that I've just written (you may need to check the line breaks):

[code]
#/bin/bash

THEW=`osascript -e 'front window of app "Terminal"'`
osascript -e "tell application \"Terminal\" to set background color of $THEW to {65535,38807,13621}"

ssh -t -X myusername@mydepartmentlogonserver.ac.uk 'ssh -X mymachine'

osascript -e "tell application \"Terminal\" to set background color of $THEW to {65535,59881,28013}"
[/code]

Get the colors with DigitalColor Meter as previously posted (thanks for the tip) -- set it to "RGB as Actual Value 16 Bit"

---
http://www.reitter-it-media.de // personal: http://www.davids-welt.de



[ Reply to This | # ]