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
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Defi

[![CI](https://github.com/qeude/Defi/actions/workflows/ci.yml/badge.svg)](https://github.com/qeude/Defi/actions/workflows/ci.yml)
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/defi-icon-dark.png">
<source media="(prefers-color-scheme: light)" srcset="docs/assets/defi-icon-light.png">
<img src="docs/assets/defi-icon-light.png" width="144" alt="Defi app icon">
</picture>
</p>

<h1 align="center">Defi</h1>

<p align="center">
<a href="https://github.com/qeude/Defi/actions/workflows/ci.yml"><img src="https://github.com/qeude/Defi/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
</p>

Defi is a native macOS scrolling-column window manager inspired by
[Niri](https://github.com/YaLTeR/niri). It is built around one simple idea:
Expand Down
3 changes: 3 additions & 0 deletions Support/Defi.icon/Assets/window.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
188 changes: 188 additions & 0 deletions Support/Defi.icon/icon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
{
Comment thread
qeude marked this conversation as resolved.
"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"
}
}
Binary file added docs/assets/defi-icon-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/defi-icon-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 24 additions & 1 deletion script/build_and_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 \
Expand Down
25 changes: 24 additions & 1 deletion script/package_dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 \
Expand Down