Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Shuttle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
C149EBF015D5214600B1F558 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = fitztrev;
};
buildConfigurationList = C149EBF315D5214600B1F558 /* Build configuration list for PBXProject "Shuttle" */;
Expand Down Expand Up @@ -303,6 +303,7 @@
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
Expand Down Expand Up @@ -352,6 +353,7 @@
GCC_PREFIX_HEADER = "Shuttle/Shuttle-Prefix.pch";
INFOPLIST_FILE = "Shuttle/Shuttle-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_BUNDLE_IDENTIFIER = "shuttle.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -367,6 +369,7 @@
GCC_PREFIX_HEADER = "Shuttle/Shuttle-Prefix.pch";
INFOPLIST_FILE = "Shuttle/Shuttle-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_BUNDLE_IDENTIFIER = "shuttle.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down
13 changes: 9 additions & 4 deletions Shuttle/AboutWindowController.xib
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="AboutWindowController">
<connections>
<outlet property="appCopyright" destination="rfT-bT-B7g" id="9uI-a1-vwK"/>
<outlet property="appHomepage" destination="se5-gp-TjO" id="xBq-5t-bl5"/>
<outlet property="appName" destination="APf-vF-1w0" id="N4r-kg-BHK"/>
<outlet property="appVersion" destination="LTk-GB-fgJ" id="41k-wk-DtW"/>
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
Expand All @@ -20,7 +19,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="750" y="574" width="460" height="172"/>
<rect key="screenRect" x="0.0" y="0.0" width="1366" height="745"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<value key="minSize" type="size" width="460" height="172"/>
<value key="maxSize" type="size" width="460" height="172"/>
<view key="contentView" id="se5-gp-TjO">
Expand All @@ -29,10 +28,12 @@
<subviews>
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6kW-hd-spe">
<rect key="frame" x="0.0" y="16" width="154" height="148"/>
<animations/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="proportionallyDown" image="shuttle" id="VBv-EA-L5r"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="APf-vF-1w0">
<rect key="frame" x="165" y="135" width="275" height="17"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Program Name and Tag Line" id="tb3-eK-HAT">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -41,6 +42,7 @@
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LTk-GB-fgJ">
<rect key="frame" x="165" y="110" width="277" height="17"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Version" id="6fl-Xm-UPS">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -49,6 +51,7 @@
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rfT-bT-B7g">
<rect key="frame" x="165" y="82" width="277" height="17"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Copyright" id="Cmu-CQ-3V9">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -57,6 +60,7 @@
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="soF-wq-5hG">
<rect key="frame" x="161" y="46" width="108" height="32"/>
<animations/>
<buttonCell key="cell" type="push" title="Homepage" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="uUM-88-32s">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -66,6 +70,7 @@
</connections>
</button>
</subviews>
<animations/>
</view>
<connections>
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
Expand Down
46 changes: 24 additions & 22 deletions Shuttle/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,32 @@ - (void) awakeFromNib {
[[NSFileManager defaultManager] copyItemAtPath:cgFileInResource toPath:shuttleConfigFile error:nil];
}
}

// Load the menu content
// [self loadMenu];


// Define Icons
//only regular icon is needed for 10.10 and higher. OS X changes the icon for us.
regularIcon = [NSImage imageNamed:@"StatusIcon"];
altIcon = [NSImage imageNamed:@"StatusIconAlt"];

// Create the status bar item
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
[statusItem setMenu:menu];
[statusItem setImage: regularIcon];

// Check for AppKit Version, add support for darkmode if > 10.9
BOOL oldAppKitVersion = (floor(NSAppKitVersionNumber) <= 1265);

// 10.10 or higher, dont load the alt image let OS X style it.
if (!oldAppKitVersion)
{
// 10.10 or higher, add support to icon for auto detection of Regular/Dark mode
[regularIcon setTemplate:YES];
[altIcon setTemplate:YES];
regularIcon.template = YES;
}
// Load the alt image for OS X < 10.10
else{
[statusItem setHighlightMode:YES];
[statusItem setAlternateImage: altIcon];
}

// Create the status bar item
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:25.0];

[statusItem setMenu:menu];
[statusItem setHighlightMode:YES];
[statusItem setImage: regularIcon];
[statusItem setAlternateImage: altIcon];

