added readme, license, and settingsmeta

This commit is contained in:
Rudis Muiznieks 2022-10-31 16:18:46 -05:00
parent 43b2e35602
commit a22162568c
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
4 changed files with 62 additions and 2 deletions

11
LICENSE Normal file
View File

@ -0,0 +1,11 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

31
README.md Normal file
View File

@ -0,0 +1,31 @@
# mycroft-meeting-mode
A [Mycroft.ai](https://mycroft.ai) skill to display a DO NOT DISTURB message on the GUI.
## Install
This skill isn't in the official marketplace (for now) so the best way to install it is via the command line:
```
mycroft-msm install https://code.sitosis.com/rudism/mycroft-meeting-mode
```
## Setup
After installing the skill configure the `dnd_image` either in the settings json or on Mycroft Home. The default is `do-not-disturb.png` which displays a built-in image stating Do Not Disturb in white text on a red background, but you can replace this with the url to any image you want.
## Usage Examples
```
Hey Mycroft, meeting mode.
Hey Mycroft, do not disturb.
```
This will display the Do Not Disturb image on the GUI full-screen.
```
Hey Mycroft, cancel meeting mode.
Hey Mycroft, cancel do not disturb.
```
This will clear the image and return Mycroft to the default idle screen.

View File

@ -11,7 +11,12 @@ class MeetingModeSkill(MycroftSkill):
def __init__(self): def __init__(self):
super().__init__("MeetingModeSkill") super().__init__("MeetingModeSkill")
self.dnd_image = None
self.html_resources = "file://" + dirname(__file__) + '/res/' self.html_resources = "file://" + dirname(__file__) + '/res/'
self.on_settings_changed()
def on_settings_changed(self):
self.dnd_image = self.settings.get('dnd_image', 'do-not-disturb.png')
def initialize(self): def initialize(self):
self.gui.register_handler('MeetingModeSkill.doNotDisturb', self.gui.register_handler('MeetingModeSkill.doNotDisturb',
@ -30,7 +35,7 @@ class MeetingModeSkill(MycroftSkill):
<title>DO NOT DISTURB</title> <title>DO NOT DISTURB</title>
<style> <style>
html { html {
background: url('do-not-disturb.png') no-repeat center center fixed; background: url('%') no-repeat center center fixed;
background-size: cover; background-size: cover;
} }
</style> </style>
@ -38,7 +43,7 @@ class MeetingModeSkill(MycroftSkill):
&nbsp; &nbsp;
</body> </body>
</html> </html>
""" """ % self.dnd_image
self.gui.show_html(html, resource_url=self.html_resources, override_idle=True) self.gui.show_html(html, resource_url=self.html_resources, override_idle=True)
@intent_handler(IntentBuilder('handle_cancel_do_not_disturb_intent').require('cancel-do-not-disturb')) @intent_handler(IntentBuilder('handle_cancel_do_not_disturb_intent').require('cancel-do-not-disturb'))

13
settingsmeta.json Normal file
View File

@ -0,0 +1,13 @@
{
"skillMetadata": {
"sections": [{
"name": "Do Not Disturb Image",
"fields": [{
"name": "dnd_image",
"type": "text",
"label": "Location (file name or url) of the Do Not Disturb image to show.",
"value": "do-not-disturb.png"
}]
}]
}
}