From a22162568c07711481bd73371042dfad0edf3f1d Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Mon, 31 Oct 2022 16:18:46 -0500 Subject: [PATCH] added readme, license, and settingsmeta --- LICENSE | 11 +++++++++++ README.md | 31 +++++++++++++++++++++++++++++++ __init__.py | 9 +++++++-- settingsmeta.json | 13 +++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 settingsmeta.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7a3094a --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0eaf9da --- /dev/null +++ b/README.md @@ -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. diff --git a/__init__.py b/__init__.py index 1d140da..3522a86 100644 --- a/__init__.py +++ b/__init__.py @@ -11,7 +11,12 @@ class MeetingModeSkill(MycroftSkill): def __init__(self): super().__init__("MeetingModeSkill") + self.dnd_image = None 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): self.gui.register_handler('MeetingModeSkill.doNotDisturb', @@ -30,7 +35,7 @@ class MeetingModeSkill(MycroftSkill): DO NOT DISTURB @@ -38,7 +43,7 @@ class MeetingModeSkill(MycroftSkill):   -""" +""" % self.dnd_image 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')) diff --git a/settingsmeta.json b/settingsmeta.json new file mode 100644 index 0000000..649a2b0 --- /dev/null +++ b/settingsmeta.json @@ -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" + }] + }] + } +}