Last active
February 19, 2016 04:51
-
-
Save khapota/681d0bfebe988e0f9ca9 to your computer and use it in GitHub Desktop.
Open some general tabs and do maximum window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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