Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 15, 2023
1 parent 17e2c30 commit e8ec9a6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/app_switcher/app_switcher.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import re
import shlex
import subprocess
import time
from pathlib import Path
import re

import talon
from talon import Context, Module, actions, app, fs, imgui, ui
Expand Down Expand Up @@ -320,9 +320,13 @@ def switcher_focus_app(app: ui.App):
def switcher_focus_app_title(app: str, regex: str):
"""Focus the window whose app name constains app and title matches regex"""
for window in ui.windows():
if not(window.hidden) and (app in window.app.name or app == "*") and window.title != "":
if (
not (window.hidden)
and (app in window.app.name or app == "*")
and window.title != ""
):
# logging.warn(f'Checking Window: "{window.app.name}" window:"{window.title}" hidden: "{window.hidden}"')
if (regex is None or re.search(regex, window.title)):
if regex is None or re.search(regex, window.title):
window.focus()
return
logging.error(f'(switcher_focus_app_title) Window not found: "{app}" "{regex}"')
Expand Down

0 comments on commit e8ec9a6

Please sign in to comment.