launchAtLoginController = [[LaunchAtLoginController alloc] init];

// Needed to trigger the menuWillOpen event
[menu setDelegate:self];
}
Expand Down Expand Up @@ -357,9 +355,11 @@ - (void) buildMenu:(NSArray*)data addToMenu:(NSMenu *)m {
NSString *termTitle = cfg[@"title"];
//Get the value of setting inTerminal
NSString *termWindow = cfg[@"inTerminal"];
//Get the menu name will will use this as the title if title is null.
NSString *menuName = cfg[@"name"];

//Place the terminal command, theme, and title into an comma delimited string
NSString *menuRepObj = [NSString stringWithFormat:@"%@,%@,%@,%@", menuCmd, termTheme, termTitle, termWindow];
NSString *menuRepObj = [NSString stringWithFormat:@"%@,%@,%@,%@,%@", menuCmd, termTheme, termTitle, termWindow, menuName];

[menuItem setTitle:cfg[@"name"]];
[menuItem setRepresentedObject:menuRepObj];
Expand All @@ -384,6 +384,7 @@ - (void) openHost:(NSMenuItem *) sender {
//Are commands run in a new tab (default) a new terminal window (new), or in the current tab of the last used window (current).
NSString *terminalWindow;


//if for some reason we get a representedObject with only one item...
if (objectsFromJSON.count <=1) {
escapedObject = [[sender representedObject] stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
Expand All @@ -402,7 +403,7 @@ - (void) openHost:(NSMenuItem *) sender {
}
//Check if terminalTitle is null
if( [[objectsFromJSON objectAtIndex:2] isEqualToString:@"(null)"]){
terminalTitle = @"";
terminalTitle = [objectsFromJSON objectAtIndex:4];
}else{
terminalTitle = [objectsFromJSON objectAtIndex:2];
}
Expand All @@ -422,7 +423,7 @@ - (void) openHost:(NSMenuItem *) sender {
//Set Paths to iTerm Nightly AppleScripts
NSString *iTerm2NightlyNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-new-window" ofType:@"scpt"];
NSString *iTerm2NightlyCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-current-window" ofType:@"scpt"];
NSString *iTerm2StableNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-new-tab-default" ofType:@"scpt"];
NSString *iTerm2NightlyNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-new-tab-default" ofType:@"scpt"];

//Set Paths to terminalScripts
NSString *terminalNewWindow = [[NSBundle mainBundle] pathForResource:@"terminal-new-window" ofType:@"scpt"];
Expand Down Expand Up @@ -473,7 +474,7 @@ - (void) openHost:(NSMenuItem *) sender {
[self runScript:iTerm2NightlyCurrentWindow handler:handlerName parameters:passParameters];
}else {
//we are using the default action of shuttle, use the active window in a new Tab
[self runScript:iTerm2StableNewTabDefault handler:handlerName parameters:passParameters];
[self runScript:iTerm2NightlyNewTabDefault handler:handlerName parameters:passParameters];
}
}
}
Expand Down Expand Up @@ -601,11 +602,12 @@ - (IBAction)configure:(id)sender {
}

- (IBAction)showAbout:(id)sender {

//Call the windows controller
//Call the windows controller
AboutWindowController *aboutWindow = [[AboutWindowController alloc] initWithWindowNibName:@"AboutWindowController"];

//Set the window to stay on top
[aboutWindow.window makeKeyAndOrderFront:nil];
[aboutWindow.window setLevel:NSFloatingWindowLevel];

//Show the window
Expand Down
6 changes: 3 additions & 3 deletions Shuttle/Shuttle-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
<key>CFBundleIconFile</key>
<string>shuttle</string>
<key>CFBundleIdentifier</key>
<string>shuttle.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.3</string>
<string>1.2.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.3</string>
<string>1.2.4</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
6 changes: 3 additions & 3 deletions Shuttle/shuttle.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
{
"cmd": "ps aux | grep foo",
"inTerminal": "new",
"name": "My Dev Server",
"theme": "Homebrew",
"title": "Dev Server - SSH"
"name": "look for process foo",
"theme": "Default",
"title": "grep foo"
},
{
"Spouses Servers": [
Expand Down