Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screenshot #48

Open
JarbasAl opened this issue Nov 17, 2024 · 0 comments
Open

screenshot #48

JarbasAl opened this issue Nov 17, 2024 · 0 comments
Assignees

Comments

@JarbasAl
Copy link
Member

functionality should be moved out of homescreen as it is shell specific, otherwise the intent causes conflicts with other setups

    def initialize(self):
        self.bus.on("ovos.display.screenshot.get.response", self.screenshot_taken)

    def take_screenshot(self, message): # TODO define some bus event
        folder_path = self.settings.get("screenshot_folder", "")

        if not folder_path:
            folder_path = os.path.expanduser('~') + "/Pictures"

        if not os.path.exists(folder_path):
            try:
                os.makedirs(folder_path, exist_ok=True)
            except OSError as e:
                LOG.error("Could not create screenshot folder: " + str(e))
                folder_path = tempfile.gettempdir()

        self.bus.emit(Message("ovos.display.screenshot.get", {"folderpath": folder_path}))

    def screenshot_taken(self, message):
        result = message.data.get("result")
        display_message = f"Screenshot saved to {result}"
        self.gui.show_notification(display_message)

a screenshot skill should be made to emit this event (default?), or to run a dedicated bash command instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant