Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env osascript
- # -*- tab-width: 4 -*- ;; Emacs
- # vi: set ts=4 sw=4 noet ft=applescript :: Vi/ViM
- #-
- ############################################################ IDENT(1)
- #
- # $Title: AppleScript to setup for an R build $
- # $Copyright: 2019-2022 Devin Teske. All rights reserved. $
- # $FrauBSD$
- #
- ############################################################ CONFIGURATION
- property jenkinsDir : "src/pkgcenter-R/depend/jenkins"
- ############################################################ CONFIGURATION
- property columns : 2
- property fontSize : 13
- property gapX : 0
- property gapY : 0
- property marginLeft : -1440
- property marginTop : 23
- ############################################################ GLOBALS
- (* Do not change these *)
- property column : 0
- property row : 0
- property winSize : {}
- property winXinit : marginLeft
- property winYinit : marginTop
- property winX : winXinit
- property winY : winYinit
- ############################################################ FUNCTIONS
- on new(options)
- set title to ""
- set profile to ""
- set ssh to ""
- set dir to ""
- try
- set title to title of options
- end try
- try
- set profile to profile of options
- end try
- try
- set ssh to ssh of options
- end try
- try
- set dir to dir of options
- end try
- set column to column + 1
- if (column > columns) then
- set column to 1
- set row to row + 1
- set winX to winXinit
- end if
- if (column = 1 and row > 0) then
- set winY to winY + (last item of winSize) + gapY + 1
- end if
- tell application "Terminal"
- if (ssh ≠ "") then
- set currentTab to do script ("ssh -A " & ssh)
- else
- set currentTab to do script
- end if
- set theWindow to the first window
- set current settings of theWindow to settings set profile
- set position of theWindow to {winX, winY}
- if (title ≠ "") then
- set custom title of theWindow to title
- end if
- set font size of current settings of theWindow to fontSize
- set winSize to the size of theWindow
- set winX to winX + (first item of winSize) + gapX + 1
- if (dir ≠ "") then
- delay 0.1
- do script ("cd " & dir) in currentTab
- end if
- delay 0.1
- do script ("settitle " & "\"" & title & "\"") in currentTab
- end tell
- end new
- on new6(title)
- new({title:"CentOS 6 " & title, profile:"Pro Olive", ¬
- ssh:"c6buildhost", dir:jenkinsDir})
- end new6
- on new7(title)
- new({title:"CentOS 7 " & title, profile:"Blue Aerogel", ¬
- ssh:"c7buildhost", dir:jenkinsDir})
- end new7
- ############################################################ MAIN
- on run
- set column to 0
- set row to 0
- set winX to winXinit
- set winY to winYinit
- tell application "Terminal" to activate
- new6("R-3.1.1")
- new6("R-3.3.1")
- new7("R-3.1.1")
- new7("R-3.3.1")
- end run
- ################################################################################
- # END
- ################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement