Skip to content

Commit a81bab0

Browse files
committed
Initial commit
0 parents  commit a81bab0

File tree

126 files changed

+10041
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+10041
-0
lines changed

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Xcode
2+
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
5+
## User settings
6+
xcuserdata/
7+
8+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
9+
*.xcscmblueprint
10+
*.xccheckout
11+
12+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
13+
build/
14+
Pre-Release/
15+
DerivedData/
16+
*.moved-aside
17+
*.pbxuser
18+
!default.pbxuser
19+
*.mode1v3
20+
!default.mode1v3
21+
*.mode2v3
22+
!default.mode2v3
23+
*.perspectivev3
24+
!default.perspectivev3
25+
26+
## Gcc Patch
27+
/*.gcno

LICENSE

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
For the DND Toggler (https://github.com/magobaol/streamdeck-dnd)
2+
3+
The MIT License
4+
5+
Original work Copyright 2018 Corsair Memory, Inc
6+
Modified work Copyright 2019 Jarno Le Conté
7+
Modified work Copyright 2021 Francesco Face
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14+
15+
------------------------------------------------------------------------------------
16+
For the Stream Deck Plugin Template Swift (https://github.com/JarnoLeConte/streamdeck-template-swift)
17+
18+
The MIT License
19+
20+
Original work Copyright 2018 Corsair Memory, Inc
21+
Modified work Copyright 2019 Jarno Le Conté
22+
23+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
24+
25+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
26+
27+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28+
29+
------------------------------------------------------------------------------------
30+
For the do-not-disturb code (https://github.com/sindresorhus/do-not-disturb)
31+
32+
MIT License
33+
34+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
35+
36+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
37+
38+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
39+
40+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# DND Toggler
2+
3+
Plugin for [Stream Deck](https://www.elgato.com/gaming/stream-deck) written in Swift (macOS only).
4+
5+
Implementation is based on the template [streamdeck-template-swift](https://github.com/JarnoLeConte/streamdeck-template-swift) by [Jarno Le Conté](https://github.com/JarnoLeConte).
6+
7+
Core DND functionalities are from [Sindre Sorhus](https://github.com/sindresorhus) in his NodeJS package [do-not-disturb](https://github.com/sindresorhus/do-not-disturb).
8+
9+
# Description
10+
11+
`DND Toggler` lets you control macOS DND (Do not disturb) mode from your Stream Deck.
12+
13+
# Features
14+
15+
- Toggle DND status
16+
- Provide a visual clue of the current DND status
17+
- code written in Swift
18+
- make use of Objective-C libraries
19+
- macOS only
20+
21+
![](screenshot.png)
22+
23+
24+
# Installation
25+
26+
In the release folder you can find the file `com.magobaol.dnd.streamDeckPlugin`: just download it and double click on it. You'll find it under the `Custom` group in your Stream Deck application.
27+
28+
# Known limitations
29+
30+
- The plugin is not compatible with Big Sur yet.
31+
- If you toggle DND on your system, the new status won't be reflected on your Stream Deck until you switch page and go back to the one where the plugin is placed.
32+
33+
# About this plugin
34+
There are lot of great Stream Deck plugins out there to control your Mac, like the [Airplane Mode](https://github.com/JarnoLeConte/streamdeck-airplanemode) or [AudioMute](https://github.com/fredemmott/StreamDeck-AudioMute), but there wasn't one to control DND.
35+
I'm completely new to XCode, Swift and StreamDeck plugins development, but I found all the needed pieces and sewed them together. If it hadn't be for code by [Jarno Le Conté](https://github.com/JarnoLeConte) and [Sindre Sorhus](https://github.com/sindresorhus) this would have took me much longer.
36+
37+
# Source
38+
If you want to compile the plugin by yourself, just clone the repo and open the project with XCode.
39+
To build it for final release, download the [DistributionTool from Elgato](https://developer.elgato.com/documentation/stream-deck/sdk/exporting-your-plugin/) and place it under a `Release` folder at the same level of `Sources`.
202 KB
Binary file not shown.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//==============================================================================
2+
/**
3+
@file ESDConnectionManager.h
4+
5+
@brief Wrapper to implement the communication with the Stream Deck application
6+
7+
@copyright (c) 2018, Corsair Memory, Inc.
8+
This source code is licensed under the MIT-style license found in the LICENSE file.
9+
10+
**/
11+
//==============================================================================
12+
13+
#import <Foundation/Foundation.h>
14+
15+
#import "ESDEventsProtocol.h"
16+
#import "ESDSDKDefines.h"
17+
18+
19+
NS_ASSUME_NONNULL_BEGIN
20+
21+
22+
@interface ESDConnectionManager : NSObject
23+
24+
- (instancetype)initWithPort:(int)inPort
25+
andPluginUUID:(NSString *)inPluginUUID
26+
andRegisterEvent:(NSString *)inRegisterEvent
27+
andInfo:(NSString *)inInfo
28+
andDelegate:(id<ESDEventsProtocol>)inDelegate;
29+
30+
31+
-(void)setTitle:(nullable NSString *)inTitle withContext:(id)inContext withTarget:(ESDSDKTarget)inTarget;
32+
-(void)setImage:(nullable NSString*)inBase64ImageString withContext:(id)inContext withTarget:(ESDSDKTarget)inTarget;
33+
-(void)showAlertForContext:(id)inContext;
34+
-(void)showOKForContext:(id)inContext;
35+
-(void)setSettings:(NSDictionary *)inSettings forContext:(id)inContext;
36+
-(void)setState:(NSNumber *)inState forContext:(id)inContext;
37+
-(void)logMessage:(NSString *)inMessage;
38+
39+
@end
40+
41+
NS_ASSUME_NONNULL_END
42+

0 commit comments

Comments
 (0)