-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
217 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// ImageAssetCommands.swift | ||
// Swifty-GPT | ||
// | ||
// Created by Chris Dillard on 5/10/23. | ||
// | ||
|
||
import Foundation | ||
func simulatorCommand(input: String) { | ||
multiPrinter("If No screen recording permission it won't work.") | ||
multiPrinter("Open System Settings and go to Privacy & Security > Screen Recording to grant permission.") | ||
VideoCapture.shared.captureSimulatorWindow() | ||
|
||
} | ||
func pathToWallpapers() -> String { | ||
"\(getWorkspaceFolder())\(swiftyGPTWorkspaceFirstName)/\("Wallpaper")" | ||
} | ||
func wallpaperCommand(input: String) { | ||
multiPrinter("Performing wallpaper command, this requires you have copied your macs Dynamic Wallpaper to the SWiftyGPTWorkspace/Wallpaper folder.") | ||
|
||
let wallpaperFolder = URL(fileURLWithPath:pathToWallpapers()) | ||
|
||
multiPrinter("searching \(wallpaperFolder)") | ||
let files = try? listFiles(at: wallpaperFolder) | ||
|
||
multiPrinter("Found \(files?.count ?? 0) wallpapers for choice.") | ||
|
||
} | ||
func listFiles(at url: URL) throws -> [URL] { | ||
|
||
let directoryContents = try FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: [], options: .skipsHiddenFiles) | ||
var retDir = [URL]() | ||
for content in directoryContents { | ||
retDir.append(content) | ||
} | ||
return retDir | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.