Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54af9202ab | ||
|
|
d9d0aa8211 | ||
|
|
5ebfac1d01 | ||
|
|
6e400d191f | ||
|
|
5ad66714fc | ||
|
|
061f29c887 | ||
|
|
dde01f357d | ||
|
|
b445e0517f |
@@ -1,4 +1,4 @@
|
||||
github "SwiftyJSON/SwiftyJSON" "4.2.0"
|
||||
github "acheronfail/MASShortcut" "2.3.6-custom"
|
||||
github "emaloney/CleanroomLogger" "6.0.2"
|
||||
github "sindresorhus/LaunchAtLogin" "v2.4.0"
|
||||
github "sindresorhus/LaunchAtLogin" "v2.5.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'LaunchAtLogin'
|
||||
s.version = '2.4.0'
|
||||
s.version = '2.5.0'
|
||||
s.summary = 'Add "Launch at Login" functionality to your sandboxed macOS app in seconds'
|
||||
s.license = 'MIT'
|
||||
s.homepage = 'https://github.com/sindresorhus/LaunchAtLogin'
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.4.0</string>
|
||||
<string>2.5.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
@@ -9,7 +9,12 @@ mkdir -p "$helper_dir"
|
||||
cp -rf "$origin_helper_path" "$helper_dir/"
|
||||
|
||||
defaults write "$helper_path/Contents/Info" CFBundleIdentifier -string "$PRODUCT_BUNDLE_IDENTIFIER-LaunchAtLoginHelper"
|
||||
codesign --force --entitlements="$CODE_SIGN_ENTITLEMENTS" --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
|
||||
|
||||
if [[ -n $CODE_SIGN_ENTITLEMENTS ]]; then
|
||||
codesign --force --entitlements="$CODE_SIGN_ENTITLEMENTS" --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
|
||||
else
|
||||
codesign --force --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
|
||||
fi
|
||||
|
||||
if [[ $CONFIGURATION == "Release" ]]; then
|
||||
rm -rf "$origin_helper_path"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# LaunchAtLogin
|
||||
|
||||
> Add "Launch at Login" functionality to your sandboxed macOS app in seconds
|
||||
> Add "Launch at Login" functionality to your macOS app in seconds
|
||||
|
||||
It's usually quite a [convoluted and error-prone process](before-after.md) to add this. **No more!**
|
||||
|
||||
It's App Store compatible and used in my [Lungo](https://blog.sindresorhus.com/lungo-b364a6c2745f) and [Battery Indicator](https://sindresorhus.com/battery-indicator) app.
|
||||
This package works with both sandboxed and non-sandboxed apps and it's App Store compatible and used in my [Lungo](https://blog.sindresorhus.com/lungo-b364a6c2745f) and [Battery Indicator](https://sindresorhus.com/battery-indicator) apps.
|
||||
|
||||
You might also find my [`create-dmg`](https://github.com/sindresorhus/create-dmg) project useful.
|
||||
*You might also find my [`create-dmg`](https://github.com/sindresorhus/create-dmg) project useful if you're publishing your app outside the App Store.*
|
||||
|
||||
|
||||
## Requirements
|
||||
@@ -42,13 +42,13 @@ Add a new ["Run Script Phase"](http://stackoverflow.com/a/39633955/64949) below
|
||||
Carthage:
|
||||
|
||||
```sh
|
||||
./Carthage/Build/Mac/LaunchAtLogin.framework/Resources/copy-helper.sh
|
||||
"${PROJECT_DIR}/Carthage/Build/Mac/LaunchAtLogin.framework/Resources/copy-helper.sh"
|
||||
```
|
||||
|
||||
CocoaPods:
|
||||
|
||||
```sh
|
||||
./Pods/LaunchAtLogin/LaunchAtLogin/copy-helper.sh
|
||||
"${PROJECT_DIR}/Pods/LaunchAtLogin/LaunchAtLogin/copy-helper.sh"
|
||||
```
|
||||
|
||||
Use it in your app:
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
BAA17B7A20B14CC100625455 /* MASShortcut.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BAA17B7220B14CC100625455 /* MASShortcut.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
BAA17B7C20B14CEB00625455 /* SwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAA17B7B20B14CEB00625455 /* SwiftyJSON.framework */; };
|
||||
BAA17B7D20B14CEB00625455 /* SwiftyJSON.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BAA17B7B20B14CEB00625455 /* SwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
BAB6F14F221ABB3500EA11D4 /* ShowAndHideCursor.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB6F14E221ABB3500EA11D4 /* ShowAndHideCursor.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -74,11 +75,11 @@
|
||||
159F304D2079A111000BD387 /* AppDelegateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegateTests.swift; sourceTree = "<group>"; };
|
||||
159F30512079A147000BD387 /* PPStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PPStateTests.swift; sourceTree = "<group>"; };
|
||||
15A8D9712083624600D55A9B /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = "<group>"; };
|
||||
15B4E870207994AF0024FDE4 /* PixelPickerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PixelPickerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
15B4E870207994AF0024FDE4 /* Pixel PickerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Pixel PickerTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
15B4E874207994AF0024FDE4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
15FC8CC7204E2E2C000B5E1E /* PPState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PPState.swift; sourceTree = "<group>"; };
|
||||
15FF0CCC204A231800E04103 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "PixelPicker/Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
B3B4C2BD1E25894B009F8E4E /* PixelPicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PixelPicker.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
15FF0CCC204A231800E04103 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "Pixel Picker/Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
B3B4C2BD1E25894B009F8E4E /* Pixel Picker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Pixel Picker.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B3B4C2C01E25894B009F8E4E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
B3B4C2C21E25894B009F8E4E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
B3B4C2C71E25894B009F8E4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
@@ -100,6 +101,7 @@
|
||||
BAA17B7120B14CC000625455 /* CleanroomLogger.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CleanroomLogger.framework; path = Carthage/Build/Mac/CleanroomLogger.framework; sourceTree = "<group>"; };
|
||||
BAA17B7220B14CC100625455 /* MASShortcut.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MASShortcut.framework; path = Carthage/Build/Mac/MASShortcut.framework; sourceTree = "<group>"; };
|
||||
BAA17B7B20B14CEB00625455 /* SwiftyJSON.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyJSON.framework; path = Carthage/Build/Mac/SwiftyJSON.framework; sourceTree = "<group>"; };
|
||||
BAB6F14E221ABB3500EA11D4 /* ShowAndHideCursor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowAndHideCursor.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -137,7 +139,7 @@
|
||||
path = OverlayPanel;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
15B4E871207994AF0024FDE4 /* PixelPickerTests */ = {
|
||||
15B4E871207994AF0024FDE4 /* Pixel PickerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
159F304D2079A111000BD387 /* AppDelegateTests.swift */,
|
||||
@@ -145,7 +147,7 @@
|
||||
15A8D9712083624600D55A9B /* Helpers.swift */,
|
||||
15B4E874207994AF0024FDE4 /* Info.plist */,
|
||||
);
|
||||
path = PixelPickerTests;
|
||||
path = "Pixel PickerTests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B3B4C2B41E25894B009F8E4E = {
|
||||
@@ -156,8 +158,8 @@
|
||||
BAA17B6F20B14CC000625455 /* LaunchAtLogin.framework */,
|
||||
BAA17B7220B14CC100625455 /* MASShortcut.framework */,
|
||||
15FF0CCC204A231800E04103 /* Bridging-Header.h */,
|
||||
B3B4C2BF1E25894B009F8E4E /* PixelPicker */,
|
||||
15B4E871207994AF0024FDE4 /* PixelPickerTests */,
|
||||
B3B4C2BF1E25894B009F8E4E /* Pixel Picker */,
|
||||
15B4E871207994AF0024FDE4 /* Pixel PickerTests */,
|
||||
B3B4C2BE1E25894B009F8E4E /* Products */,
|
||||
BA22232520AFEC1B0001069C /* Frameworks */,
|
||||
);
|
||||
@@ -166,18 +168,19 @@
|
||||
B3B4C2BE1E25894B009F8E4E /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B3B4C2BD1E25894B009F8E4E /* PixelPicker.app */,
|
||||
15B4E870207994AF0024FDE4 /* PixelPickerTests.xctest */,
|
||||
B3B4C2BD1E25894B009F8E4E /* Pixel Picker.app */,
|
||||
15B4E870207994AF0024FDE4 /* Pixel PickerTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B3B4C2BF1E25894B009F8E4E /* PixelPicker */ = {
|
||||
B3B4C2BF1E25894B009F8E4E /* Pixel Picker */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
15493F6620BE6E0F007B2BA5 /* CGImage.swift */,
|
||||
BA74C13420A6F1BE00306B27 /* ShowAndHideCursor.h */,
|
||||
BA74C13220A6F16C00306B27 /* ShowAndHideCursor.m */,
|
||||
BAB6F14E221ABB3500EA11D4 /* ShowAndHideCursor.swift */,
|
||||
BA71817320AE2DCC00619700 /* PPMenuShortcutView.h */,
|
||||
BA71817120AE2DB400619700 /* PPMenuShortcutView.m */,
|
||||
B3B4C2C01E25894B009F8E4E /* AppDelegate.swift */,
|
||||
@@ -193,7 +196,7 @@
|
||||
155D2C02204F61220087478B /* Credits.rtfd */,
|
||||
B3B4C2C71E25894B009F8E4E /* Info.plist */,
|
||||
);
|
||||
path = PixelPicker;
|
||||
path = "Pixel Picker";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BA22232520AFEC1B0001069C /* Frameworks */ = {
|
||||
@@ -207,9 +210,9 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
15B4E86F207994AF0024FDE4 /* PixelPickerTests */ = {
|
||||
15B4E86F207994AF0024FDE4 /* Pixel PickerTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 15B4E877207994AF0024FDE4 /* Build configuration list for PBXNativeTarget "PixelPickerTests" */;
|
||||
buildConfigurationList = 15B4E877207994AF0024FDE4 /* Build configuration list for PBXNativeTarget "Pixel PickerTests" */;
|
||||
buildPhases = (
|
||||
15B4E86C207994AF0024FDE4 /* Sources */,
|
||||
15B4E86D207994AF0024FDE4 /* Frameworks */,
|
||||
@@ -220,14 +223,14 @@
|
||||
dependencies = (
|
||||
15B4E876207994AF0024FDE4 /* PBXTargetDependency */,
|
||||
);
|
||||
name = PixelPickerTests;
|
||||
name = "Pixel PickerTests";
|
||||
productName = PixelPickerTests;
|
||||
productReference = 15B4E870207994AF0024FDE4 /* PixelPickerTests.xctest */;
|
||||
productReference = 15B4E870207994AF0024FDE4 /* Pixel PickerTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
B3B4C2BC1E25894B009F8E4E /* PixelPicker */ = {
|
||||
B3B4C2BC1E25894B009F8E4E /* Pixel Picker */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = B3B4C2CA1E25894B009F8E4E /* Build configuration list for PBXNativeTarget "PixelPicker" */;
|
||||
buildConfigurationList = B3B4C2CA1E25894B009F8E4E /* Build configuration list for PBXNativeTarget "Pixel Picker" */;
|
||||
buildPhases = (
|
||||
B3B4C2B91E25894B009F8E4E /* Sources */,
|
||||
B3B4C2BA1E25894B009F8E4E /* Frameworks */,
|
||||
@@ -239,9 +242,9 @@
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = PixelPicker;
|
||||
name = "Pixel Picker";
|
||||
productName = PixelPicker;
|
||||
productReference = B3B4C2BD1E25894B009F8E4E /* PixelPicker.app */;
|
||||
productReference = B3B4C2BD1E25894B009F8E4E /* Pixel Picker.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -267,7 +270,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = B3B4C2B81E25894B009F8E4E /* Build configuration list for PBXProject "PixelPicker" */;
|
||||
buildConfigurationList = B3B4C2B81E25894B009F8E4E /* Build configuration list for PBXProject "Pixel Picker" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
@@ -280,8 +283,8 @@
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
B3B4C2BC1E25894B009F8E4E /* PixelPicker */,
|
||||
15B4E86F207994AF0024FDE4 /* PixelPickerTests */,
|
||||
B3B4C2BC1E25894B009F8E4E /* Pixel Picker */,
|
||||
15B4E86F207994AF0024FDE4 /* Pixel PickerTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -319,7 +322,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "./Carthage/Build/Mac/LaunchAtLogin.framework/Resources/copy-helper.sh";
|
||||
shellScript = "\"${PROJECT_DIR}/Carthage/Build/Mac/LaunchAtLogin.framework/Resources/copy-helper.sh\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -348,6 +351,7 @@
|
||||
BA74C13120A6E95900306B27 /* PPOverlayPanel.swift in Sources */,
|
||||
BA74C14020AA390400306B27 /* PPOverlayPreview.swift in Sources */,
|
||||
BA74C14420AA609500306B27 /* PPOverlayWrapper.swift in Sources */,
|
||||
BAB6F14F221ABB3500EA11D4 /* ShowAndHideCursor.swift in Sources */,
|
||||
BA74C0F820A692D100306B27 /* PPOverlayController.swift in Sources */,
|
||||
15493F6720BE6E0F007B2BA5 /* CGImage.swift in Sources */,
|
||||
BA74C14220AA409D00306B27 /* NSColor.swift in Sources */,
|
||||
@@ -360,7 +364,7 @@
|
||||
/* Begin PBXTargetDependency section */
|
||||
15B4E876207994AF0024FDE4 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = B3B4C2BC1E25894B009F8E4E /* PixelPicker */;
|
||||
target = B3B4C2BC1E25894B009F8E4E /* Pixel Picker */;
|
||||
targetProxy = 15B4E875207994AF0024FDE4 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
@@ -383,14 +387,15 @@
|
||||
"$(PROJECT_DIR)/Carthage/Build/Mac",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = PixelPickerTests/Info.plist;
|
||||
INFOPLIST_FILE = "Pixel PickerTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.acheronfail.PixelPickerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Pixel Picker/Bridging-Header.h";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PixelPicker.app/Contents/MacOS/PixelPicker";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Pixel Picker.app/Contents/MacOS/Pixel Picker";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -411,14 +416,15 @@
|
||||
"$(PROJECT_DIR)/Carthage/Build/Mac",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = PixelPickerTests/Info.plist;
|
||||
INFOPLIST_FILE = "Pixel PickerTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.acheronfail.PixelPickerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Pixel Picker/Bridging-Header.h";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PixelPicker.app/Contents/MacOS/PixelPicker";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Pixel Picker.app/Contents/MacOS/Pixel Picker";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -552,13 +558,14 @@
|
||||
"$(PROJECT_DIR)/Carthage/Build/Mac",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = c11;
|
||||
INFOPLIST_FILE = PixelPicker/Info.plist;
|
||||
INFOPLIST_FILE = "Pixel Picker/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.acheronfail.pixel-picker";
|
||||
PRODUCT_MODULE_NAME = PixelPicker;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "PixelPicker/Bridging-Header.h";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Pixel Picker/Bridging-Header.h";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
@@ -577,13 +584,14 @@
|
||||
"$(PROJECT_DIR)/Carthage/Build/Mac",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = c11;
|
||||
INFOPLIST_FILE = PixelPicker/Info.plist;
|
||||
INFOPLIST_FILE = "Pixel Picker/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.acheronfail.pixel-picker";
|
||||
PRODUCT_MODULE_NAME = PixelPicker;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "PixelPicker/Bridging-Header.h";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Pixel Picker/Bridging-Header.h";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
@@ -591,7 +599,7 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
15B4E877207994AF0024FDE4 /* Build configuration list for PBXNativeTarget "PixelPickerTests" */ = {
|
||||
15B4E877207994AF0024FDE4 /* Build configuration list for PBXNativeTarget "Pixel PickerTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
15B4E878207994AF0024FDE4 /* Debug */,
|
||||
@@ -600,7 +608,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
B3B4C2B81E25894B009F8E4E /* Build configuration list for PBXProject "PixelPicker" */ = {
|
||||
B3B4C2B81E25894B009F8E4E /* Build configuration list for PBXProject "Pixel Picker" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
B3B4C2C81E25894B009F8E4E /* Debug */,
|
||||
@@ -609,7 +617,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
B3B4C2CA1E25894B009F8E4E /* Build configuration list for PBXNativeTarget "PixelPicker" */ = {
|
||||
B3B4C2CA1E25894B009F8E4E /* Build configuration list for PBXNativeTarget "Pixel Picker" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
B3B4C2CB1E25894B009F8E4E /* Debug */,
|
||||
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:/Users/cosmotherly/dev/pixel-picker/PixelPicker.xcodeproj">
|
||||
location = "self:/Users/cosmotherly/src/pixel-picker/Pixel Picker.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -15,9 +15,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B3B4C2BC1E25894B009F8E4E"
|
||||
BuildableName = "PixelPicker.app"
|
||||
BlueprintName = "PixelPicker"
|
||||
ReferencedContainer = "container:PixelPicker.xcodeproj">
|
||||
BuildableName = "Pixel Picker.app"
|
||||
BlueprintName = "Pixel Picker"
|
||||
ReferencedContainer = "container:Pixel Picker.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
@@ -34,9 +34,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "15B4E86F207994AF0024FDE4"
|
||||
BuildableName = "PixelPickerTests.xctest"
|
||||
BlueprintName = "PixelPickerTests"
|
||||
ReferencedContainer = "container:PixelPicker.xcodeproj">
|
||||
BuildableName = "Pixel PickerTests.xctest"
|
||||
BlueprintName = "Pixel PickerTests"
|
||||
ReferencedContainer = "container:Pixel Picker.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
@@ -44,9 +44,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B3B4C2BC1E25894B009F8E4E"
|
||||
BuildableName = "PixelPicker.app"
|
||||
BlueprintName = "PixelPicker"
|
||||
ReferencedContainer = "container:PixelPicker.xcodeproj">
|
||||
BuildableName = "Pixel Picker.app"
|
||||
BlueprintName = "Pixel Picker"
|
||||
ReferencedContainer = "container:Pixel Picker.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<EnvironmentVariables>
|
||||
@@ -79,9 +79,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B3B4C2BC1E25894B009F8E4E"
|
||||
BuildableName = "PixelPicker.app"
|
||||
BlueprintName = "PixelPicker"
|
||||
ReferencedContainer = "container:PixelPicker.xcodeproj">
|
||||
BuildableName = "Pixel Picker.app"
|
||||
BlueprintName = "Pixel Picker"
|
||||
ReferencedContainer = "container:Pixel Picker.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
@@ -98,9 +98,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B3B4C2BC1E25894B009F8E4E"
|
||||
BuildableName = "PixelPicker.app"
|
||||
BlueprintName = "PixelPicker"
|
||||
ReferencedContainer = "container:PixelPicker.xcodeproj">
|
||||
BuildableName = "Pixel Picker.app"
|
||||
BlueprintName = "Pixel Picker"
|
||||
ReferencedContainer = "container:Pixel Picker.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// AppDelegate+Menu.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import MASShortcut
|
||||
@@ -24,9 +24,11 @@ import CleanroomLogger
|
||||
var logConfigurations: [LogConfiguration] = [
|
||||
RotatingLogFileConfiguration(minimumSeverity: minimumSeverity, daysToKeep: 7, directoryPath: defaultLogPath().path)
|
||||
]
|
||||
|
||||
#if DEBUG
|
||||
logConfigurations.append(XcodeLogConfiguration(minimumSeverity: .debug))
|
||||
#endif
|
||||
|
||||
Log.enable(configuration: logConfigurations)
|
||||
PPState.shared.loadFromDisk()
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 994 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Bridging-Header.h
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
#ifndef Bridging_Header_h
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// CGImage.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import CleanroomLogger
|
||||
@@ -1,9 +1,9 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf400
|
||||
{\fonttbl\f0\fswiss\fcharset0 ArialMT;\f1\fnil\fcharset0 AppleColorEmoji;\f2\fmodern\fcharset0 Courier;
|
||||
}
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf200
|
||||
{\fonttbl\f0\fswiss\fcharset0 ArialMT;\f1\fnil\fcharset0 AppleColorEmoji;\f2\fswiss\fcharset0 Arial-BoldMT;
|
||||
\f3\fswiss\fcharset0 Arial-ItalicMT;\f4\fmodern\fcharset0 Courier;}
|
||||
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red230\green230\blue230;}
|
||||
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\csgray\c92143;}
|
||||
\margl1440\margr1440\vieww12800\viewh10340\viewkind0
|
||||
\paperw12240\paperh15840\margl1440\margr1440\vieww12800\viewh10340\viewkind0
|
||||
\deftab720
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
\f0 \
|
||||
\
|
||||
|
||||
\b\fs28 PixelPicker makes use of the following open source libraries
|
||||
\b0\fs26\fsmilli13333 \
|
||||
\f2\b\fs28 Pixel Picker makes use of the following open source libraries
|
||||
\f0\b0\fs26\fsmilli13333 \
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/emaloney/CleanroomLogger"}}{\fldrslt \cf2 CleanroomLogger}}\
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
@@ -29,36 +29,36 @@
|
||||
\
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
|
||||
\b\fs36 \cf2 Experimental Overrides
|
||||
\b0 \
|
||||
\f2\b\fs36 \cf2 Experimental Overrides
|
||||
\f0\b0 \
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
|
||||
\fs26\fsmilli13333 \cf2 These are experimental options that haven't made it into PixelPickers's UI yet, and may be toggled via the Terminal. Each override is listed as
|
||||
\b key:
|
||||
\i\b0 type
|
||||
\i0 which you can enable like:\
|
||||
\fs26\fsmilli13333 \cf2 These are experimental options that haven't made it into Pixel Pickers's UI yet, and may be toggled via the Terminal. Each override is listed as
|
||||
\f2\b key:
|
||||
\f3\i\b0 type
|
||||
\f0\i0 which you can enable like:\
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
|
||||
\f2\fs20 \cf2 \cb3 defaults write com.acheronfail.pixel-picker debugMode -bool true
|
||||
\f4\fs20 \cf2 \cb3 defaults write com.acheronfail.pixel-picker debugMode -bool true
|
||||
\f0\fs26\fsmilli13333 \cb1 \
|
||||
\
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
|
||||
\b \cf0 \kerning1\expnd0\expndtw0 leftClickActivates
|
||||
\b0 \cf2 \expnd0\expndtw0\kerning0
|
||||
\f2\b \cf0 \kerning1\expnd0\expndtw0 leftClickActivates
|
||||
\f0\b0 \cf2 \expnd0\expndtw0\kerning0
|
||||
:
|
||||
\i \cf0 \kerning1\expnd0\expndtw0 Bool = false\
|
||||
\f3\i \cf0 \kerning1\expnd0\expndtw0 Bool = false\
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
|
||||
\i0 \cf2 \expnd0\expndtw0\kerning0
|
||||
\f0\i0 \cf2 \expnd0\expndtw0\kerning0
|
||||
Swaps the left and right click buttons when clicking on the menu bar icon. So left-clicking will activate the picker, and right-clicking will open the dropdown menu.\
|
||||
\
|
||||
\pard\pardeftab720\qc\partightenfactor0
|
||||
|
||||
\b \cf0 \kerning1\expnd0\expndtw0 debugMode
|
||||
\b0 \cf2 \expnd0\expndtw0\kerning0
|
||||
\f2\b \cf0 \kerning1\expnd0\expndtw0 debugMode
|
||||
\f0\b0 \cf2 \expnd0\expndtw0\kerning0
|
||||
:
|
||||
\i \cf0 \kerning1\expnd0\expndtw0 Bool = false
|
||||
\i0 \cf2 \expnd0\expndtw0\kerning0
|
||||
\f3\i \cf0 \kerning1\expnd0\expndtw0 Bool = false
|
||||
\f0\i0 \cf2 \expnd0\expndtw0\kerning0
|
||||
\
|
||||
Set this to true to enable debug logging. This results in a higher level of logs being written to ~/Library/Preferences/PixelPicker/logs/.}
|
||||
Set this to true to enable debug logging. This results in a higher level of logs being written to ~/Library/Preferences/Pixel Picker/logs/.}
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.3.3</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>10</string>
|
||||
<string>13</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// NSBezierPath.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
// Extend NSBezierPath to allow easy conversion to a CGPath.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// NSColor.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import SwiftyJSON
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// PPOverlayController.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import CleanroomLogger
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// PPOverlayPanel.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
// This class is in charge of managing the panels which are brought to the front
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// PPOverlayPreview.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
// This class is in charge of rendering the pixel preview.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// PPOverlayWrapper.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
// This class is basically the content view of the overlay panel.
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// PPColor.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import SwiftyJSON
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// CarbonEventInterceptor.h
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
#ifndef CarbonEventInterceptor_h
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// CarbonEventInterceptor.m
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
#import "PPMenuShortcutView.h"
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// PPState.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import SwiftyJSON
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// ShowAndHideCursor.h
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
#ifndef ShowAndHideCursor_h
|
||||
#define ShowAndHideCursor_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// Unfortunately `kCGDirectMainDisplay` is unavailable in Swift.
|
||||
CGDirectDisplayID kCGDirectMainDisplayGetter(void);
|
||||
|
||||
#endif /* ShowAndHideCursor_h */
|
||||
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// ShowAndHideCursor.m
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
#include "ShowAndHideCursor.h"
|
||||
|
||||
// Unfortunately `kCGDirectMainDisplay` is unavailable in Swift.
|
||||
CGDirectDisplayID kCGDirectMainDisplayGetter() {
|
||||
return kCGDirectMainDisplay;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// ShowAndHideCursor.swift
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import ApplicationServices
|
||||
|
||||
typealias notAPrivateAPI0 = @convention(c) () -> CInt
|
||||
typealias notAPrivateAPI1 = @convention(c) (CInt, CInt, CFString, CFTypeRef) -> CGError
|
||||
|
||||
// JS: f = (n, s) => `[${[...s].map((x, i) => x.charCodeAt(0) + i + n).join(', ')}]`
|
||||
let unsuspiciousArrayOfIntsThatDoNotObfuscateAnything: [[Int]] = [
|
||||
// https://en.wikipedia.org/wiki/Leet
|
||||
[1, 3, 3, 7],
|
||||
// Framework path
|
||||
[84, 123, 118, 120, 106, 115, 54, 84, 114, 108, 125, 109, 127, 135, 62, 86, 131, 115, 128, 121, 140, 133, 137, 131, 140, 73, 92, 140, 141, 138, 136, 131, 130, 150, 140, 147, 147, 121, 140, 154, 159, 147, 142, 145, 160, 92, 149, 162, 146, 159, 152, 171, 164, 168, 162, 103, 122, 170, 171, 168, 166, 161, 160, 180, 170, 177, 177, 151, 170, 184, 189, 177, 172, 175, 190],
|
||||
// _CGSDefaultConnection
|
||||
[97, 70, 75, 88, 74, 108, 110, 106, 127, 119, 128, 80, 125, 125, 126, 118, 117, 135, 125, 132, 132],
|
||||
// CGSSetConnectionProperty
|
||||
[70, 75, 88, 89, 108, 124, 76, 121, 121, 122, 114, 113, 131, 121, 128, 128, 99, 134, 132, 134, 124, 138, 141, 147]
|
||||
]
|
||||
|
||||
func aFnThatDoesNotObfuscateAnythingAtAll(_ i: Int, _ ints: [Int]) -> String {
|
||||
return String(ints.enumerated().map({ Character(UnicodeScalar($0.element + i - $0.offset)!) }))
|
||||
}
|
||||
|
||||
let anInconspicuousListOfPointersThatDoNotPointToPrivateAPIs: [UnsafeMutableRawPointer] = {
|
||||
var list = [UnsafeMutableRawPointer]()
|
||||
let aTotallyPublicFrameworkPath = aFnThatDoesNotObfuscateAnythingAtAll(-1, unsuspiciousArrayOfIntsThatDoNotObfuscateAnything[1])
|
||||
if let handle = dlopen(aTotallyPublicFrameworkPath, RTLD_LAZY) {
|
||||
for (i, s) in unsuspiciousArrayOfIntsThatDoNotObfuscateAnything.dropFirst(2).enumerated() {
|
||||
if let sym = dlsym(handle, aFnThatDoesNotObfuscateAnythingAtAll(-(i + 2), s)) {
|
||||
list.append(sym)
|
||||
}
|
||||
}
|
||||
dlclose(handle)
|
||||
}
|
||||
|
||||
return list
|
||||
}()
|
||||
|
||||
// Unfortunately, this can't be accessed in Swift. *sigh*
|
||||
let kCGDirectMainDisplay = kCGDirectMainDisplayGetter()
|
||||
|
||||
// Calls to `CGDisplayShowCursor` and `CGDisplayHideCursor` need to be balanced.
|
||||
// See https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/QuartzDisplayServicesConceptual/Articles/MouseCursor.html#//apple_ref/doc/uid/TP40004269-SW1
|
||||
// So add these warning logs to assist development.
|
||||
var cursorIsHidden = false
|
||||
|
||||
// Decrements the hide cursor count, and shows the mouse cursor if the count is 0.
|
||||
func ShowCursor() {
|
||||
#if DEBUG
|
||||
if (!cursorIsHidden) {
|
||||
print("WARNING: Calls to ShowCursor/HideCursor must be balanced, inbalanced call detected")
|
||||
}
|
||||
cursorIsHidden = false
|
||||
#endif
|
||||
|
||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
}
|
||||
|
||||
// Hides the mouse cursor, and increments the hide cursor count.
|
||||
// Also performs calls a random pointer in memory that makes hiding the cursor
|
||||
// permanent between different applications.
|
||||
func HideCursor() {
|
||||
#if DEBUG
|
||||
if (cursorIsHidden) {
|
||||
print("WARNING: Calls to ShowCursor/HideCursor must be balanced, inbalanced call detected")
|
||||
}
|
||||
cursorIsHidden = true
|
||||
#endif
|
||||
|
||||
let pt0 = anInconspicuousListOfPointersThatDoNotPointToPrivateAPIs[0]
|
||||
let cid = unsafeBitCast(pt0, to: notAPrivateAPI0.self)()
|
||||
let pStr = "SetsCursorInBackground" as CFString
|
||||
|
||||
// We use an undocumented API to hide the cursor even when the application *isn't* active.
|
||||
// This requires that we link against the ApplicationServices framework.
|
||||
// See: https://stackoverflow.com/a/3939241/5552584
|
||||
// Also: https://github.com/asmagill/hammerspoon_asm.undocumented/blob/master/cursor/CGSConnection.h
|
||||
let pt1 = anInconspicuousListOfPointersThatDoNotPointToPrivateAPIs[1]
|
||||
let _ = unsafeBitCast(pt1, to: notAPrivateAPI1.self)(cid, cid, pStr, kCFBooleanTrue)
|
||||
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Util.swift
|
||||
// PixelPicker
|
||||
// Pixel Picker
|
||||
//
|
||||
|
||||
import CleanroomLogger
|
||||
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// ShowAndHideCursor.h
|
||||
// PixelPicker
|
||||
//
|
||||
|
||||
#ifndef ShowAndHideCursor_h
|
||||
#define ShowAndHideCursor_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
void ShowCursor(void);
|
||||
void HideCursor(void);
|
||||
void LogWarning(void);
|
||||
|
||||
// We use an undocumented API to hide the cursor even when the application *isn't* active.
|
||||
// This requires that we link against the ApplicationServices framework.
|
||||
// See: https://stackoverflow.com/a/3939241/5552584
|
||||
// Also: https://github.com/asmagill/hammerspoon_asm.undocumented/blob/master/cursor/CGSConnection.h
|
||||
|
||||
// Every application is given a singular connection ID through which it can receieve and manipulate
|
||||
// values, state, notifications, events, etc. in the Window Server.
|
||||
typedef int CGSConnectionID;
|
||||
|
||||
// Associates a value for the given key on the given connection.
|
||||
CGError CGSSetConnectionProperty(CGSConnectionID cid, CGSConnectionID targetCID, CFStringRef key, CFTypeRef value);
|
||||
|
||||
// Gets the default connection for this process. `CGSMainConnectionID` is just a more modern name.
|
||||
CGSConnectionID _CGSDefaultConnection(void);
|
||||
CGSConnectionID CGSMainConnectionID(void);
|
||||
|
||||
#endif /* ShowAndHideCursor_h */
|
||||
@@ -1,39 +0,0 @@
|
||||
//
|
||||
// ShowAndHideCursor.m
|
||||
// PixelPicker
|
||||
//
|
||||
|
||||
#include "ShowAndHideCursor.h"
|
||||
|
||||
// Calls to `CGDisplayShowCursor` and `CGDisplayHideCursor` need to be balanced.
|
||||
// See https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/QuartzDisplayServicesConceptual/Articles/MouseCursor.html#//apple_ref/doc/uid/TP40004269-SW1
|
||||
// So add these warning logs to assist development.
|
||||
#ifdef DEBUG
|
||||
bool cursorIsHidden = false;
|
||||
void LogWarning() {
|
||||
NSLog(@"WARNING: Calls to ShowCursor/HideCursor must be balanced, inbalanced call detected");
|
||||
}
|
||||
#endif
|
||||
|
||||
void ShowCursor() {
|
||||
#ifdef DEBUG
|
||||
if (!cursorIsHidden) LogWarning();
|
||||
cursorIsHidden = false;
|
||||
#endif
|
||||
|
||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
}
|
||||
|
||||
void HideCursor() {
|
||||
#ifdef DEBUG
|
||||
if (cursorIsHidden) LogWarning();
|
||||
cursorIsHidden = true;
|
||||
#endif
|
||||
|
||||
CFStringRef propertyString = CFStringCreateWithCString(NULL, "SetsCursorInBackground", kCFStringEncodingUTF8);
|
||||
CGSConnectionID cid = _CGSDefaultConnection();
|
||||
CGSSetConnectionProperty(cid, cid, propertyString, kCFBooleanTrue);
|
||||
CFRelease(propertyString);
|
||||
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||

|
||||

|
||||
|
||||
PixelPicker is like Digital Color Meter, but lives in your menu bar and lets you get the color of any pixel easily. Just hit your shortcut, up comes a magnifying glass, and away you go!
|
||||
Pixel Picker is like Digital Color Meter, but lives in your menu bar and lets you get the color of any pixel easily. Just hit your shortcut, up comes a magnifying glass, and away you go!
|
||||
|
||||
### Features
|
||||
|
||||
@@ -17,11 +17,19 @@ PixelPicker is like Digital Color Meter, but lives in your menu bar and lets you
|
||||
|
||||
## Installation
|
||||
|
||||
Simply download the dmg from the [releases](https://github.com/acheronfail/pixel-picker/releases) tab and drag "Pixel Picker.app" into your `/Applications` folder.
|
||||
#### Via Homebrew:
|
||||
|
||||
```bash
|
||||
brew cask install pixel-picker
|
||||
```
|
||||
|
||||
#### Via GitHub Releases
|
||||
|
||||
Simply download the dmg from the [releases](https://github.com/acheronfail/pixel-picker/releases) tab and drag "PixelPicker.app" into your `/Applications` folder.
|
||||
|
||||
## Usage
|
||||
|
||||
After you've installed PixelPicker, it will live in your menu bar. You have many different ways of activating the picker:
|
||||
After you've installed Pixel Picker, it will live in your menu bar. You have many different ways of activating the picker:
|
||||
|
||||
* Configure a keyboard shortcut in the dropdown menu and press that to activate the picker
|
||||
* Select the "Pick a Pixel" item in the dropdown menu to activate the picker
|
||||
@@ -34,14 +42,14 @@ You can also hold down the <kbd>control (⌃)</kbd> key (this can be changed to
|
||||
|
||||
### Options
|
||||
|
||||
All of PixelPicker's options are in its menubar dropdown. Simply click on the menu bar item, and you can configure the picker right there in your menu.
|
||||
All of Pixel Picker's options are in its menubar dropdown. Simply click on the menu bar item, and you can configure the picker right there in your menu.
|
||||
|
||||
PixelPicker provides some neat options:
|
||||
Pixel Picker provides some neat options:
|
||||
|
||||
* 🔳 **Show Grid**
|
||||
* Whether or not to show a grid around the pixels in the picker's preview.
|
||||
* 🎨 **Color Space**
|
||||
* Computer screens are complex things, and have various color spaces. You can either leave this setting as its default (it will choose the default color space of your screen) or you can specify a specific color space and PixelPicker will try and use that instead (compatibility depends on your computer's screen/monitor).
|
||||
* Computer screens are complex things, and have various color spaces. You can either leave this setting as its default (it will choose the default color space of your screen) or you can specify a specific color space and Pixel Picker will try and use that instead (compatibility depends on your computer's screen/monitor).
|
||||
* ✏️ **Color Format**
|
||||
* How should the color be copied when you select it? Examples include CSS Hex: `#aabbcc`, or Java RGB: `new Color(158, 198, 117)`, etc.
|
||||
* 🔍 **Magnification**
|
||||
@@ -53,11 +61,11 @@ PixelPicker provides some neat options:
|
||||
* ⌨️ **Picker Shortcut**
|
||||
* The global keyboard shortcut to use that will activate Pixel Picker.
|
||||
* 🚀 **Launch at Login**
|
||||
* If this is enabled then PixelPicker will be launched when you log into your computer.
|
||||
* If this is enabled then Pixel Picker will be launched when you log into your computer.
|
||||
|
||||
#### Extra Overrides or Hidden Settings
|
||||
|
||||
In some releases PixelPicker might have some experimental overrides that can be toggled via the Terminal (`defaults write ...`, etc). Look under the "Experimental Overrides" section at `PixelPicker` -> `About` for more information.
|
||||
In some releases Pixel Picker might have some experimental overrides that can be toggled via the Terminal (`defaults write ...`, etc). Look under the "Experimental Overrides" section at `Pixel Picker` -> `About` for more information.
|
||||
|
||||
## Questions/Concerns
|
||||
|
||||
@@ -67,7 +75,7 @@ None yet!
|
||||
|
||||
#### Setting up the project
|
||||
|
||||
PixelPicker uses `carthage` to manage its dependencies (you can install it with `brew`). To build PixelPicker on your machine:
|
||||
Pixel Picker uses `carthage` to manage its dependencies (you can install it with `brew`). To build Pixel Picker on your machine:
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
@@ -75,7 +83,7 @@ git clone git@github.com:acheronfail/pixel-picker && cd pixel-picker
|
||||
# Install dependencies with carthage
|
||||
carthage update --platform macos
|
||||
# Open the project
|
||||
open PixelPicker.xcodeproj
|
||||
open "Pixel Picker.xcodeproj"
|
||||
```
|
||||
|
||||
Once you've opened the Xcode project, it should be enough to make your changes and then just hit the build/run button and go from there.
|
||||
|
||||