From 4e4bfe861696723be0bddbcad8c68e02b9052343 Mon Sep 17 00:00:00 2001 From: FireChickenProductivity <107892169+FireChickenProductivity@users.noreply.github.com> Date: Sat, 6 Jul 2024 09:27:49 -0600 Subject: [PATCH] Add tag for disabling screenshots (Part of the Better Exam Support Project) (#1470) Add the tag user.disable_screenshots to make it easier for users to disable screenshot commands in certain circumstances. This was part of the project discussed in a community meeting to add built in functionality to community itself to make it easier to disable certain commands under specific circumstances, such as when taking an exam. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- plugin/screenshot/screenshot.py | 2 ++ plugin/screenshot/screenshot.talon | 3 +++ 2 files changed, 5 insertions(+) diff --git a/plugin/screenshot/screenshot.py b/plugin/screenshot/screenshot.py index 650a161656..8152bc6501 100644 --- a/plugin/screenshot/screenshot.py +++ b/plugin/screenshot/screenshot.py @@ -7,6 +7,8 @@ mod = Module() +mod.tag("screenshot_disabled", desc="Activating this tag disables screenshot commands") + default_folder = "" if app.platform == "windows": default_folder = os.path.expanduser(os.path.join("~", r"OneDrive\\Pictures")) diff --git a/plugin/screenshot/screenshot.talon b/plugin/screenshot/screenshot.talon index c159d181fa..6aeed3b8a4 100644 --- a/plugin/screenshot/screenshot.talon +++ b/plugin/screenshot/screenshot.talon @@ -1,3 +1,6 @@ +not tag: user.screenshot_disabled +- + ^grab screen$: user.screenshot() ^grab screen $: user.screenshot(number_small) ^grab window$: user.screenshot_window()