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

Fix NoneType object is not subscriptable error in scratchpad's smart focus #122

Merged
merged 5 commits into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyprland/plugins/scratchpads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,12 @@ async def _handle_focus_tracking(self, scratch: Scratch, active_window: str, act
if tracker and not tracker.prev_focused_window_wrkspc.startswith("special:"):
same_workspace = tracker.prev_focused_window_wrkspc == active_workspace
clients = await self.hyprctl_json("clients")
client = next(filter(lambda d: d.get("address") == tracker.prev_focused_window, clients), None)
client = next(filter(lambda d: d.get("address") == tracker.prev_focused_window, clients), {})
if (
scratch.have_address(active_window)
and same_workspace
and not scratch.have_address(tracker.prev_focused_window)
and not client["workspace"]["name"].startswith("special")
and not client.get("workspace", {}).get("name", "").startswith("special")
):
await self.hyprctl(f"focuswindow address:{tracker.prev_focused_window}")

Expand Down