[Newm] Have an easier time enabling/disabling app id logging

This commit is contained in:
Lucien Cartier-Tilet 2022-11-11 14:42:31 +01:00
parent 3c6fdaeff2
commit d8f6399394
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -15,6 +15,8 @@ from pywm import PYWM_MOD_LOGO, PYWM_MOD_ALT
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
debug_windows = False
def run_shell(command: str): def run_shell(command: str):
"""Run a shell command asynchronously """Run a shell command asynchronously
@ -92,9 +94,10 @@ def synchronous_update() -> None:
def rules(m_view): def rules(m_view):
blur_apps = ("kitty", "wofi", "emacsclient", "emacs") blur_apps = ("kitty", "wofi", "emacsclient", "emacs")
float_apps = ("Rofi",) float_apps = ("Rofi",)
# with open("/tmp/newm_windows.txt", "a", encoding="utf-8") as file: if debug_windows:
# file.write(str(m_view.app_id)) with open("/tmp/newm_windows.txt", "a", encoding="utf-8") as file:
# file.write("\n") file.write(str(m_view.app_id))
file.write("\n")
m_rules = {} m_rules = {}
if m_view.app_id in blur_apps: if m_view.app_id in blur_apps:
m_rules.update({"blur": {"radius": 6, "passes": 2}}) m_rules.update({"blur": {"radius": 6, "passes": 2}})