diff --git a/README.md b/README.md
index 8c0b2a8..cd68158 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,16 @@
-# Defi
-
-[](https://github.com/qeude/Defi/actions/workflows/ci.yml)
+
+
+
+
+
+
+
+
+Defi
+
+
+
+
Defi is a native macOS scrolling-column window manager inspired by
[Niri](https://github.com/YaLTeR/niri). It is built around one simple idea:
diff --git a/Support/Defi.icon/Assets/window.svg b/Support/Defi.icon/Assets/window.svg
new file mode 100644
index 0000000..30c8811
--- /dev/null
+++ b/Support/Defi.icon/Assets/window.svg
@@ -0,0 +1,3 @@
+
diff --git a/Support/Defi.icon/icon.json b/Support/Defi.icon/icon.json
new file mode 100644
index 0000000..0d12504
--- /dev/null
+++ b/Support/Defi.icon/icon.json
@@ -0,0 +1,188 @@
+{
+ "color-space-for-untagged-svg-colors": "display-p3",
+ "fill-specializations": [
+ {
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.025,0.050,0.130,1.000",
+ "display-p3:0.003,0.012,0.040,1.000"
+ ],
+ "orientation": {
+ "start": {
+ "x": 0.15,
+ "y": 0.05
+ },
+ "stop": {
+ "x": 0.85,
+ "y": 0.95
+ }
+ }
+ }
+ },
+ {
+ "appearance": "dark",
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.025,0.050,0.130,1.000",
+ "display-p3:0.003,0.012,0.040,1.000"
+ ],
+ "orientation": {
+ "start": {
+ "x": 0.15,
+ "y": 0.05
+ },
+ "stop": {
+ "x": 0.85,
+ "y": 0.95
+ }
+ }
+ }
+ }
+ ],
+ "groups": [
+ {
+ "blur": 0.18,
+ "layers": [
+ {
+ "fill-specializations": [
+ {
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.060,0.440,1.000,0.860",
+ "display-p3:0.010,0.085,0.480,0.780"
+ ]
+ }
+ },
+ {
+ "appearance": "dark",
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.060,0.440,1.000,0.860",
+ "display-p3:0.010,0.085,0.480,0.780"
+ ]
+ }
+ }
+ ],
+ "glass": true,
+ "image-name": "window.svg",
+ "name": "Focused Window"
+ }
+ ],
+ "lighting": "individual",
+ "name": "Focused Window",
+ "position": {
+ "scale": 1.12,
+ "translation-in-points": [
+ 165,
+ 0
+ ]
+ },
+ "shadow": {
+ "kind": "layer-color",
+ "opacity": 0.22
+ },
+ "specular": true,
+ "translucency": {
+ "enabled": true,
+ "value": 0.46
+ }
+ },
+ {
+ "blur": 0.2,
+ "layers": [
+ {
+ "fill-specializations": [
+ {
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.120,0.550,0.950,0.740",
+ "display-p3:0.010,0.160,0.550,0.640"
+ ]
+ }
+ },
+ {
+ "appearance": "dark",
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.120,0.550,0.950,0.740",
+ "display-p3:0.010,0.160,0.550,0.640"
+ ]
+ }
+ }
+ ],
+ "glass": true,
+ "image-name": "window.svg",
+ "name": "Middle Window"
+ }
+ ],
+ "lighting": "individual",
+ "name": "Middle Window",
+ "position": {
+ "scale": 1.12,
+ "translation-in-points": [
+ 0,
+ 0
+ ]
+ },
+ "shadow": {
+ "kind": "neutral",
+ "opacity": 0.16
+ },
+ "specular": true,
+ "translucency": {
+ "enabled": true,
+ "value": 0.54
+ }
+ },
+ {
+ "blur": 0.2,
+ "layers": [
+ {
+ "fill-specializations": [
+ {
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.320,0.620,0.920,0.680",
+ "display-p3:0.030,0.220,0.520,0.580"
+ ]
+ }
+ },
+ {
+ "appearance": "dark",
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.320,0.620,0.920,0.680",
+ "display-p3:0.030,0.220,0.520,0.580"
+ ]
+ }
+ }
+ ],
+ "glass": true,
+ "image-name": "window.svg",
+ "name": "Trailing Window"
+ }
+ ],
+ "lighting": "individual",
+ "name": "Trailing Window",
+ "position": {
+ "scale": 1.12,
+ "translation-in-points": [
+ -165,
+ 0
+ ]
+ },
+ "shadow": {
+ "kind": "neutral",
+ "opacity": 0.16
+ },
+ "specular": true,
+ "translucency": {
+ "enabled": true,
+ "value": 0.54
+ }
+ }
+ ],
+ "supported-platforms": {
+ "squares": "shared"
+ }
+}
diff --git a/docs/assets/defi-icon-dark.png b/docs/assets/defi-icon-dark.png
new file mode 100644
index 0000000..4b0bb7d
Binary files /dev/null and b/docs/assets/defi-icon-dark.png differ
diff --git a/docs/assets/defi-icon-light.png b/docs/assets/defi-icon-light.png
new file mode 100644
index 0000000..0b746a6
Binary files /dev/null and b/docs/assets/defi-icon-light.png differ
diff --git a/script/build_and_run.sh b/script/build_and_run.sh
index 4f338ea..81a2384 100755
--- a/script/build_and_run.sh
+++ b/script/build_and_run.sh
@@ -13,11 +13,14 @@ INSTALL_ROOT="$HOME/Applications"
INSTALL_BUNDLE="$INSTALL_ROOT/$APP_NAME.app"
APP_CONTENTS="$STAGING_BUNDLE/Contents"
APP_MACOS="$APP_CONTENTS/MacOS"
+APP_RESOURCES="$APP_CONTENTS/Resources"
+ICON_INFO_PLIST="$STAGING_ROOT/assetcatalog-generated-info.plist"
APP_BINARY="$APP_MACOS/$PROCESS_NAME"
CLI_BINARY="$APP_MACOS/defi"
INSTALLED_BINARY="$INSTALL_BUNDLE/Contents/MacOS/$PROCESS_NAME"
INSTALLED_CLI="$INSTALL_BUNDLE/Contents/MacOS/defi"
INFO_PLIST_SOURCE="$ROOT_DIR/Support/Defi-Info.plist"
+ICON_SOURCE="$ROOT_DIR/Support/Defi.icon"
DEFAULT_CONFIG_SOURCE="$ROOT_DIR/defi.example.toml"
CONFIG_DIR="$HOME/.config/defi"
CONFIG_FILE="$CONFIG_DIR/config.toml"
@@ -34,12 +37,32 @@ swift build -c "$BUILD_CONFIGURATION"
BIN_DIR="$(swift build -c "$BUILD_CONFIGURATION" --show-bin-path)"
rm -rf "$STAGING_BUNDLE"
-mkdir -p "$APP_MACOS"
+mkdir -p "$APP_MACOS" "$APP_RESOURCES"
cp "$BIN_DIR/$PROCESS_NAME" "$APP_BINARY"
cp "$BIN_DIR/defi" "$CLI_BINARY"
cp "$INFO_PLIST_SOURCE" "$APP_CONTENTS/Info.plist"
chmod +x "$APP_BINARY" "$CLI_BINARY"
+MINIMUM_SYSTEM_VERSION="$(/usr/bin/plutil -extract LSMinimumSystemVersion raw -o - "$INFO_PLIST_SOURCE")"
+/usr/bin/xcrun actool "$ICON_SOURCE" \
+ --compile "$APP_RESOURCES" \
+ --output-format human-readable-text \
+ --output-partial-info-plist "$ICON_INFO_PLIST" \
+ --notices \
+ --warnings \
+ --app-icon "$APP_NAME" \
+ --enable-on-demand-resources NO \
+ --development-region en \
+ --target-device mac \
+ --minimum-deployment-target "$MINIMUM_SYSTEM_VERSION" \
+ --platform macosx
+/usr/bin/plutil -insert CFBundleIconFile -string \
+ "$(/usr/bin/plutil -extract CFBundleIconFile raw -o - "$ICON_INFO_PLIST")" \
+ "$APP_CONTENTS/Info.plist"
+/usr/bin/plutil -insert CFBundleIconName -string \
+ "$(/usr/bin/plutil -extract CFBundleIconName raw -o - "$ICON_INFO_PLIST")" \
+ "$APP_CONTENTS/Info.plist"
+
SIGNING_IDENTITY="$("$ROOT_DIR/script/resolve_signing_identity.sh")"
codesign --force \
diff --git a/script/package_dmg.sh b/script/package_dmg.sh
index 1f91c85..3c5737a 100755
--- a/script/package_dmg.sh
+++ b/script/package_dmg.sh
@@ -10,6 +10,7 @@ STAGING_ROOT="$ROOT_DIR/dist"
STAGING_BUNDLE="$STAGING_ROOT/$APP_NAME.app"
DMG_ROOT="$STAGING_ROOT/dmg-root"
INFO_PLIST_SOURCE="$ROOT_DIR/Support/Defi-Info.plist"
+ICON_SOURCE="$ROOT_DIR/Support/Defi.icon"
cd "$ROOT_DIR"
@@ -19,17 +20,39 @@ DEFI_VERSION="$(/usr/bin/plutil -extract CFBundleShortVersionString raw -o - "$I
DMG_PATH="$STAGING_ROOT/$APP_NAME-$DEFI_VERSION.dmg"
APP_CONTENTS="$STAGING_BUNDLE/Contents"
APP_MACOS="$APP_CONTENTS/MacOS"
+APP_RESOURCES="$APP_CONTENTS/Resources"
+ICON_INFO_PLIST="$STAGING_ROOT/assetcatalog-generated-info.plist"
APP_BINARY="$APP_MACOS/$PROCESS_NAME"
CLI_BINARY="$APP_MACOS/defi"
rm -rf "$STAGING_BUNDLE" "$DMG_ROOT" "$DMG_PATH"
-mkdir -p "$APP_MACOS" "$DMG_ROOT"
+mkdir -p "$APP_MACOS" "$APP_RESOURCES" "$DMG_ROOT"
cp "$BIN_DIR/$PROCESS_NAME" "$APP_BINARY"
cp "$BIN_DIR/defi" "$CLI_BINARY"
cp "$INFO_PLIST_SOURCE" "$APP_CONTENTS/Info.plist"
chmod +x "$APP_BINARY" "$CLI_BINARY"
+MINIMUM_SYSTEM_VERSION="$(/usr/bin/plutil -extract LSMinimumSystemVersion raw -o - "$INFO_PLIST_SOURCE")"
+/usr/bin/xcrun actool "$ICON_SOURCE" \
+ --compile "$APP_RESOURCES" \
+ --output-format human-readable-text \
+ --output-partial-info-plist "$ICON_INFO_PLIST" \
+ --notices \
+ --warnings \
+ --app-icon "$APP_NAME" \
+ --enable-on-demand-resources NO \
+ --development-region en \
+ --target-device mac \
+ --minimum-deployment-target "$MINIMUM_SYSTEM_VERSION" \
+ --platform macosx
+/usr/bin/plutil -insert CFBundleIconFile -string \
+ "$(/usr/bin/plutil -extract CFBundleIconFile raw -o - "$ICON_INFO_PLIST")" \
+ "$APP_CONTENTS/Info.plist"
+/usr/bin/plutil -insert CFBundleIconName -string \
+ "$(/usr/bin/plutil -extract CFBundleIconName raw -o - "$ICON_INFO_PLIST")" \
+ "$APP_CONTENTS/Info.plist"
+
SIGNING_IDENTITY="$("$ROOT_DIR/script/resolve_signing_identity.sh")"
codesign --force \