Skip to content

Instantly share code, notes, and snippets.

@khapota
Last active February 19, 2016 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khapota/681d0bfebe988e0f9ca9 to your computer and use it in GitHub Desktop.
Save khapota/681d0bfebe988e0f9ca9 to your computer and use it in GitHub Desktop.
Open some general tabs and do maximum window
-- get screen resolution
-- Finder method does not work with 10.11
set screenWidth to (do shell script "system_profiler SPDisplaysDataType | awk '/Resolution/{print $2}'")
set screenHeight to (do shell script "system_profiler SPDisplaysDataType | awk '/Resolution/{print $4}'")
-- Kill old iTerm2
-- added exit 0 to by pass error code when process did not exist.
do shell script "killall -9 iTerm2; exit 0"
-- get dock size
-- https://discussions.apple.com/thread/3553498?tstart=0
-- need to set manual if you resize the dock
-- cannot get real ratio of dock resize function
tell application "System Events"
tell dock preferences
set DockProp to properties
get autohide of DockProp
get screen edge of DockProp
if autohide is true or screen edge is not bottom then
set DKheight to 44
else
set DKheight to 90
end if
end tell
end tell
tell application "iTerm"
-- application-level commands
-- These commands return a window.
set newWindow to (create window with default profile)
tell current window
set winHeight to screenHeight
set winWidth to screenWidth
set bounds to {DKheight, 0, winWidth + DKheight, winHeight}
--set position of window drawwin to {0, 22}
-- These commands return a tab
set newTab to (create tab with default profile)
set newTab to (create tab with default profile)
tell first tab
tell current session
write text "echo 'run mux'"
end tell
end tell
tell second tab
tell current session
write text "echo 'run irssi'"
end tell
end tell
tell third tab
tell current session
write text "echo 'run keepassc'"
end tell
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment