Skip to content

Commit

Permalink
Version 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ribalba committed Sep 29, 2023
1 parent 4e1aa17 commit d172160
Show file tree
Hide file tree
Showing 27 changed files with 640 additions and 13 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,10 @@ The hog is developed to not need any dependencies.
## Sources

- Logo from https://pixabay.com/de/vectors/schwein-schweinchen-ferkel-2660356/
- Caribou (Public Domain) lib from https://raw.githubusercontent.com/clutchski/caribou/master/caribou.py
- Caribou (Public Domain) lib from https://raw.githubusercontent.com/clutchski/caribou/master/caribou.py

## Misc

- If you can't see the hog logo in the menu bar because of the notch there are multiple solutions.
- you can use a tool like https://www.macbartender.com/Bartender4/
- you can use the the command `$ sudo /usr/local/bin/hog/power_logger.py -w` to display the url.
193 changes: 192 additions & 1 deletion app/hog/hog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
0A21F0132AC6D0DA0036252A /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A21F0122AC6D0DA0036252A /* WidgetKit.framework */; };
0A21F0152AC6D0DA0036252A /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A21F0142AC6D0DA0036252A /* SwiftUI.framework */; };
0A21F0182AC6D0DA0036252A /* widgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21F0172AC6D0DA0036252A /* widgetBundle.swift */; };
0A21F01A2AC6D0DA0036252A /* widget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21F0192AC6D0DA0036252A /* widget.swift */; };
0A21F01C2AC6D0DA0036252A /* AppIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21F01B2AC6D0DA0036252A /* AppIntent.swift */; };
0A21F01E2AC6D0DB0036252A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A21F01D2AC6D0DB0036252A /* Assets.xcassets */; };
0A21F0232AC6D0DB0036252A /* widgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 0A21F0102AC6D0DA0036252A /* widgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
0A69EDE42AA0820E00F4A364 /* DetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A69EDE32AA0820E00F4A364 /* DetailView.swift */; };
0A6C64572AAF5F9A00664D98 /* demo_db.db in Resources */ = {isa = PBXBuildFile; fileRef = 0A6C64562AAF5F9A00664D98 /* demo_db.db */; };
0AEC07772A40D4C2003C82E7 /* hogApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AEC07762A40D4C2003C82E7 /* hogApp.swift */; };
Expand All @@ -18,6 +25,13 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
0A21F0212AC6D0DB0036252A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0AEC076B2A40D4C2003C82E7 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0A21F00F2AC6D0DA0036252A;
remoteInfo = widgetExtension;
};
0AEC07852A40D4C3003C82E7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0AEC076B2A40D4C2003C82E7 /* Project object */;
Expand All @@ -34,7 +48,30 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
0A21F0242AC6D0DB0036252A /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
0A21F0232AC6D0DB0036252A /* widgetExtension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0A21F0102AC6D0DA0036252A /* widgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = widgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
0A21F0122AC6D0DA0036252A /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
0A21F0142AC6D0DA0036252A /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
0A21F0172AC6D0DA0036252A /* widgetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = widgetBundle.swift; sourceTree = "<group>"; };
0A21F0192AC6D0DA0036252A /* widget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = widget.swift; sourceTree = "<group>"; };
0A21F01B2AC6D0DA0036252A /* AppIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIntent.swift; sourceTree = "<group>"; };
0A21F01D2AC6D0DB0036252A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
0A21F01F2AC6D0DB0036252A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0A21F0202AC6D0DB0036252A /* widget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = widget.entitlements; sourceTree = "<group>"; };
0A69EDE32AA0820E00F4A364 /* DetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailView.swift; sourceTree = "<group>"; };
0A6C64552AACBA5A00664D98 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
0A6C64562AAF5F9A00664D98 /* demo_db.db */ = {isa = PBXFileReference; lastKnownFileType = text; path = demo_db.db; sourceTree = "<group>"; };
Expand All @@ -51,6 +88,15 @@
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
0A21F00D2AC6D0DA0036252A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0A21F0152AC6D0DA0036252A /* SwiftUI.framework in Frameworks */,
0A21F0132AC6D0DA0036252A /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0AEC07702A40D4C2003C82E7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -75,12 +121,36 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0A21F0112AC6D0DA0036252A /* Frameworks */ = {
isa = PBXGroup;
children = (
0A21F0122AC6D0DA0036252A /* WidgetKit.framework */,
0A21F0142AC6D0DA0036252A /* SwiftUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
0A21F0162AC6D0DA0036252A /* widget */ = {
isa = PBXGroup;
children = (
0A21F0172AC6D0DA0036252A /* widgetBundle.swift */,
0A21F0192AC6D0DA0036252A /* widget.swift */,
0A21F01B2AC6D0DA0036252A /* AppIntent.swift */,
0A21F01D2AC6D0DB0036252A /* Assets.xcassets */,
0A21F01F2AC6D0DB0036252A /* Info.plist */,
0A21F0202AC6D0DB0036252A /* widget.entitlements */,
);
path = widget;
sourceTree = "<group>";
};
0AEC076A2A40D4C2003C82E7 = {
isa = PBXGroup;
children = (
0AEC07752A40D4C2003C82E7 /* hog */,
0AEC07872A40D4C3003C82E7 /* hogTests */,
0AEC07912A40D4C3003C82E7 /* hogUITests */,
0A21F0162AC6D0DA0036252A /* widget */,
0A21F0112AC6D0DA0036252A /* Frameworks */,
0AEC07742A40D4C2003C82E7 /* Products */,
);
sourceTree = "<group>";
Expand All @@ -91,6 +161,7 @@
0AEC07732A40D4C2003C82E7 /* hog.app */,
0AEC07842A40D4C3003C82E7 /* hogTests.xctest */,
0AEC078E2A40D4C3003C82E7 /* hogUITests.xctest */,
0A21F0102AC6D0DA0036252A /* widgetExtension.appex */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -137,17 +208,36 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
0A21F00F2AC6D0DA0036252A /* widgetExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0A21F0272AC6D0DB0036252A /* Build configuration list for PBXNativeTarget "widgetExtension" */;
buildPhases = (
0A21F00C2AC6D0DA0036252A /* Sources */,
0A21F00D2AC6D0DA0036252A /* Frameworks */,
0A21F00E2AC6D0DA0036252A /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = widgetExtension;
productName = widgetExtension;
productReference = 0A21F0102AC6D0DA0036252A /* widgetExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
0AEC07722A40D4C2003C82E7 /* hog */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0AEC07982A40D4C3003C82E7 /* Build configuration list for PBXNativeTarget "hog" */;
buildPhases = (
0AEC076F2A40D4C2003C82E7 /* Sources */,
0AEC07702A40D4C2003C82E7 /* Frameworks */,
0AEC07712A40D4C2003C82E7 /* Resources */,
0A21F0242AC6D0DB0036252A /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
0A21F0222AC6D0DB0036252A /* PBXTargetDependency */,
);
name = hog;
productName = hog;
Expand Down Expand Up @@ -197,9 +287,12 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1430;
LastSwiftUpdateCheck = 1500;
LastUpgradeCheck = 1500;
TargetAttributes = {
0A21F00F2AC6D0DA0036252A = {
CreatedOnToolsVersion = 15.0;
};
0AEC07722A40D4C2003C82E7 = {
CreatedOnToolsVersion = 14.3.1;
};
Expand Down Expand Up @@ -229,11 +322,20 @@
0AEC07722A40D4C2003C82E7 /* hog */,
0AEC07832A40D4C3003C82E7 /* hogTests */,
0AEC078D2A40D4C3003C82E7 /* hogUITests */,
0A21F00F2AC6D0DA0036252A /* widgetExtension */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
0A21F00E2AC6D0DA0036252A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0A21F01E2AC6D0DB0036252A /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0AEC07712A40D4C2003C82E7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -261,6 +363,16 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
0A21F00C2AC6D0DA0036252A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0A21F0182AC6D0DA0036252A /* widgetBundle.swift in Sources */,
0A21F01A2AC6D0DA0036252A /* widget.swift in Sources */,
0A21F01C2AC6D0DA0036252A /* AppIntent.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0AEC076F2A40D4C2003C82E7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -290,6 +402,11 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
0A21F0222AC6D0DB0036252A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0A21F00F2AC6D0DA0036252A /* widgetExtension */;
targetProxy = 0A21F0212AC6D0DB0036252A /* PBXContainerItemProxy */;
};
0AEC07862A40D4C3003C82E7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0AEC07722A40D4C2003C82E7 /* hog */;
Expand All @@ -303,6 +420,69 @@
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
0A21F0252AC6D0DB0036252A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = widget/widget.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = SBWA476E6F;
ENABLE_HARDENED_RUNTIME = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = widget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = widget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "berlin.green-coding.hog.widget";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
0A21F0262AC6D0DB0036252A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = widget/widget.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = SBWA476E6F;
ENABLE_HARDENED_RUNTIME = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = widget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = widget;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "berlin.green-coding.hog.widget";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
0AEC07962A40D4C3003C82E7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -427,6 +607,7 @@
0AEC07992A40D4C3003C82E7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
Expand Down Expand Up @@ -461,6 +642,7 @@
0AEC079A2A40D4C3003C82E7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
Expand Down Expand Up @@ -571,6 +753,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
0A21F0272AC6D0DB0036252A /* Build configuration list for PBXNativeTarget "widgetExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0A21F0252AC6D0DB0036252A /* Debug */,
0A21F0262AC6D0DB0036252A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
0AEC076E2A40D4C2003C82E7 /* Build configuration list for PBXProject "hog" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>widgetExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
Expand Down
11 changes: 9 additions & 2 deletions app/hog/hog/DetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ struct DataView: View {
}

var body: some View {
VStack{
VStack(){

HStack {
VStack(alignment: .leading, spacing: 8) {
Expand Down Expand Up @@ -721,7 +721,7 @@ struct DataView: View {
}
}) {
Text("View Detailed Analytics")
.padding(20)
.padding(10)
}


Expand Down Expand Up @@ -900,6 +900,13 @@ struct StepsView: View {
.scaledToFit()
.frame(width: 50, height: 50)
Text("Welcome to the hog").font(.title)
Spacer()
Button(action: {
exit(0)
}) {
Image(systemName: "x.circle")
}

}
Text("It looks like you haven't installed the program that we need to collect the power measurments. Please follow these steps:")
Divider()
Expand Down
18 changes: 18 additions & 0 deletions app/hog/widget/AppIntent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// AppIntent.swift
// widget
//
// Created by Didi Hoffmann on 29.09.23.
//

import WidgetKit
import AppIntents

struct ConfigurationAppIntent: WidgetConfigurationIntent {
static var title: LocalizedStringResource = "Configuration"
static var description = IntentDescription("This is an example widget.")

// An example configurable parameter.
@Parameter(title: "Favorite Emoji", default: "😃")
var favoriteEmoji: String
}
Loading

0 comments on commit d172160

Please sign in to comment.