├── README.md ├── iterm2_helpers.fish ├── iterm2_helpers.sh ├── iterm_create_default_tabs.scpt ├── iterm_set_rails_tabs.scpt └── screenshot.png /README.md: -------------------------------------------------------------------------------- 1 | A set of functions to enable setting the title and tab color of iTerm2 tabs. 2 | 3 | Here's a screenshot of my daily terminal window. I have Rails server and 4 | console running in the first 2 tabs, respectively; the PostgreSQL client 5 | running against my Dev database in the next; the fourth tab is dedicated 6 | to tests; the fifth tab is dedicated to Rake commands; the last tab is 7 | for miscellaneous stuff: 8 | 9 | ![screenshot](https://github.com/jacaetevha/finna-be-octo-hipster/raw/master/screenshot.png) 10 | 11 | In addition, there are 2 AppleScripts here that will 12 | 13 | 1. set up a series of iTerm tabs (7 in total), and change to your Rails directory 14 | 2. set the colors and titles of the iTerm tabs to my defaults 15 | 16 | If you copy these AppleScripts to your ~/Library/Scripts directory they 17 | will be available to you in the Scripts menu. If the Scripts menu is not 18 | in your menu bar yet, you can enable it by opening 19 | "/Applications/Utilities/AppleScript Editor.app", go to preferences, and 20 | select "Show Script menu in menu bar". 21 | -------------------------------------------------------------------------------- /iterm2_helpers.fish: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # Copy this script to your ~/.config/fish/functions directory 3 | # 4 | # Setting titles: 5 | # title something 6 | # title "more than 1 word" 7 | # 8 | # Setting tab colors: 9 | # tab_color 195 89 76 10 | # tab_color 219 154 88 11 | # tab_color 145 185 104 12 | # tab_color 92 155 204 13 | # 14 | # Setting pre-defined tab colors with titles: 15 | # tab_red "Rails Server" 16 | # tab_orange "Rails Console" 17 | # tab_blue "SQL Dev" 18 | # tab_green "Tests" 19 | 20 | function fish_title #--description 'set the title of your iTerm tab to the given String argument' 21 | echo -ne "\033]0;$1\007" 22 | end 23 | 24 | function titlepwd --description 'set the title of your iTerm tab to the current directory name' 25 | fish_title `pwd` 26 | end 27 | 28 | function tab_maroon 29 | title "$1"; tab_color 128 0 0; 30 | end 31 | function tab_dark_red 32 | title "$1"; tab_color 139 0 0; 33 | end 34 | function tab_brown 35 | title "$1"; tab_color 165 42 42; 36 | end 37 | function tab_firebrick 38 | title "$1"; tab_color 178 34 34; 39 | end 40 | function tab_crimson 41 | title "$1"; tab_color 220 20 60; 42 | end 43 | function tab_tomato 44 | title "$1"; tab_color 255 99 71; 45 | end 46 | function tab_coral 47 | title "$1"; tab_color 255 127 80; 48 | end 49 | function tab_indian_red 50 | title "$1"; tab_color 205 92 92; 51 | end 52 | function tab_light_coral 53 | title "$1"; tab_color 240 128 128; 54 | end 55 | function tab_dark_salmon 56 | title "$1"; tab_color 233 150 122; 57 | end 58 | function tab_salmon 59 | title "$1"; tab_color 250 128 114; 60 | end 61 | function tab_light_salmon 62 | title "$1"; tab_color 255 160 122; 63 | end 64 | function tab_orange_red 65 | title "$1"; tab_color 255 69 0; 66 | end 67 | function tab_dark_orange 68 | title "$1"; tab_color 255 140 0; 69 | end 70 | function tab_gold 71 | title "$1"; tab_color 255 215 0; 72 | end 73 | function tab_dark_golden_rod 74 | title "$1"; tab_color 184 134 11; 75 | end 76 | function tab_golden_rod 77 | title "$1"; tab_color 218 165 32; 78 | end 79 | function tab_pale_golden_rod 80 | title "$1"; tab_color 238 232 170; 81 | end 82 | function tab_dark_khaki 83 | title "$1"; tab_color 189 183 107; 84 | end 85 | function tab_khaki 86 | title "$1"; tab_color 240 230 140; 87 | end 88 | function tab_olive 89 | title "$1"; tab_color 128 128 0; 90 | end 91 | function tab_yellow_green 92 | title "$1"; tab_color 154 205 50; 93 | end 94 | function tab_dark_olive_green 95 | title "$1"; tab_color 85 107 47; 96 | end 97 | function tab_olive_drab 98 | title "$1"; tab_color 107 142 35; 99 | end 100 | function tab_lawn_green 101 | title "$1"; tab_color 124 252 0; 102 | end 103 | function tab_chart_reuse 104 | title "$1"; tab_color 127 255 0; 105 | end 106 | function tab_green_yellow 107 | title "$1"; tab_color 173 255 47; 108 | end 109 | function tab_dark_green 110 | title "$1"; tab_color 0 100 0; 111 | end 112 | function tab_forest_green 113 | title "$1"; tab_color 34 139 34; 114 | end 115 | function tab_lime 116 | title "$1"; tab_color 0 255 0; 117 | end 118 | function tab_lime_green 119 | title "$1"; tab_color 50 205 50; 120 | end 121 | function tab_light_green 122 | title "$1"; tab_color 144 238 144; 123 | end 124 | function tab_pale_green 125 | title "$1"; tab_color 152 251 152; 126 | end 127 | function tab_dark_sea_green 128 | title "$1"; tab_color 143 188 143; 129 | end 130 | function tab_medium_spring_green 131 | title "$1"; tab_color 0 250 154; 132 | end 133 | function tab_spring_green 134 | title "$1"; tab_color 0 255 127; 135 | end 136 | function tab_sea_green 137 | title "$1"; tab_color 46 139 87; 138 | end 139 | function tab_medium_aqua_marine 140 | title "$1"; tab_color 102 205 170; 141 | end 142 | function tab_medium_sea_green 143 | title "$1"; tab_color 60 179 113; 144 | end 145 | function tab_light_sea_green 146 | title "$1"; tab_color 32 178 170; 147 | end 148 | function tab_dark_slate_gray 149 | title "$1"; tab_color 47 79 79; 150 | end 151 | function tab_teal 152 | title "$1"; tab_color 0 128 128; 153 | end 154 | function tab_dark_cyan 155 | title "$1"; tab_color 0 139 139; 156 | end 157 | function tab_aqua 158 | title "$1"; tab_color 0 255 255; 159 | end 160 | function tab_cyan 161 | title "$1"; tab_color 0 255 255; 162 | end 163 | function tab_light_cyan 164 | title "$1"; tab_color 224 255 255; 165 | end 166 | function tab_dark_turquoise 167 | title "$1"; tab_color 0 206 209; 168 | end 169 | function tab_turquoise 170 | title "$1"; tab_color 64 224 208; 171 | end 172 | function tab_medium_turquoise 173 | title "$1"; tab_color 72 209 204; 174 | end 175 | function tab_pale_turquoise 176 | title "$1"; tab_color 175 238 238; 177 | end 178 | function tab_aqua_marine 179 | title "$1"; tab_color 127 255 212; 180 | end 181 | function tab_powder_blue 182 | title "$1"; tab_color 176 224 230; 183 | end 184 | function tab_cadet_blue 185 | title "$1"; tab_color 95 158 160; 186 | end 187 | function tab_steel_blue 188 | title "$1"; tab_color 70 130 180; 189 | end 190 | function tab_corn_flower_blue 191 | title "$1"; tab_color 100 149 237; 192 | end 193 | function tab_deep_sky_blue 194 | title "$1"; tab_color 0 191 255; 195 | end 196 | function tab_dodger_blue 197 | title "$1"; tab_color 30 144 255; 198 | end 199 | function tab_light_blue 200 | title "$1"; tab_color 173 216 230; 201 | end 202 | function tab_sky_blue 203 | title "$1"; tab_color 135 206 235; 204 | end 205 | function tab_light_sky_blue 206 | title "$1"; tab_color 135 206 250; 207 | end 208 | function tab_midnight_blue 209 | title "$1"; tab_color 25 25_ 112; 210 | end 211 | function tab_navy 212 | title "$1"; tab_color 0 0 128; 213 | end 214 | function tab_dark_blue 215 | title "$1"; tab_color 0 0 139; 216 | end 217 | function tab_medium_blue 218 | title "$1"; tab_color 0 0 205; 219 | end 220 | function tab_royal_blue 221 | title "$1"; tab_color 65 105 225; 222 | end 223 | function tab_blue_violet 224 | title "$1"; tab_color 138 43 226; 225 | end 226 | function tab_indigo 227 | title "$1"; tab_color 75 0 130; 228 | end 229 | function tab_dark_slate_blue 230 | title "$1"; tab_color 72 61 139; 231 | end 232 | function tab_slate_blue 233 | title "$1"; tab_color 106 90 205; 234 | end 235 | function tab_medium_slate_blue 236 | title "$1"; tab_color 123 104 238; 237 | end 238 | function tab_medium_purple 239 | title "$1"; tab_color 147 112 219; 240 | end 241 | function tab_dark_magenta 242 | title "$1"; tab_color 139 0 139; 243 | end 244 | function tab_dark_violet 245 | title "$1"; tab_color 148 0 211; 246 | end 247 | function tab_dark_orchid 248 | title "$1"; tab_color 153 50 204; 249 | end 250 | function tab_medium_orchid 251 | title "$1"; tab_color 186 85_ 211; 252 | end 253 | function tab_purple 254 | title "$1"; tab_color 128 0 128; 255 | end 256 | function tab_thistle 257 | title "$1"; tab_color 216 191 216; 258 | end 259 | function tab_plum 260 | title "$1"; tab_color 221 160 221; 261 | end 262 | function tab_violet 263 | title "$1"; tab_color 238 130 238; 264 | end 265 | function tab_magenta_fuchsia 266 | title "$1"; tab_color 255 0 255; 267 | end 268 | function tab_orchid 269 | title "$1"; tab_color 218 112 214; 270 | end 271 | function tab_medium_violet_red 272 | title "$1"; tab_color 199 21 133; 273 | end 274 | function tab_pale_violet_red 275 | title "$1"; tab_color 219 112 147; 276 | end 277 | function tab_deep_pink 278 | title "$1"; tab_color 255 20 147; 279 | end 280 | function tab_hot_pink 281 | title "$1"; tab_color 255 105 180; 282 | end 283 | function tab_light_pink 284 | title "$1"; tab_color 255 182 193; 285 | end 286 | function tab_pink 287 | title "$1"; tab_color 255 192 203; 288 | end 289 | function tab_antique_white 290 | title "$1"; tab_color 250 235 215; 291 | end 292 | function tab_beige 293 | title "$1"; tab_color 245 245 220; 294 | end 295 | function tab_bisque 296 | title "$1"; tab_color 255 228 196; 297 | end 298 | function tab_blanched_almond 299 | title "$1"; tab_color 255 235 205; 300 | end 301 | function tab_wheat 302 | title "$1"; tab_color 245 222 179; 303 | end 304 | function tab_corn_silk 305 | title "$1"; tab_color 255 248 220; 306 | end 307 | function tab_lemon_chiffon 308 | title "$1"; tab_color 255 250 205; 309 | end 310 | function tab_light_golden_rod_yellow 311 | title "$1"; tab_color 250 250 210; 312 | end 313 | function tab_light_yellow 314 | title "$1"; tab_color 255 255 224; 315 | end 316 | function tab_saddle_brown 317 | title "$1"; tab_color 139 69 19; 318 | end 319 | function tab_sienna 320 | title "$1"; tab_color 160 82 45; 321 | end 322 | function tab_chocolate 323 | title "$1"; tab_color 210 105 30; 324 | end 325 | function tab_peru 326 | title "$1"; tab_color 205 133 63; 327 | end 328 | function tab_sandy_brown 329 | title "$1"; tab_color 244 164 96; 330 | end 331 | function tab_burly_wood 332 | title "$1"; tab_color 222 184 135; 333 | end 334 | function tab_tan 335 | title "$1"; tab_color 210 180 140; 336 | end 337 | function tab_rosy_brown 338 | title "$1"; tab_color 188 143 143; 339 | end 340 | function tab_moccasin 341 | title "$1"; tab_color 255 228 181; 342 | end 343 | function tab_navajo_white 344 | title "$1"; tab_color 255 222 173; 345 | end 346 | function tab_peach_puff 347 | title "$1"; tab_color 255 218 185; 348 | end 349 | function tab_misty_rose 350 | title "$1"; tab_color 255 228 225; 351 | end 352 | function tab_lavender_blush 353 | title "$1"; tab_color 255 240 245; 354 | end 355 | function tab_linen 356 | title "$1"; tab_color 250 240 230; 357 | end 358 | function tab_old_lace 359 | title "$1"; tab_color 253 245 230; 360 | end 361 | function tab_papaya_whip 362 | title "$1"; tab_color 255 239 213; 363 | end 364 | function tab_sea_shell 365 | title "$1"; tab_color 255 245 238; 366 | end 367 | function tab_mint_cream 368 | title "$1"; tab_color 245 255 250; 369 | end 370 | function tab_slate_gray 371 | title "$1"; tab_color 112 128 144; 372 | end 373 | function tab_light_slate_gray 374 | title "$1"; tab_color 119 136 153; 375 | end 376 | function tab_light_steel_blue 377 | title "$1"; tab_color 176 196 222; 378 | end 379 | function tab_lavender 380 | title "$1"; tab_color 230 230 250; 381 | end 382 | function tab_floral_white 383 | title "$1"; tab_color 255 250 240; 384 | end 385 | function tab_alice_blue 386 | title "$1"; tab_color 240 248 255; 387 | end 388 | function tab_ghost_white 389 | title "$1"; tab_color 248 248 255; 390 | end 391 | function tab_honeydew 392 | title "$1"; tab_color 240 255 240; 393 | end 394 | function tab_ivory 395 | title "$1"; tab_color 255 255 240; 396 | end 397 | function tab_azure 398 | title "$1"; tab_color 240 255 255; 399 | end 400 | function tab_snow 401 | title "$1"; tab_color 255 250 250; 402 | end 403 | function tab_black 404 | title "$1"; tab_color 0 0 0; 405 | end 406 | function tab_dim_gray_dim_grey 407 | title "$1"; tab_color 105 105 105; 408 | end 409 | function tab_gray_grey 410 | title "$1"; tab_color 128 128 128; 411 | end 412 | function tab_dark_gray_dark_grey 413 | title "$1"; tab_color 169 169 169; 414 | end 415 | function tab_silver 416 | title "$1"; tab_color 192 192 192; 417 | end 418 | function tab_light_gray_light_grey 419 | title "$1"; tab_color 211 211 211 ; 420 | end 421 | function tab_gainsboro 422 | title "$1"; tab_color 220 220 220; 423 | end 424 | function tab_white_smoke 425 | title "$1"; tab_color 245 245 245; 426 | end 427 | function tab_white 428 | title "$1"; tab_color 255 255 255; 429 | end 430 | 431 | # Pure colors to be overridden later 432 | function tab_pure_red 433 | title "$1"; tab_color 255 0 0; 434 | end 435 | function tab_pure_orange 436 | title "$1"; tab_color 255 165 0; 437 | end 438 | function tab_pure_green 439 | title "$1"; tab_color 0 128 0; 440 | end 441 | function tab_pure_blue 442 | title "$1"; tab_color 0 0 255; 443 | end 444 | function tab_pure_yellow 445 | title "$1"; tab_color 255 255 0; 446 | end 447 | 448 | # Overridden colors 449 | function tab_red 450 | title "$1"; tab_color 195 89 76; 451 | end 452 | function tab_orange 453 | title "$1"; tab_color 219 154 88; 454 | end 455 | function tab_green 456 | title "$1"; tab_color 65 174 76; 457 | end 458 | function tab_blue 459 | title "$1"; tab_color 92 155 204; 460 | end 461 | function tab_yellow 462 | title "$1"; tab_color 240 240 0; 463 | end 464 | 465 | function tab_color --description 'change the color of your iTerm tab to the given RGB values (space separated)' 466 | echo -n -e "\033]6;1;bg;red;brightness;$1\a" 467 | echo -n -e "\033]6;1;bg;green;brightness;$2\a" 468 | echo -n -e "\033]6;1;bg;blue;brightness;$3\a" 469 | end 470 | -------------------------------------------------------------------------------- /iterm2_helpers.sh: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # Source this script from your Bash start-up script (eg. ~/.bashrc, ~/.bash_profile). 3 | # 4 | # Setting titles: 5 | # title something 6 | # title "more than 1 word" 7 | # 8 | # Setting tab colors: 9 | # tab_color 195 89 76 10 | # tab_color 219 154 88 11 | # tab_color 145 185 104 12 | # tab_color 92 155 204 13 | # 14 | # Setting pre-defined tab colors with titles: 15 | # tab_red "Rails Server" 16 | # tab_orange "Rails Console" 17 | # tab_blue "SQL Dev" 18 | # tab_green "Tests" 19 | 20 | title_help0() 21 | { 22 | echo "ERROR: No argument provided." 23 | echo "Usage:" 24 | echo " `basename -- $0` \"title\" to provide a new Terminal title." 25 | } 26 | 27 | title_help2() 28 | { 29 | echo "ERROR: Too many arguments provided." 30 | echo "Usage:" 31 | echo " `basename -- $0` \"title\" to provide a new Terminal title." 32 | } 33 | 34 | function set_iterm_title() { 35 | if [ $# -eq 0 ] 36 | then 37 | title_help0; 38 | elif [ $# -eq 1 ] 39 | then 40 | echo -ne "\033]0;$1\007" 41 | elif [ $# -gt 1 ] 42 | then 43 | title_help2; 44 | fi 45 | } 46 | alias title='set_iterm_title' 47 | 48 | function titlepwd() { 49 | set_iterm_title `pwd` 50 | } 51 | 52 | function tab_maroon { title "$1"; tab_color 128 0 0; } 53 | function tab_dark_red { title "$1"; tab_color 139 0 0; } 54 | function tab_brown { title "$1"; tab_color 165 42 42; } 55 | function tab_firebrick { title "$1"; tab_color 178 34 34; } 56 | function tab_crimson { title "$1"; tab_color 220 20 60; } 57 | function tab_tomato { title "$1"; tab_color 255 99 71; } 58 | function tab_coral { title "$1"; tab_color 255 127 80; } 59 | function tab_indian_red { title "$1"; tab_color 205 92 92; } 60 | function tab_light_coral { title "$1"; tab_color 240 128 128; } 61 | function tab_dark_salmon { title "$1"; tab_color 233 150 122; } 62 | function tab_salmon { title "$1"; tab_color 250 128 114; } 63 | function tab_light_salmon { title "$1"; tab_color 255 160 122; } 64 | function tab_orange_red { title "$1"; tab_color 255 69 0; } 65 | function tab_dark_orange { title "$1"; tab_color 255 140 0; } 66 | function tab_gold { title "$1"; tab_color 255 215 0; } 67 | function tab_dark_golden_rod { title "$1"; tab_color 184 134 11; } 68 | function tab_golden_rod { title "$1"; tab_color 218 165 32; } 69 | function tab_pale_golden_rod { title "$1"; tab_color 238 232 170; } 70 | function tab_dark_khaki { title "$1"; tab_color 189 183 107; } 71 | function tab_khaki { title "$1"; tab_color 240 230 140; } 72 | function tab_olive { title "$1"; tab_color 128 128 0; } 73 | function tab_yellow_green { title "$1"; tab_color 154 205 50; } 74 | function tab_dark_olive_green { title "$1"; tab_color 85 107 47; } 75 | function tab_olive_drab { title "$1"; tab_color 107 142 35; } 76 | function tab_lawn_green { title "$1"; tab_color 124 252 0; } 77 | function tab_chart_reuse { title "$1"; tab_color 127 255 0; } 78 | function tab_green_yellow { title "$1"; tab_color 173 255 47; } 79 | function tab_dark_green { title "$1"; tab_color 0 100 0; } 80 | function tab_forest_green { title "$1"; tab_color 34 139 34; } 81 | function tab_lime { title "$1"; tab_color 0 255 0; } 82 | function tab_lime_green { title "$1"; tab_color 50 205 50; } 83 | function tab_light_green { title "$1"; tab_color 144 238 144; } 84 | function tab_pale_green { title "$1"; tab_color 152 251 152; } 85 | function tab_dark_sea_green { title "$1"; tab_color 143 188 143; } 86 | function tab_medium_spring_green { title "$1"; tab_color 0 250 154; } 87 | function tab_spring_green { title "$1"; tab_color 0 255 127; } 88 | function tab_sea_green { title "$1"; tab_color 46 139 87; } 89 | function tab_medium_aqua_marine { title "$1"; tab_color 102 205 170; } 90 | function tab_medium_sea_green { title "$1"; tab_color 60 179 113; } 91 | function tab_light_sea_green { title "$1"; tab_color 32 178 170; } 92 | function tab_dark_slate_gray { title "$1"; tab_color 47 79 79; } 93 | function tab_teal { title "$1"; tab_color 0 128 128; } 94 | function tab_dark_cyan { title "$1"; tab_color 0 139 139; } 95 | function tab_aqua { title "$1"; tab_color 0 255 255; } 96 | function tab_cyan { title "$1"; tab_color 0 255 255; } 97 | function tab_light_cyan { title "$1"; tab_color 224 255 255; } 98 | function tab_dark_turquoise { title "$1"; tab_color 0 206 209; } 99 | function tab_turquoise { title "$1"; tab_color 64 224 208; } 100 | function tab_medium_turquoise { title "$1"; tab_color 72 209 204; } 101 | function tab_pale_turquoise { title "$1"; tab_color 175 238 238; } 102 | function tab_aqua_marine { title "$1"; tab_color 127 255 212; } 103 | function tab_powder_blue { title "$1"; tab_color 176 224 230; } 104 | function tab_cadet_blue { title "$1"; tab_color 95 158 160; } 105 | function tab_steel_blue { title "$1"; tab_color 70 130 180; } 106 | function tab_corn_flower_blue { title "$1"; tab_color 100 149 237; } 107 | function tab_deep_sky_blue { title "$1"; tab_color 0 191 255; } 108 | function tab_dodger_blue { title "$1"; tab_color 30 144 255; } 109 | function tab_light_blue { title "$1"; tab_color 173 216 230; } 110 | function tab_sky_blue { title "$1"; tab_color 135 206 235; } 111 | function tab_light_sky_blue { title "$1"; tab_color 135 206 250; } 112 | function tab_midnight_blue { title "$1"; tab_color 25 25_ 112; } 113 | function tab_navy { title "$1"; tab_color 0 0 128; } 114 | function tab_dark_blue { title "$1"; tab_color 0 0 139; } 115 | function tab_medium_blue { title "$1"; tab_color 0 0 205; } 116 | function tab_royal_blue { title "$1"; tab_color 65 105 225; } 117 | function tab_blue_violet { title "$1"; tab_color 138 43 226; } 118 | function tab_indigo { title "$1"; tab_color 75 0 130; } 119 | function tab_dark_slate_blue { title "$1"; tab_color 72 61 139; } 120 | function tab_slate_blue { title "$1"; tab_color 106 90 205; } 121 | function tab_medium_slate_blue { title "$1"; tab_color 123 104 238; } 122 | function tab_medium_purple { title "$1"; tab_color 147 112 219; } 123 | function tab_dark_magenta { title "$1"; tab_color 139 0 139; } 124 | function tab_dark_violet { title "$1"; tab_color 148 0 211; } 125 | function tab_dark_orchid { title "$1"; tab_color 153 50 204; } 126 | function tab_medium_orchid { title "$1"; tab_color 186 85_ 211; } 127 | function tab_purple { title "$1"; tab_color 128 0 128; } 128 | function tab_thistle { title "$1"; tab_color 216 191 216; } 129 | function tab_plum { title "$1"; tab_color 221 160 221; } 130 | function tab_violet { title "$1"; tab_color 238 130 238; } 131 | function tab_magenta_fuchsia { title "$1"; tab_color 255 0 255; } 132 | function tab_orchid { title "$1"; tab_color 218 112 214; } 133 | function tab_medium_violet_red { title "$1"; tab_color 199 21 133; } 134 | function tab_pale_violet_red { title "$1"; tab_color 219 112 147; } 135 | function tab_deep_pink { title "$1"; tab_color 255 20 147; } 136 | function tab_hot_pink { title "$1"; tab_color 255 105 180; } 137 | function tab_light_pink { title "$1"; tab_color 255 182 193; } 138 | function tab_pink { title "$1"; tab_color 255 192 203; } 139 | function tab_antique_white { title "$1"; tab_color 250 235 215; } 140 | function tab_beige { title "$1"; tab_color 245 245 220; } 141 | function tab_bisque { title "$1"; tab_color 255 228 196; } 142 | function tab_blanched_almond { title "$1"; tab_color 255 235 205; } 143 | function tab_wheat { title "$1"; tab_color 245 222 179; } 144 | function tab_corn_silk { title "$1"; tab_color 255 248 220; } 145 | function tab_lemon_chiffon { title "$1"; tab_color 255 250 205; } 146 | function tab_light_golden_rod_yellow { title "$1"; tab_color 250 250 210; } 147 | function tab_light_yellow { title "$1"; tab_color 255 255 224; } 148 | function tab_saddle_brown { title "$1"; tab_color 139 69 19; } 149 | function tab_sienna { title "$1"; tab_color 160 82 45; } 150 | function tab_chocolate { title "$1"; tab_color 210 105 30; } 151 | function tab_peru { title "$1"; tab_color 205 133 63; } 152 | function tab_sandy_brown { title "$1"; tab_color 244 164 96; } 153 | function tab_burly_wood { title "$1"; tab_color 222 184 135; } 154 | function tab_tan { title "$1"; tab_color 210 180 140; } 155 | function tab_rosy_brown { title "$1"; tab_color 188 143 143; } 156 | function tab_moccasin { title "$1"; tab_color 255 228 181; } 157 | function tab_navajo_white { title "$1"; tab_color 255 222 173; } 158 | function tab_peach_puff { title "$1"; tab_color 255 218 185; } 159 | function tab_misty_rose { title "$1"; tab_color 255 228 225; } 160 | function tab_lavender_blush { title "$1"; tab_color 255 240 245; } 161 | function tab_linen { title "$1"; tab_color 250 240 230; } 162 | function tab_old_lace { title "$1"; tab_color 253 245 230; } 163 | function tab_papaya_whip { title "$1"; tab_color 255 239 213; } 164 | function tab_sea_shell { title "$1"; tab_color 255 245 238; } 165 | function tab_mint_cream { title "$1"; tab_color 245 255 250; } 166 | function tab_slate_gray { title "$1"; tab_color 112 128 144; } 167 | function tab_light_slate_gray { title "$1"; tab_color 119 136 153; } 168 | function tab_light_steel_blue { title "$1"; tab_color 176 196 222; } 169 | function tab_lavender { title "$1"; tab_color 230 230 250; } 170 | function tab_floral_white { title "$1"; tab_color 255 250 240; } 171 | function tab_alice_blue { title "$1"; tab_color 240 248 255; } 172 | function tab_ghost_white { title "$1"; tab_color 248 248 255; } 173 | function tab_honeydew { title "$1"; tab_color 240 255 240; } 174 | function tab_ivory { title "$1"; tab_color 255 255 240; } 175 | function tab_azure { title "$1"; tab_color 240 255 255; } 176 | function tab_snow { title "$1"; tab_color 255 250 250; } 177 | function tab_black { title "$1"; tab_color 0 0 0; } 178 | function tab_dim_gray_dim_grey { title "$1"; tab_color 105 105 105; } 179 | function tab_gray_grey { title "$1"; tab_color 128 128 128; } 180 | function tab_dark_gray_dark_grey { title "$1"; tab_color 169 169 169; } 181 | function tab_silver { title "$1"; tab_color 192 192 192; } 182 | function tab_light_gray_light_grey { title "$1"; tab_color 211 211 211 ; } 183 | function tab_gainsboro { title "$1"; tab_color 220 220 220; } 184 | function tab_white_smoke { title "$1"; tab_color 245 245 245; } 185 | function tab_white { title "$1"; tab_color 255 255 255; } 186 | 187 | # Pure colors to be overridden later 188 | function tab_pure_red { title "$1"; tab_color 255 0 0; } 189 | function tab_pure_orange { title "$1"; tab_color 255 165 0; } 190 | function tab_pure_green { title "$1"; tab_color 0 128 0; } 191 | function tab_pure_blue { title "$1"; tab_color 0 0 255; } 192 | function tab_pure_yellow { title "$1"; tab_color 255 255 0; } 193 | 194 | # Overridden colors 195 | function tab_red() { title "$1"; tab_color 195 89 76; } 196 | function tab_orange() { title "$1"; tab_color 219 154 88; } 197 | function tab_green() { title "$1"; tab_color 65 174 76; } 198 | function tab_blue() { title "$1"; tab_color 92 155 204; } 199 | function tab_yellow() { title "$1"; tab_color 240 240 0; } 200 | 201 | function tab_color() { 202 | echo -n -e "\033]6;1;bg;red;brightness;$1\a" 203 | echo -n -e "\033]6;1;bg;green;brightness;$2\a" 204 | echo -n -e "\033]6;1;bg;blue;brightness;$3\a" 205 | } 206 | 207 | function tab_reset() { 208 | echo -n -e "\033]6;1;bg;*;default\a" 209 | } 210 | 211 | -------------------------------------------------------------------------------- /iterm_create_default_tabs.scpt: -------------------------------------------------------------------------------- 1 | tell application "System Events" 2 | tell application "iTerm" 3 | activate 4 | end tell 5 | tell process "iTerm" 6 | click button 2 of window 1 7 | end tell 8 | end tell 9 | 10 | tell application "iTerm" 11 | 12 | tell the current terminal 13 | #set d to choose folder with prompt "Select your Rails directory" 14 | set theRailsDir to POSIX path of "/Users/jrogers/Documents/Programming/samasource/sh3" 15 | 16 | repeat while (count sessions) < 7 17 | activate current session 18 | launch session "Default Session" 19 | tell the last session 20 | write text "cd " & (theRailsDir as string) 21 | tell i term application "System Events" to keystroke "l" using control down 22 | end tell 23 | end repeat 24 | 25 | if (count sessions) > 7 then 26 | terminate the first session 27 | end if 28 | 29 | tell the last session 30 | write text "osascript ~/Library/Scripts/iterm_set_rails_tabs.scpt" 31 | end tell 32 | 33 | repeat with theSession in sessions 34 | select theSession 35 | tell i term application "System Events" to keystroke "l" using control down 36 | end repeat 37 | 38 | select the first session 39 | 40 | tell the first session 41 | tell i term application "System Events" to keystroke "l" using control down 42 | write text "cd " & (theRailsDir as string) 43 | write text "git pull" 44 | end tell 45 | 46 | end tell 47 | end tell 48 | 49 | -------------------------------------------------------------------------------- /iterm_set_rails_tabs.scpt: -------------------------------------------------------------------------------- 1 | tell application "iTerm" 2 | tell the current terminal 3 | tell the first session 4 | #select current session 5 | write text "tab_red '1 Server'" 6 | end tell 7 | 8 | tell the second session 9 | #select current session 10 | write text "tab_orange '2 Console'" 11 | end tell 12 | 13 | tell the third session 14 | #select current session 15 | write text "tab_blue '3 SQL'" 16 | end tell 17 | 18 | tell the fourth session 19 | #select current session 20 | write text "tab_blue '4 mongod'" 21 | write text "sudo mongod" 22 | write text "" 23 | end tell 24 | 25 | tell the fifth session 26 | #select current session 27 | write text "tab_blue '5 mongo'" 28 | end tell 29 | 30 | tell the sixth session 31 | #select current session 32 | write text "tab_green '6 Tests'" 33 | end tell 34 | 35 | tell the seventh session 36 | #select current session 37 | write text "tab_yellow '7 Rake'" 38 | end tell 39 | 40 | select the first session 41 | end tell 42 | end tell 43 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacaetevha/finna-be-octo-hipster/bcc2d163a1d3eaf266a0576e020c2a9199ebc1c7/screenshot.png --------------------------------------------------------------------------------