This file contains hidden or 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
echo "ON" | |
echo "STATE" > ~/scripts/state.flag | |
sudo systemctl start matrix |
This file contains hidden or 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
echo "OFF" | |
rm ~/scripts/state.flag | |
sudo systemctl stop matrix |
This file contains hidden or 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
[Unit] | |
Description=Matrix | |
After=multi-user.target | |
[Service] | |
Type=simple | |
ExecStart=/bin/sh -c '/usr/bin/sudo /home/pi/rpi-rgb-led-matrix/utils/led-image-viewer -f -s -w5 /home/pi/images/*.jpeg /home/pi/images/*.jpg /home /home/pi/images/*.png /home/pi/images/*.gif --led-gpio-mapping=adafruit-hat-pwm --led-cols=64 --led-rows=64' | |
User=pi |
This file contains hidden or 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
; | |
; Netatalk 3.x configuration file | |
; | |
[Global] | |
; Global server settings | |
; [Homes] | |
; basedir regex = /xxxx |
This file contains hidden or 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
{ | |
"accessory": "Script2", | |
"name": "LED Matrix", | |
"on": "~/scripts/on.sh 1", | |
"off": "~/scripts/off.sh 1", | |
"fileState": "~/scripts/state.flag" | |
} |
This file contains hidden or 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
.fileImporter( | |
isPresented: $isImporting, | |
allowedContentTypes: [.plainText], | |
allowsMultipleSelection: false | |
) { result in | |
do { | |
guard let selectedFile: URL = try result.get().first else { return } | |
guard let message = String(data: try Data(contentsOf: selectedFile), encoding: .utf8) else { return } | |
document.message = message |
This file contains hidden or 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
.fileExporter( | |
isPresented: $isExporting, | |
document: document, | |
contentType: .plainText, | |
defaultFilename: "Message" | |
) { result in | |
if case .success = result { | |
// Handle success. | |
} else { | |
// Handle failure. |
This file contains hidden or 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
struct ContentView: View { | |
@State private var document: MessageDocument = MessageDocument(message: "Hello, World!") | |
@State private var isImporting: Bool = false | |
@State private var isExporting: Bool = false | |
var body: some View { | |
VStack { | |
GroupBox(label: Text("Message:")) { | |
TextEditor(text: $document.message) |
This file contains hidden or 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
import SwiftUI | |
import UniformTypeIdentifiers | |
struct MessageDocument: FileDocument { | |
static var readableContentTypes: [UTType] { [.plainText] } | |
var message: String | |
init(message: String) { |
This file contains hidden or 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
@ObservedObject var document: DocExampleDocument |
NewerOlder