mirror of
https://github.com/neon443/DesktopGoose2.git
synced 2026-03-11 13:26:18 +00:00
rename to desktopduck
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
85
DesktopDuck/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
85
DesktopDuck/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "tinted"
|
||||
}
|
||||
],
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "512x512"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "512x512"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
6
DesktopDuck/Assets.xcassets/Contents.json
Normal file
6
DesktopDuck/Assets.xcassets/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
24
DesktopDuck/ContentView.swift
Normal file
24
DesktopDuck/ContentView.swift
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// DesktopGoose2
|
||||
//
|
||||
// Created by neon443 on 11/09/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContentView()
|
||||
}
|
||||
10
DesktopDuck/DesktopDuck.entitlements
Normal file
10
DesktopDuck/DesktopDuck.entitlements
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
20
DesktopDuck/DesktopDuckApp.swift
Normal file
20
DesktopDuck/DesktopDuckApp.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// DesktopGoose2App.swift
|
||||
// DesktopGoose2
|
||||
//
|
||||
// Created by neon443 on 11/09/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct DesktopDuckApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
.onAppear {
|
||||
let x = GooseWindow()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
DesktopDuck/GooseWindow.swift
Normal file
47
DesktopDuck/GooseWindow.swift
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// GooseWindow.swift
|
||||
// DesktopGoose2
|
||||
//
|
||||
// Created by neon443 on 11/09/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Cocoa
|
||||
|
||||
class GooseWindow {
|
||||
private var window: NSWindow
|
||||
var shown: Bool = false
|
||||
private var x = 1
|
||||
private var time: Timer?
|
||||
|
||||
init() {
|
||||
self.window = NSWindow(
|
||||
contentRect: CGRect(
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: NSScreen.main!.frame.width,
|
||||
height: NSScreen.main!.frame.width
|
||||
),
|
||||
styleMask: .borderless,
|
||||
backing: .buffered,
|
||||
defer: false
|
||||
)
|
||||
window.backgroundColor = .init(srgbRed: 1, green: 1, blue: 1, alpha: 0.1)
|
||||
window.contentView = NSImageView()
|
||||
window.isOpaque = false
|
||||
window.level = NSWindow.Level.screenSaver + 1
|
||||
window.ignoresMouseEvents = true
|
||||
window.hasShadow = false
|
||||
window.collectionBehavior = NSWindow.CollectionBehavior.canJoinAllSpaces.union(.canJoinAllApplications).union(.stationary)
|
||||
|
||||
showHide()
|
||||
}
|
||||
|
||||
func showHide() {
|
||||
if shown {
|
||||
window.orderOut(nil)
|
||||
} else {
|
||||
window.orderFront(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user